Ec2 WG Compressed
Ec2 WG Compressed
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not
Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or
discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may
or may not be affiliated with, connected to, or sponsored by Amazon.
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Table of Contents
What is Amazon EC2? ......................................................................................................................... 1
Features of Amazon EC2 ............................................................................................................. 1
How to get started with Amazon EC2 ........................................................................................... 1
Related services ......................................................................................................................... 2
Access Amazon EC2 .................................................................................................................... 3
Pricing for Amazon EC2 .............................................................................................................. 3
PCI DSS compliance .................................................................................................................... 4
Set up .............................................................................................................................................. 5
Sign up for an AWS account ........................................................................................................ 5
Create an administrative user ...................................................................................................... 5
Create a key pair ........................................................................................................................ 6
Create a security group ............................................................................................................... 7
Get started tutorial ............................................................................................................................ 9
Overview ................................................................................................................................... 9
Prerequisites ............................................................................................................................ 10
Step 1: Launch an instance ........................................................................................................ 10
Step 2: Connect to your instance ............................................................................................... 11
Step 3: Clean up your instance .................................................................................................. 17
Next steps ............................................................................................................................... 17
Best practices .................................................................................................................................. 18
Amazon Machine Images ................................................................................................................... 21
Boot modes ............................................................................................................................. 21
Launch an instance ........................................................................................................... 22
AMI boot mode parameter ................................................................................................ 25
Instance type boot mode .................................................................................................. 25
Instance boot mode .......................................................................................................... 26
Operating system boot mode ............................................................................................ 27
Set AMI boot mode .......................................................................................................... 28
UEFI variables .................................................................................................................. 31
UEFI Secure Boot ............................................................................................................. 31
AWS Windows AMIs .................................................................................................................. 34
Select an initial Windows AMI ............................................................................................ 35
Keep your AMIs up to date ................................................................................................ 35
Virtualization types .......................................................................................................... 35
Configure your Windows AMI for faster launching ................................................................ 36
Managed AWS Windows AMIs ............................................................................................ 49
Specialized Windows AMIs ................................................................................................. 56
AWS Windows AMI version history ..................................................................................... 64
Find a Windows AMI ............................................................................................................... 115
Find a Windows AMI using the Amazon EC2 console ........................................................... 116
Find an AMI using the AWS Tools for Windows PowerShell ................................................... 117
Find an AMI using the AWS CLI ........................................................................................ 117
Find the latest Windows AMI using Systems Manager .......................................................... 117
Use a Systems Manager parameter to find an AMI .............................................................. 118
Shared AMIs ........................................................................................................................... 121
Verified provider ............................................................................................................. 121
Find shared AMIs ............................................................................................................ 121
Make an AMI public ........................................................................................................ 124
Share an AMI with organizations or OUs ........................................................................... 126
Share an AMI with specific AWS accounts .......................................................................... 133
Cancel having an AMI shared with your account ................................................................. 136
Use bookmarks .............................................................................................................. 138
Best practices for shared Windows AMIs ............................................................................ 138
Paid AMIs .............................................................................................................................. 139
iii
Amazon Elastic Compute Cloud
User Guide for Windows Instances
iv
Amazon Elastic Compute Cloud
User Guide for Windows Instances
v
Amazon Elastic Compute Cloud
User Guide for Windows Instances
vi
Amazon Elastic Compute Cloud
User Guide for Windows Instances
vii
Amazon Elastic Compute Cloud
User Guide for Windows Instances
viii
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ix
Amazon Elastic Compute Cloud
User Guide for Windows Instances
x
Amazon Elastic Compute Cloud
User Guide for Windows Instances
xi
Amazon Elastic Compute Cloud
User Guide for Windows Instances
xii
Amazon Elastic Compute Cloud
User Guide for Windows Instances
xiii
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Features of Amazon EC2
For more information about cloud computing, see What is cloud computing?
For more information about the features of Amazon EC2, see the Amazon EC2 product page.
Amazon EC2 enables you to run any compatible Windows-based solution on our high-performance,
reliable, cost-effective, cloud computing platform. For more information, see Windows Server on AWS.
For more information about running your website on AWS, see Web Hosting.
1
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Related services
Basics
Storage
• AWS Systems Manager Run Command in the AWS Systems Manager User Guide
If you have questions about whether AWS is right for you, contact AWS Sales. If you have technical
questions about Amazon EC2, use AWS re:Post.
Related services
You can provision Amazon EC2 resources, such as instances and volumes, directly using Amazon EC2.
You can also provision Amazon EC2 resources using other services in AWS. For more information, see the
following documentation:
To build websites or web applications, you can deploy and manage basic cloud resources using Amazon
Lightsail. To compare the features of Amazon EC2 and Lightsail for your use case, see Amazon Lightsail
or Amazon EC2.
To automatically distribute incoming application traffic across multiple instances, use Elastic Load
Balancing. For more information, see the Elastic Load Balancing User Guide.
To get a managed relational database in the cloud, use Amazon Relational Database Service (Amazon
RDS) to launch a database instance. Although you can set up a database on an EC2 instance, Amazon
2
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Access Amazon EC2
RDS offers the advantage of handling your database management tasks, such as patching the software,
backing up, and storing the backups. For more information, see the Amazon Relational Database Service
Developer Guide.
To make it easier to manage Docker containers on a cluster of EC2 instances, use Amazon Elastic
Container Service (Amazon ECS). For more information, see the Amazon Elastic Container Service
Developer Guide or the Amazon Elastic Container Service User Guide for AWS Fargate.
To monitor basic statistics for your instances and Amazon EBS volumes, use Amazon CloudWatch. For
more information, see the Amazon CloudWatch User Guide.
To detect potentially unauthorized or malicious use of your EC2 instances, use Amazon GuardDuty. For
more information see the Amazon GuardDuty User Guide.
If you prefer to use a command line interface, you have the following options:
Provides commands for a broad set of AWS products, and is supported on Windows, Mac, and Linux.
To get started, see AWS Command Line Interface User Guide. For more information about the
commands for Amazon EC2, see ec2 in the AWS CLI Command Reference.
AWS Tools for Windows PowerShell
Provides commands for a broad set of AWS products for those who script in the PowerShell
environment. To get started, see the AWS Tools for Windows PowerShell User Guide. For more
information about the cmdlets for Amazon EC2, see the AWS Tools for PowerShell Cmdlet
Reference.
Amazon EC2 supports creating resources using AWS CloudFormation. You create a template, in JSON
or YAML, that describes your AWS resources, and AWS CloudFormation provisions and configures
those resources for you. You can reuse your CloudFormation templates to provision the same resources
multiple times, whether in the same Region and account or in multiple Regions and accounts. For more
information about the resource types and properties for Amazon EC2, see EC2 resource type reference in
the AWS CloudFormation User Guide.
Amazon EC2 provides a Query API. These requests are HTTP or HTTPS requests that use the HTTP verbs
GET or POST and a Query parameter named Action. For more information about the API actions for
Amazon EC2, see Actions in the Amazon EC2 API Reference.
If you prefer to build applications using language-specific APIs instead of submitting a request over
HTTP or HTTPS, AWS provides libraries, sample code, tutorials, and other resources for software
developers. These libraries provide basic functions that automate tasks such as cryptographically signing
your requests, retrying requests, and handling error responses, making it easier for you to get started.
For more information, see Tools to Build on AWS.
3
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PCI DSS compliance
On-Demand Instances
Pay for the instances that you use by the second, with a minimum of 60 seconds, with no long-term
commitments or upfront payments.
Savings Plans
You can reduce your Amazon EC2 costs by making a commitment to a consistent amount of usage,
in USD per hour, for a term of 1 or 3 years.
Reserved Instances
You can reduce your Amazon EC2 costs by making a commitment to a specific instance
configuration, including instance type and Region, for a term of 1 or 3 years.
Spot Instances
Request unused EC2 instances, which can reduce your Amazon EC2 costs significantly.
For a complete list of charges and prices for Amazon EC2, see Amazon EC2 pricing.
When calculating the cost of a provisioned environment, remember to include incidental costs such as
snapshot storage for EBS volumes. To calculate the cost of a sample provisioned environment, see Cloud
Economics Center.
To see your bill, go to the Billing and Cost Management Dashboard in the AWS Billing and Cost
Management console. Your bill contains links to usage reports that provide details about your bill. To
learn more about AWS account billing, see AWS Billing and Cost Management User Guide.
If you have questions concerning AWS billing, accounts, and events, contact AWS Support.
For an overview of Trusted Advisor, a service that helps you optimize the costs, security, and performance
of your AWS environment, see AWS Trusted Advisor.
4
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Sign up for an AWS account
When you are finished, you will be ready for the Amazon EC2 Getting started (p. 9) tutorial.
1. Open https://portal.aws.amazon.com/billing/signup.
2. Follow the online instructions.
Part of the sign-up procedure involves receiving a phone call and entering a verification code on the
phone keypad.
When you sign up for an AWS account, an AWS account root user is created. The root user has access
to all AWS services and resources in the account. As a security best practice, assign administrative
access to an administrative user, and use only the root user to perform tasks that require root user
access.
AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view
your current account activity and manage your account by going to https://aws.amazon.com/ and
choosing My Account.
1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering
your AWS account email address. On the next page, enter your password.
For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide.
2. Turn on multi-factor authentication (MFA) for your root user.
5
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a key pair
For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM
User Guide.
• For your daily administrative tasks, grant administrative access to an administrative user in AWS IAM
Identity Center (successor to AWS Single Sign-On).
For instructions, see Getting started in the AWS IAM Identity Center (successor to AWS Single Sign-On)
User Guide.
• To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email
address when you created the IAM Identity Center user.
For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the
AWS Sign-In User Guide.
If you haven't created a key pair already, you can create one by using the Amazon EC2 console. Note that
if you plan to launch instances in multiple AWS Regions, you'll need to create a key pair in each Region.
For more information about Regions, see Regions and Zones (p. 1175).
For more information, see Amazon EC2 key pairs and Windows instances (p. 1476).
6
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a security group
Note that if you plan to launch instances in multiple AWS Regions, you'll need to create a security group
in each Region. For more information about Regions, see Regions and Zones (p. 1175).
Prerequisites
You'll need the public IPv4 address of your local computer. The security group editor in the Amazon
EC2 console can automatically detect the public IPv4 address for you. Alternatively, you can use the
search phrase "what is my IP address" in an internet browser, or use the following service: Check IP. If
you are connecting through an Internet service provider (ISP) or from behind a firewall without a static IP
address, you need to find out the range of IP addresses used by client computers.
You can create a custom security group using one of the following methods.
New console
a. Enter a name for the new security group and a description. Use a name that is easy for
you to remember, such as your user name, followed by _SG_, plus the Region name. For
example, me_SG_uswest2.
b. In the VPC list, select your default VPC for the Region.
6. For Inbound rules, create rules that allow specific traffic to reach your instance. For example,
use the following rules for a web server that accepts HTTP and HTTPS traffic. For more
examples, see Security group rules for different use cases (p. 1501).
a. Choose Add rule. For Type, choose HTTP. For Source, choose Anywhere.
b. Choose Add rule. For Type, choose HTTPS. For Source, choose Anywhere.
c. Choose Add rule. For Type, choose RDP. For Source, do one of the following:
• Choose My IP to automatically add the public IPv4 address of your local computer.
• Choose Custom and specify the public IPv4 address of your computer or network in CIDR
notation. To specify an individual IP address in CIDR notation, add the routing suffix /32,
for example, 203.0.113.25/32. If your company or your router allocates addresses
from a range, specify the entire range, such as 203.0.113.0/24.
Warning
For security reasons, do not choose Anywhere for Source with a rule for RDP. This
would allow access to your instance from all IP addresses on the internet. This is
acceptable for a short time in a test environment, but it is unsafe for production
environments.
7
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a security group
7. For Outbound rules, keep the default rule, which allows all outbound traffic.
8. Choose Create security group.
Old console
• Choose HTTP from the Type list, and make sure that Source is set to Anywhere (0.0.0.0/0).
• Choose HTTPS from the Type list, and make sure that Source is set to Anywhere
(0.0.0.0/0).
• Choose RDP from the Type list. In the Source box, choose My IP to automatically populate
the field with the public IPv4 address of your local computer. Alternatively, choose Custom
and specify the public IPv4 address of your computer or network in CIDR notation. To
specify an individual IP address in CIDR notation, add the routing suffix /32, for example,
203.0.113.25/32. If your company allocates addresses from a range, specify the entire
range, such as 203.0.113.0/24.
Warning
For security reasons, do not allow RDP access from all IP addresses to your instance.
This is acceptable for a short time in a test environment, but it is unsafe for
production environments.
7. On the Outbound rules tab, keep the default rule, which allows all outbound traffic.
8. Choose Create security group.
Command line
For more information, see Amazon EC2 security groups for Windows instances (p. 1488).
8
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Overview
When you sign up for AWS, you can get started with Amazon EC2 using the AWS Free Tier. If you created
your AWS account less than 12 months ago, and have not already exceeded the free tier benefits for
Amazon EC2, it won't cost you anything to complete this tutorial because we help you select options
that are within the free tier benefits. Otherwise, you'll incur the standard Amazon EC2 usage fees from
the time that you launch the instance until you terminate the instance (which is the final task of this
tutorial), even if it remains idle.
Related tutorials
• If you'd prefer to launch a Linux instance, see this tutorial in the Amazon EC2 User Guide for Linux
Instances: Get started with Amazon EC2 Linux instances.
• If you'd prefer to use the command line, see this tutorial in the AWS Command Line Interface User
Guide: Using Amazon EC2 through the AWS CLI.
Contents
• Overview (p. 9)
• Prerequisites (p. 10)
• Step 1: Launch an instance (p. 10)
• Step 2: Connect to your instance (p. 11)
• Step 3: Clean up your instance (p. 17)
• Next steps (p. 17)
Overview
The instance launched in this tutorial is an Amazon EBS-backed instance (meaning that the root volume
is an EBS volume). You can either specify the Availability Zone in which your instance runs, or let Amazon
EC2 select an Availability Zone for you. Availability Zones are multiple, isolated locations within each
Region. You can think of an Availability Zone as an isolated data center.
When you launch your instance, you secure it by specifying a key pair (to prove your identity) and a
security group (which acts as a virtual firewall to control ingoing and outgoing traffic). When you connect
to your instance, you must provide the private key of the key pair that you specified when you launched
your instance.
9
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Prerequisites
Prerequisites
Before you begin, be sure that you've completed the steps in Set up to use Amazon EC2 (p. 5).
To launch an instance
a. Choose Quick Start, and then choose Windows. This is the operating system (OS) for your
instance.
b. From Amazon Machine Image (AMI), select the AMI for Windows Server 2016 Base or later..
Notice that these AMIs are marked Free tier eligible. An Amazon Machine Image (AMI) is a basic
configuration that serves as a template for your instance.
5. Under Instance type, from the Instance type list, you can select the hardware configuration for your
instance. Choose the t2.micro instance type, which is selected by default. The t2.micro instance
type is eligible for the free tier. In Regions where t2.micro is unavailable, you can use a t3.micro
instance under the free tier. For more information, see AWS Free Tier.
6. Under Key pair (login), for Key pair name, choose the key pair that you created when getting set
up. Note that you must select an RSA key. ED25519 keys are not supported for Windows instances.
10
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
Warning
Do not choose Proceed without a key pair (Not recommended). If you launch your instance
without a key pair, then you can't connect to it.
7. Next to Network settings, choose Edit. For Security group name, you'll see that the wizard created
and selected a security group for you. You can use this security group, or alternatively you can select
the security group that you created when getting set up using the following steps:
hidden, choose the settings icon ( ) in the top-right corner, toggle on Public IPv4 DNS, and
choose Confirm.
12. It can take a few minutes for the instance to be ready for you to connect to it. Check that your
instance has passed its status checks; you can view this information in the Status check column.
The name of the administrator account depends on the language of the operating system. For
example, for English, it's Administrator, for French it's Administrateur, and for Portuguese it's
Administrador. For more information, see Localized Names for Administrator Account in Windows in
the Microsoft TechNet Wiki.
If you've joined your instance to a domain, you can connect to your instance using domain credentials
you've defined in AWS Directory Service. On the Remote Desktop login screen, instead of using the local
computer name and the generated password, use the fully-qualified user name for the administrator (for
example, corp.example.com\Admin), and the password for this account.
If you receive an error while attempting to connect to your instance, see Remote Desktop can't connect
to the remote computer (p. 1927).
New console
11
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
4. Choose Browse and navigate to the private key (.pem) file you created when you launched the
instance. Select the file and choose Open to copy the entire contents of the file to this window.
5. Choose Decrypt Password. The console displays the default administrator password for the
instance under Password, replacing the Get password link shown previously. Save the password
in a safe place. This password is required to connect to the instance.
12
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
6. Choose Download remote desktop file. Your browser prompts you to either open or save the
RDP shortcut file. When you have finished downloading the file, choose Cancel to return to the
Instances page.
• If you opened the RDP file, you'll see the Remote Desktop Connection dialog box.
• If you saved the RDP file, navigate to your downloads directory, and open the RDP file to
display the dialog box.
7. You may get a warning that the publisher of the remote connection is unknown. Choose
Connect to continue to connect to your instance.
13
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
8. The administrator account is chosen by default. Copy and paste the password that you saved
previously.
Tip
If you receive a "Password Failed" error, try entering the password manually. Copying
and pasting content can corrupt it.
9. Due to the nature of self-signed certificates, you may get a warning that the security certificate
could not be authenticated. Use the following steps to verify the identity of the remote
computer, or simply choose Yes (Windows) or Continue (Mac OS X) if you trust the certificate.
14
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
a. If you are using Remote Desktop Connection on a Windows computer, choose View
certificate. If you are using Microsoft Remote Desktop on a Mac, choose Show Certificate.
b. Choose the Details tab, and scroll down to Thumbprint (Windows) or SHA1 Fingerprints
(Mac OS X). This is the unique identifier for the remote computer's security certificate.
c. In the Amazon EC2 console, select the instance, choose Actions, Monitor and troubleshoot,
Get system log.
d. In the system log output, look for RDPCERTIFICATE-THUMBPRINT. If this value matches
the thumbprint or fingerprint of the certificate, you have verified the identity of the remote
computer.
e. If you are using Remote Desktop Connection on a Windows computer, return to the
Certificate dialog box and choose OK. If you are using Microsoft Remote Desktop on a
Mac, return to the Verify Certificate and choose Continue.
f. [Windows] Choose Yes in the Remote Desktop Connection window to connect to your
instance.
[Mac OS X] Log in as prompted, using the default administrator account and the default
administrator password that you recorded or copied previously. Note that you might need
to switch spaces to see the login screen. For more information, see Add spaces and switch
between them.
15
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Connect to your instance
Old console
1. In the Amazon EC2 console, select the instance, and then choose Connect.
2. In the Connect To Your Instance dialog box, choose Get Password (it will take a few minutes
after the instance is launched before the password is available).
3. Choose Browse and navigate to the private key (.pem) file you created when you launched
the instance. Select the file and choose Open to copy the entire contents of the file into the
Contents field.
4. Choose Decrypt Password. The console displays the default administrator password for the
instance in the Connect To Your Instance dialog box, replacing the link to Get Password shown
previously with the actual password.
5. Record the default administrator password, or copy it to the clipboard. You need this password
to connect to the instance.
6. Choose Download Remote Desktop File. Your browser prompts you to either open or save
the .rdp file. Either option is fine. When you have finished, you can choose Close to dismiss the
Connect To Your Instance dialog box.
• If you opened the .rdp file, you'll see the Remote Desktop Connection dialog box.
• If you saved the .rdp file, navigate to your downloads directory, and open the .rdp file to
display the dialog box.
7. You may get a warning that the publisher of the remote connection is unknown. You can
continue to connect to your instance.
8. When prompted, log in to the instance, using the administrator account for the operating
system and the password that you recorded or copied previously. If your Remote Desktop
Connection already has an administrator account set up, you might have to choose the Use
another account option and type the user name and password manually.
Note
Sometimes copying and pasting content can corrupt data. If you encounter a "Password
Failed" error when you log in, try typing in the password manually.
9. Due to the nature of self-signed certificates, you may get a warning that the security certificate
could not be authenticated. Use the following steps to verify the identity of the remote
computer, or simply choose Yes or Continue to continue if you trust the certificate.
a. If you are using Remote Desktop Connection from a Windows PC, choose View certificate.
If you are using Microsoft Remote Desktop on a Mac, choose Show Certificate.
b. Choose the Details tab, and scroll down to the Thumbprint entry on a Windows PC, or the
SHA1 Fingerprints entry on a Mac. This is the unique identifier for the remote computer's
security certificate.
c. In the Amazon EC2 console, select the instance, choose Actions, and then choose Get
System Log.
d. In the system log output, look for an entry labeled RDPCERTIFICATE-THUMBPRINT. If this
value matches the thumbprint or fingerprint of the certificate, you have verified the identity
of the remote computer.
e. If you are using Remote Desktop Connection from a Windows PC, return to the Certificate
dialog box and choose OK. If you are using Microsoft Remote Desktop on a Mac, return to
the Verify Certificate and choose Continue.
f. [Windows] Choose Yes in the Remote Desktop Connection window to connect to your
instance.
[Mac OS] Log in as prompted, using the default administrator account and the default
administrator password that you recorded or copied previously. Note that you might
16
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 3: Clean up your instance
need to switch spaces to see the login screen. For more information about spaces, see
support.apple.com/en-us/HT204100.
g. If you receive an error while attempting to connect to your instance, see Remote Desktop
can't connect to the remote computer (p. 1927).
If you launched an instance that is not within the AWS Free Tier, you'll stop incurring charges for that
instance as soon as the instance status changes to shutting down or terminated. To keep your
instance for later, but not incur charges, you can stop the instance now and then start it again later. For
more information, see Stop and start your instance (p. 580).
1. In the navigation pane, choose Instances. In the list of instances, select the instance.
2. Choose Instance state, Terminate instance.
3. Choose Terminate when prompted for confirmation.
Amazon EC2 shuts down and terminates your instance. After your instance is terminated, it remains
visible on the console for a short while, and then the entry is automatically deleted. You cannot
remove the terminated instance from the console display yourself.
Next steps
After you start your instance, you might want to try some of the following exercises:
• Learn how to remotely manage your EC2 instance using Run Command. For more information, see
AWS Systems Manager Run Command in the AWS Systems Manager User Guide.
• Configure a CloudWatch alarm to notify you if your usage exceeds the Free Tier. For more information,
see Tracking your AWS Free Tier usage in the AWS Billing User Guide.
• Add an EBS volume. For more information, see Create an Amazon EBS volume (p. 1539) and Attach an
Amazon EBS volume to an instance (p. 1542).
17
Amazon Elastic Compute Cloud
User Guide for Windows Instances
• Update drivers
• Use the latest Windows AMIs
• Security
• Storage
• Resource management
• Backup and recovery
• Networking
• To view updates to each release of the AWS Windows AMIs, see AWS Windows AMI version history.
• To build with the latest available AMIs, see Query for the Latest Windows AMI Using Systems Manager
Parameter Store.
• Instance types are properly configured, including instance size, enhanced networking, and tenancy
(shared or dedicated).
• Instance topology is appropriate for the workload and leverages high-performance features when
necessary, such as dedicated tenancy, placement groups, instance store volumes, and bare metal.
18
Amazon Elastic Compute Cloud
User Guide for Windows Instances
If you want to continue to use the EC2Config (Windows Server 2012 R2 and earlier) or EC2Launch
(Windows Server 2016 and later) agents, ensure that the latest issue fixes are applied across your fleet.
• For EC2Config update instructions, see Installing the Latest Version of EC2Config.
• For EC2Launch update instructions, see Installing the Latest Version of EC2Launch.
Security
When securing Windows instances, we recommend that you implement Active Directory Domain Services
to enable a scalable, secure, and manageable infrastructure for distributed locations. Additionally, after
launching instances from the Amazon EC2 console or by using an Amazon EC2 provisioning tool, such
as AWS CloudFormation, it is good practice to utilize native OS features, such as Microsoft Windows
PowerShell DSC to maintain configuration state in the event that configuration drift occurs.
Windows instances in AWS should adhere to the following high-level security best practices:
• Least Access: Grant access only to systems and locations that are trusted and expected. This applies
to all Microsoft products such as Active Directory, Microsoft business productivity servers, and
infrastructure services such as Remote Desktop Services, reverse proxy servers, IIS web servers,and
more. Use AWS capabilities such as Amazon EC2 instance security groups, network access control
lists (ACLs), and Amazon VPC public/private subnets to layer security across multiple locations in
an architecture. Within a Windows instance, customers can use Windows Firewall to further layer a
defense-in-depth strategy within their deployment. Install only the OS components and applications
that are necessary for the system to function as designed. Configure infrastructure services such as IIS
to run under service accounts, or to use features such as application pool identities to access resources
locally and remotely across your infrastructure.
• Least Privilege: Determine the minimum set of privileges that instances and accounts need in order to
perform their functions. Restrict these servers and users to only allow these defined permissions. Use
techniques such as Role Based Access Controls to reduce the surface area of administrative accounts,
and create the most limited roles to accomplish a task. Use OS features such as Encrypting File System
(EFS) within NTFS to encrypt sensitive data at rest, and control application and user access to it.
• Configuration Management: Create a baseline server configuration that incorporates up-to-date
security patches and host-based protection suites that include anti-virus, anti-malware, intrusion
detection/prevention, and file integrity monitoring. Assess each server against the current recorded
baseline to identify and flag any deviations. Ensure each server is configured to generate and securely
store appropriate log and audit data. For more information, see AWS Windows AMIs.
• Change Management: Create processes to control changes to server configuration baselines and
work toward fully automated change processes. Also, leverage Just Enough Administration (JEA) with
Windows PowerShell DSC to limit administrative access to the minimum required functions.
• Patch Management: Implement processes that regularly patch, update, and secure the operating
system and applications on your EC2 instances. For more information, see Update your Windows
instance (p. 53).
• Audit Logs: Audit access and all changes to Amazon EC2 instances to verify server integrity and ensure
only authorized changes are made. Leverage features such as Enhanced Logging for IIS to enhance
default logging capabilities. AWS capabilities such as VPC Flow Logs and AWS CloudTrail are also
available to audit network access, including allowed/denied requests and API calls, respectively.
Use AWS Security Hub controls to monitor your Amazon EC2 resources against security best practices
and security standards. For more information about using Security Hub, see Amazon Elastic Compute
Cloud controls in the AWS Security Hub User Guide.
19
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage
• Use separate Amazon EBS volumes for the operating system versus your data. Ensure that the volume
with your data persists after instance termination. For more information, see Preserve Amazon EBS
volumes on instance termination (p. 604).
• Use the instance store available for your instance to store temporary data. Remember that the data
stored in instance store is deleted when you stop, hibernate, or terminate your instance. If you use
instance store for database storage, ensure that you have a cluster with a replication factor that
ensures fault tolerance.
• Encrypt EBS volumes and snapshots. For more information, see Amazon EBS encryption (p. 1732).
Resource management
• Use instance metadata and custom resource tags to track and identify your AWS resources. For
more information, see Instance metadata and user data (p. 817) and Tag your Amazon EC2
resources (p. 1894).
• View your current limits for Amazon EC2. Plan to request any limit increases in advance of the time
that you'll need them. For more information, see Amazon EC2 service quotas (p. 1909).
• Use AWS Trusted Advisor to inspect your AWS environment, and then make recommendations when
opportunities exist to save money, improve system availability and performance, or help close security
gaps. For more information, see AWS Trusted Advisor in the AWS Support User Guide.
• Regularly back up your EBS volumes using Amazon EBS snapshots (p. 1569), and create an Amazon
Machine Image (AMI) (p. 21) from your instance to save the configuration as a template for
launching future instances. For more information on AWS services that help achieve this use case, see
AWS Backup and Amazon Data Lifecycle Manager.
• Deploy critical components of your application across multiple Availability Zones, and replicate your
data appropriately.
• Design your applications to handle dynamic IP addressing when your instance restarts. For more
information, see Amazon EC2 instance IP addressing (p. 1189).
• Monitor and respond to events. For more information, see Monitor Amazon EC2 (p. 1104).
• Ensure that you are prepared to handle failover. For a basic solution, you can manually attach a
network interface or Elastic IP address to a replacement instance. For more information, see Elastic
network interfaces (p. 1245). For an automated solution, you can use Amazon EC2 Auto Scaling. For
more information, see the Amazon EC2 Auto Scaling User Guide.
• Regularly test the process of recovering your instances and Amazon EBS volumes to ensure data and
services are restored successfully.
Networking
• Set the time-to-live (TTL) value for your applications to 255, for IPv4 and IPv6. If you use a smaller
value, there is a risk that the TTL will expire while application traffic is in transit, causing reachability
issues for your instances.
20
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Boot modes
• One or more Amazon Elastic Block Store (Amazon EBS) snapshots, or, for instance-store-backed AMIs,
a template for the root volume of the instance (for example, an operating system, an application
server, and applications).
• Launch permissions that control which AWS accounts can use the AMI to launch instances.
• A block device mapping that specifies the volumes to attach to the instance when it's launched.
Boot modes
When a computer boots, the first software that it runs is responsible for initializing the platform and
providing an interface for the operating system to perform platform-specific operations.
In Amazon EC2, two variants of the boot mode software are supported: Unified Extensible Firmware
Interface (UEFI) and Legacy BIOS.
An AMI can have one of the following boot mode parameter values: uefi, legacy-bios, or uefi-
preferred. The AMI boot mode parameter is optional. For AMIs with no boot mode parameter, the
instances launched from these AMIs use the default boot mode value of the instance type.
The AMI boot mode parameter signals to Amazon EC2 which boot mode to use when launching an
instance. When the boot mode parameter is set to uefi, EC2 attempts to launch the instance on UEFI. If
the operating system is not configured to support UEFI, the instance launch will be unsuccessful.
21
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch an instance
You can create AMIs that support both UEFI and Legacy BIOS by using the uefi-preferred boot
mode parameter. When the boot mode parameter is set to uefi-preferred, and if the instance type
supports UEFI, the instance is launched on UEFI. If the instance type does not support UEFI, the instance
is launched on Legacy BIOS.
Warning
Some features, like UEFI Secure Boot, are only available on instances that boot on UEFI. When
you use the uefi-preferred AMI boot mode parameter with an instance type that does not
support UEFI, the instance will launch as Legacy BIOS and the UEFI-dependent feature will be
disabled. If you rely on the availability of a UEFI-dependent feature, set your AMI boot mode
parameter to uefi.
Most Intel and AMD instance types can run on both UEFI and Legacy BIOS. To use UEFI, you must select
an AMI with the boot mode parameter set either to uefi or uefi-preferred, and the operating
system contained in the AMI must be configured to support UEFI.
Launch an instance
You can launch an instance in UEFI or Legacy BIOS boot mode.
Topics
• Limitations (p. 22)
• Considerations (p. 22)
• Requirements for launching an instance on UEFI (p. 24)
Limitations
UEFI boot is not supported in Local Zones, Wavelength Zones, or with AWS Outposts.
Considerations
Consider the following when launching an instance:
• The boot mode of the instance is determined by the configuration of the AMI, the operating system
contained in it, and the instance type, illustrated by the following image:
22
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch an instance
The following table shows that the boot mode of an instance (indicated by the Resulting instance
boot mode column) is determined by a combination of the boot mode parameter of the AMI (column
1), the boot mode configuration of the operating system contained in the AMI (column 2), and the
boot mode support of the instance type (column 3).
AMI boot mode Operating system Instance type boot Resulting instance
parameter boot mode mode support boot mode
configuration
UEFI Preferred Legacy BIOS UEFI and Legacy BIOS Legacy BIOS
No boot mode Legacy BIOS UEFI and Legacy BIOS Legacy BIOS
specified - x86
To see the available instance types that support UEFI in a specific Region
The available instance types vary by AWS Region. To see the available instance types that support UEFI
in a Region, use the describe-instance-types command with the --region parameter. If you omit the
--region parameter, your default Region is used in the request. Include the --filters parameter
to scope the results to the instance types that support UEFI and the --query parameter to scope the
output to the value of InstanceType.
23
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch an instance
Example output
a1.2xlarge
a1.4xlarge
a1.large
a1.medium
...
To see the available instance types that support UEFI Secure Boot and persist non-volatile
variables in a specific Region
Currently, bare metal instances do not support UEFI Secure Boot and non-volatile variables. Use the
describe-instance-types command as described in the preceding example, but filter out the bare metal
instances by including the Name=hypervisor,Values=nitro filter. For information about UEFI
Secure Boot, see UEFI Secure Boot (p. 31).
Instance type
When launching an instance, you must select an instance type that supports UEFI. For more
information, see Determine the supported boot modes of an instance type (p. 25).
AMI
When launching an instance, you must select an AMI that is configured for UEFI. The AMI must be
configured as follows:
• Operating system – The operating system contained in the AMI must be configured to use UEFI;
otherwise, the instance launch will fail. For more information, see Determine the boot mode of the
operating system (p. 27).
• AMI boot mode parameter – The boot mode parameter of the AMI must be set to uefi or uefi-
preferred. For more information, see Determine the boot mode parameter of an AMI (p. 25).
For information about Linux AMIs, see Requirements for launching an instance on UEFI in the Amazon
EC2 User Guide for Linux Instances.
24
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI boot mode parameter
Some AMIs don't have a boot mode parameter. When an AMI has no boot mode parameter, the instances
launched from the AMI use the default value of the instance type, which is uefi on Graviton, and
legacy-bios on Intel and AMD instance types.
To determine the boot mode parameter of an AMI when launching an instance (console)
When launching an instance using the launch instance wizard, at the step to select an AMI, inspect
the Boot mode field. For more information, see Application and OS Images (Amazon Machine
Image) (p. 542).
In the output, the BootMode field indicates the boot mode of the AMI. A value of uefi indicates that the
AMI supports UEFI. A value of uefi-preferred indicates that the AMI supports both UEFI and Legacy
BIOS.
Expected output
{
"Images": [
{
...
],
"EnaSupport": true,
"Hypervisor": "xen",
"ImageOwnerAlias": "amazon",
"Name": "UEFI_Boot_Mode_Enabled-Windows_Server-2016-English-Full-
Base-2020.09.30",
"RootDeviceName": "/dev/sda1",
"RootDeviceType": "ebs",
"SriovNetSupport": "simple",
"VirtualizationType": "hvm",
"BootMode": "uefi"
}
]
}
25
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance boot mode
Use the describe-instance-types command to determine the supported boot modes of an instance type.
By including the --query parameter, you can filter the output. In this example, the output is filtered to
return only the supported boot modes.
The following example shows that m5.2xlarge supports both UEFI and Legacy BIOS boot modes.
Expected output
[
[
"legacy-bios",
"uefi"
]
]
The following example shows that t2.xlarge supports only Legacy BIOS.
Expected output
[
[
"legacy-bios"
]
]
When an instance is launched, the value for its boot mode parameter is determined by the value of the
boot mode parameter of the AMI used to launch it, as follows:
• An AMI with a boot mode parameter of uefi creates an instance with a currentInstanceBootMode
parameter of uefi.
• An AMI with a boot mode parameter of legacy-bios creates an instance with a
currentInstanceBootMode parameter of legacy-bios.
• An AMI with a boot mode parameter of uefi-preferred creates an instance with a
currentInstanceBootMode parameter of uefi if the instance type supports UEFI; otherwise, it
creates an instance with a currentInstanceBootMode parameter of legacy-bios.
• An AMI with no boot mode parameter value creates an instance with a currentInstanceBootMode
parameter value that is dependent on whether the AMI architecture is ARM or x86 and the supported
boot mode of the instance type. The default boot mode is uefi on Graviton instance types, and
legacy-bios on Intel and AMD instance types.
26
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Operating system boot mode
2. In the navigation pane, choose Instances, and then select your instance.
3. On the Details tab, inspect the Boot mode field.
Use the describe-instances command to determine the boot mode of an instance. You can also
determine the boot mode of the AMI that was used to the create the instance.
• BootMode – The boot mode of the AMI that was used to create the instance.
• CurrentInstanceBootMode – The boot mode that is used to boot the instance at launch or start.
Expected output
{
"Reservations": [
{
"Groups": [],
"Instances": [
{
"AmiLaunchIndex": 0,
"ImageId": "ami-0e2063e7f6dc3bee8",
"InstanceId": "i-1234567890abcdef0",
"InstanceType": "m5.2xlarge",
...
},
"BootMode": "uefi",
"CurrentInstanceBootMode": "uefi"
}
],
"OwnerId": "1234567890",
"ReservationId": "r-1234567890abcdef0"
}
]
}
27
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set AMI boot mode
When the AMI boot mode is set to uefi-preferred, the instance boots as follows:
• For instance types that support both UEFI and Legacy BIOS (for example, m5.large), the instance
boots using UEFI.
• For instance types that support only Legacy BIOS (for example, m4.large), the instance boots using
Legacy BIOS.
Note
If you set the AMI boot mode to uefi-preferred, the operating system must support the
ability to boot both UEFI and Legacy BIOS.
Currently, you can't use the register-image command to create an AMI that supports both
NitroTPM (p. 1509) and UEFI Preferred.
Warning
Some features, like UEFI Secure Boot, are only available on instances that boot on UEFI. When
you use the uefi-preferred AMI boot mode parameter with an instance type that does not
support UEFI, the instance will launch as Legacy BIOS and the UEFI-dependent feature will be
disabled. If you rely on the availability of a UEFI-dependent feature, set your AMI boot mode
parameter to uefi.
To convert an existing Legacy BIOS-based instance to UEFI, or an existing UEFI-based instance to Legacy
BIOS, you need to perform a number of steps: First, modify the instance's volume and operating system
to support the selected boot mode. Then, create a snapshot of the volume. Finally, use register-image to
create the AMI using the snapshot.
You can't set the boot mode of an AMI using the create-image command. With create-image, the AMI
inherits the boot mode of the EC2 instance used for creating the AMI. For example, if you create an
AMI from an EC2 instance running on Legacy BIOS, the AMI boot mode will be configured as legacy-
bios. If you create an AMI from an EC2 instance that was launched using an AMI with a boot mode set to
uefi-preferred, the AMI that is created will also have its boot mode set to uefi-preferred.
Warning
Setting the AMI boot mode parameter does not automatically configure the operating system
for the specified boot mode. Before proceeding with these steps, you must first make suitable
modifications to the instance's volume and operating system to support booting using the
selected boot mode; otherwise, the resulting AMI will not be usable. For example, if you are
28
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set AMI boot mode
converting a Legacy BIOS-based instance to UEFI, you can use the MBR2GPT tool from Microsoft
to convert the system disk from MBR to GPT. The modifications that are required are operating
system-specific. For more information, see the manual for your operating system.
1. Make suitable modifications to the instance's volume and operating system to support booting via
the selected boot mode. The modifications that are required are operating system-specific. For more
information, see the manual for your operating system.
Note
If you don't perform this step, the AMI will not be usable.
2. To find the volume ID of the instance, use the describe-instances command. You'll create a snapshot
of this volume in the next step.
Expected output
...
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"AttachTime": "",
"DeleteOnTermination": true,
"Status": "attached",
"VolumeId": "vol-1234567890abcdef0"
}
}
...
3. To create a snapshot of the volume, use the create-snapshot command. Use the volume ID from the
previous step.
Expected output
{
"Description": "add text",
"Encrypted": false,
"OwnerId": "123",
"Progress": "",
"SnapshotId": "snap-01234567890abcdef",
"StartTime": "",
"State": "pending",
"VolumeId": "vol-1234567890abcdef0",
"VolumeSize": 30,
"Tags": []
}
29
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set AMI boot mode
Example output
{
"Snapshots": [
{
"Description": "This is my snapshot",
"Encrypted": false,
"VolumeId": "vol-049df61146c4d7901",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2019-02-28T21:28:32.000Z",
"Progress": "100%",
"OwnerId": "012345678910",
"SnapshotId": "snap-01234567890abcdef",
...
6. To create a new AMI, use the register-image command. Use the snapshot ID that you noted in the
earlier step.
• To set the boot mode to UEFI, add the --boot-mode parameter to the command and specify
uefi as the value.
• To set the boot mode to uefi-preferred, add the --boot-mode parameter to the command
and specify uefi-preferred as the value.
Expected output
{
"ImageId": "ami-new_ami_123"
}
7. To verify that the newly-created AMI has the boot mode that you specified in the previous step, use
the describe-images command.
30
Amazon Elastic Compute Cloud
User Guide for Windows Instances
UEFI variables
Expected output
{
"Images": [
{
"Architecture": "x86_64",
"CreationDate": "2021-01-06T14:31:04.000Z",
"ImageId": "ami-new_ami_123",
"ImageLocation": "",
...
"BootMode": "uefi"
}
]
}
If the AMI boot mode is uefi or legacy-bios, instances created from this AMI will have the same
boot mode as the AMI. If the AMI boot mode is uefi-preferred, the instance will boot using UEFI
if the instance type supports UEFI; otherwise, the instance will boot using Legacy BIOS. For more
information, see Considerations (p. 22).
9. To verify that the new instance has the expected boot mode, use the describe-instances command.
UEFI variables
When you launch an instance where the boot mode is set to UEFI, a key-value store for variables is
created. The store can be used by UEFI and the instance operating system for storing UEFI variables.
UEFI variables are used by the boot loader and the operating system to configure early system startup.
They allow the operating system to manage certain settings of the boot process, like the boot order, or
managing the keys for UEFI Secure Boot.
Warning
You can only access UEFI variables from within an instance. Anyone who can connect to an
instance, and potentially any software running on the instance, can read the variables. You
should never store sensitive data, such as passwords or personally identifiable information, in
the UEFI variable store.
• For instances that were launched on or before May 10, 2022, UEFI variables are wiped on reboot or
stop.
• For instances that are launched on or after May 11, 2022, UEFI variables that are marked as non-
volatile are persisted on reboot and stop/start.
• Bare metal instances don't preserve UEFI non-volatile variables across instance stop/start operations.
31
Amazon Elastic Compute Cloud
User Guide for Windows Instances
UEFI Secure Boot
keys are stored in the key database of the UEFI non-volatile variable store (p. 31). UEFI Secure Boot
prevents unauthorized modification of the instance boot flow.
Topics
• How UEFI Secure Boot works (p. 32)
• Launch a Windows instance with UEFI Secure Boot support (p. 33)
• Verify whether a Windows instance is enabled for UEFI Secure Boot (p. 33)
UEFI Secure Boot specifies four key databases, which are used in a chain of trust. The databases are
stored in the UEFI variable store.
The PK database is the root of trust. It contains a single public PK key that is used in the chain of
trust for updating the key exchange key (KEK) database.
To change the PK database, you must have the private PK key to sign an update request. This
includes deleting the PK database by writing an empty PK key.
Key exchange key (KEK) database
The KEK database is a list of public KEK keys that are used in the chain of trust for updating the
signature (db) and denylist (dbx) databases.
To change the public KEK database, you must have the private PK key to sign an update request.
Signature (db) database
The db database is a list of public keys and hashes that are used in the chain of trust to validate all
UEFI boot binaries.
To change the db database, you must have the private PK key or any of the private KEK keys to sign
an update request.
Signature denylist (dbx) database
The dbx database is a list of public keys and binary hashes that are not trusted, and are used in the
chain of trust as a revocation file.
The dbx database always takes precedence over all other key databases.
To change the dbx database, you must have the private PK key or any of the private KEK keys to sign
an update request.
The UEFI Forum maintains a publicly available dbx for many known-bad binaries and certs at
https://uefi.org/revocationlistfile.
Important
UEFI Secure Boot enforces signature validation on any UEFI binaries. To permit execution of a
UEFI binary in UEFI Secure Boot, you sign it with any of the private db keys described above.
32
Amazon Elastic Compute Cloud
User Guide for Windows Instances
UEFI Secure Boot
By default, UEFI Secure Boot is disabled and the system is in SetupMode. When the system is in
SetupMode, all key variables can be updated without a cryptographic signature. When the PK is set, UEFI
Secure Boot is enabled and the SetupMode is exited.
AMI
The following Windows AMIs are preconfigured to enable UEFI Secure Boot with Microsoft keys:
• TPM-Windows_Server-2022-English-Core-Base
• TPM-Windows_Server-2022-English-Full-Base
• TPM-Windows_Server-2022-English-Full-SQL_2022_Enterprise
• TPM-Windows_Server-2022-English-Full-SQL_2022_Standard
• TPM-Windows_Server-2019-English-Core-Base
• TPM-Windows_Server-2019-English-Full-Base
• TPM-Windows_Server-2019-English-Full-SQL_2019_Enterprise
• TPM-Windows_Server-2019-English-Full-SQL_2019_Standard
• TPM-Windows_Server-2016-English-Core-Base
• TPM-Windows_Server-2016-English-Full-Base
Currently, we do not support importing Windows with UEFI Secure Boot by using the import-image
command.
Instance type
• Supported: All virtualized instance types that support UEFI also support UEFI Secure Boot. For the
instance types that support UEFI Secure Boot, see Considerations (p. 22).
• Not supported: Bare metal instance types do not support UEFI Secure Boot.
For the prerequisites for Linux instances, see Launch an instance with UEFI Secure Boot support in the
Amazon EC2 User Guide for Linux Instances.
33
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMIs
2. Check the Secure Boot State field. Supported indicates that UEFI Secure Boot is enabled.
You can also use the Windows PowerShell Cmdlet Confirm-SecureBootUEFI to check the the Secure
Boot status. For more information about the cmdlet, see Confirm-SecureBootUEFI in the Microsoft
Documentation website.
To verify whether a Linux instance is enabled, see Verify whether a Linux instance is supported for UEFI
Secure Boot in the Amazon EC2 User Guide for Linux Instances.
When you launch an instance from a Windows AMI, the root device for the Windows instance is an
Amazon Elastic Block Store (Amazon EBS) volume. Windows AMIs do not support instance store for the
root device.
Windows AMIs that have been configured for faster launching are pre-provisioned, using snapshots to
launch instances up to 65% faster. To learn more about faster launching for Windows AMIs, including
how you can configure faster launching for your Windows AMI, see Configure your Windows AMI for
faster launching (p. 36).
Some Windows AMIs include an edition of Microsoft SQL Server (SQL Enterprise Edition, SQL Server
Standard, SQL Server Express, or SQL Server Web). Launching an instance from a Windows AMI with
Microsoft SQL Server enables you to run the instance as a database server. Alternatively, you can launch
an instance from any Windows AMI and then install the database software that you need on the instance.
Note
Microsoft no longer supports Windows Server 2003, 2008, and 2008 R2. We recommend that
you launch new EC2 instances using a supported version of Windows Server. If you have existing
EC2 instances that are running an unsupported version of Windows Server, we recommend that
you upgrade those instances to a supported version of Windows Server. For more information,
see Upgrade an Amazon EC2 Windows instance to a newer version of Windows Server (p. 881).
34
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Select an initial Windows AMI
You can also create an AMI from software running on your own Windows computer. For more
information, see the following services:
Use the AWS Systems Manager Automation runbook AWS-UpdateWindowsAmi to update an AMI by
installing Windows updates, Amazon software, and Amazon drivers. You can also use EC2 Image Builder,
a fully managed AWS service, to help automate creating up-to-date AMIs. For more information, see the
EC2 Image Builder User Guide.
For EC2 instances in an Auto Scaling group, you can create and use the PatchAMIAndUpdateASG
runbook to update an Auto Scaling group with a newly patched AMI. For more information, see Updating
AMIs for Auto Scaling groups in the AWS Systems Manager User Guide.
For existing EC2 instances, we recommend that you regularly patch, update, and secure the operating
system and applications. For more information, see Update your Windows instance (p. 53).
Virtualization types
AMIs use one of two types of virtualization: paravirtual (PV) or hardware virtual machine (HVM). The
main differences between PV and HVM AMIs are the way in which they boot and whether they can take
advantage of special hardware extensions for better performance. Windows AMIs are HVM AMIs.
HVM AMIs are presented with a fully virtualized set of hardware and boot by executing the master boot
record of the root block device of your image. This virtualization type provides the ability to run an
operating system directly on top of a virtual machine without any modification, as if it were run on the
bare-metal hardware. The Amazon EC2 host system emulates some or all of the underlying hardware
that is presented to the guest.
HVM guests can take advantage of hardware extensions that provide fast access to the underlying
hardware on the host system. HVM AMIs are required to take advantage of enhanced networking and
35
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
GPU processing. In order to pass through instructions to specialized network and GPU devices, the OS
needs to be able to have access to the native hardware platform; HVM virtualization provides this access.
Paravirtual guests traditionally performed better with storage and network operations than HVM guests
because they could leverage special drivers for I/O that avoided the overhead of emulating network
and disk hardware, whereas HVM guests had to translate these instructions to emulated hardware.
Now PV drivers are available for HVM guests, so Windows instances can get performance advantages in
storage and network I/O by using them. With these PV on HVM drivers, HVM guests can get the same
performance as paravirtual guests, or better.
When you configure a Windows AMI for faster launching, Amazon EC2 automatically creates the
snapshots for you, based on your settings, and you only pay for the resources that the process consumes.
This is not the same process as EBS fast snapshot restore. EBS fast snapshot restore must be explicitly
enabled on a per-snapshot basis, and has its own associated costs.
Note
Any account that has access to an AMI with faster launching enabled can benefit from reduced
launch times. However, it is the AMI owner's account that provides the snapshots that are
consumed for the launch.
Key terms
• Pre-provisioned snapshot – A snapshot of an instance that was launched from a Windows AMI with
faster launching enabled, and that has completed the following Windows launch steps, rebooting as
required. Amazon EC2 creates these snapshots automatically, based on your configuration.
• Sysprep specialize
• Windows Out of Box Experience (OOBE)
When these steps are complete, Amazon EC2 stops the instance, and creates a snapshot that is later
used for faster launching from the AMI.
• Launch frequency – Controls the number of pre-provisioned snapshots that Amazon EC2 can launch
within the specified timeframe. When you enable Windows Fast Launch for your AMI, Amazon EC2
creates the initial set of pre-provisioned snapshots in the background. For example, if the launch
frequency is set to five launches per hour, which is the default, then Amazon EC2 creates an initial set
of five pre-provisioned snapshots.
When Amazon EC2 launches an instance from an AMI with Windows Fast Launch enabled, it uses
one of the pre-provisioned snapshots to reduce the launch time. As snapshots are used, they are
automatically replenished, up to the number specified by the launch frequency.
If you expect a spike in the number of instances that are launched from your AMI – during a special
event, for example – you can increase the launch frequency in advance to cover the additional
instances that you'll need. When your launch rate returns to normal, you can adjust the frequency back
down.
When you experience a higher number of launches than anticipated, you might use up all the faster
launching snapshots that you have available. This does not cause any launches to fail. However,
it can result in some instances going through the standard launch process, until snapshots can be
replenished.
36
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
• Target resource count – The number of pre-provisioned snapshots to keep on hand for an AMI with
Windows Fast Launch enabled.
• Max parallel launches – Controls how many instances can be launched at a time for creating the pre-
provisioned snapshots. If your target resource count is higher than the maximum number of parallel
launches you've configured, Amazon EC2 will initially launch the number of instances specified by the
Max parallel launches setting for creating the snapshots. As those instances complete the process and
Amazon EC2 takes the snapshot and stops the instance, more instances are launched until the total
number of snapshots available has reached the target resource count. This value must be 6 or greater.
Resource costs
There is no service charge to configure Windows AMIs for faster launching. However, standard pricing
applies for underlying AWS resources that are used to prepare and store the pre-provisioned snapshots.
The following example demonstrates how associated costs are allocated.
Example scenario: The AtoZ Example company has a Windows AMI with a 50 GiB EBS root volume. They
enable faster launching for their AMI, and set the target resource count to five. Over the course of a
month, using Windows faster launching for their AMI costs them around $5.00, and the cost breakdown
is as follows:
1. When AtoZ Example enables faster launching, Amazon EC2 launches five small instances. Each
instance runs through the Sysprep and OOBE Windows launch steps, rebooting as required. This takes
several minutes for each instance (time can vary, based on how busy that Region or Availability Zone
(AZ) is, and on the size of the AMI).
Costs
• Instance runtime costs (or minimum runtime, if applicable): five instances
• Volume costs: five EBS root volumes
2. When the pre-provisioning process completes, Amazon EC2 takes a snapshot of the instance, which
it stores in Amazon S3. Snapshots are typically stored for 4–8 hours before they are consumed by a
launch. In this case, the cost is roughly $0.02 to $0.05 per snapshot.
Costs
• Snapshot storage (Amazon S3): five snapshots
3. After Amazon EC2 takes the snapshot, it stops the instance. At that point, the instance is no longer
accruing costs. However EBS volume costs continue to accrue.
Costs
• EBS volumes: costs continue for the associated EBS root volumes.
Note
The costs shown here are for demonstration purposes only. Your costs will vary, depending on
your AMI configuration and pricing plan.
Cost allocation tags can help you organize your AWS bill to reflect the costs associated with Windows
Fast Launch. You can use the following tag that Amazon EC2 adds to the resources it creates when it
prepares and stores pre-provisioned snapshots for Windows Fast Launch:
After you activate the tag in the Billing and Cost Management console, and set up your detailed billing
report, the user:CreatedBy column appears on the report. The column includes values from all
37
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
services. However, if you download the CSV file, you can import the data into a spreadsheet, and filter for
EC2 Fast Launch in the value. This information also appears in the AWS Cost and Usage Report when
the tag is activated.
To include resource tags in your cost reports, you must first activate the tag in the Billing and Cost
Management console. For more information, see Activating User-Defined Cost Allocation Tags in the
AWS Billing and Cost Management User Guide.
Note
Activation can take up to 24 hours.
If you already have a cost report set up, a column for your tag appears the next time the report runs
after activation is complete. To set up cost reports for the first time, choose one of the following.
• See Setting up a monthly cost allocation report in the AWS Billing and Cost Management User Guide.
• See Creating Cost and Usage Reports in the AWS Cost and Usage Report User Guide.
Note
It can take up to 24 hours for AWS to start delivering reports to your S3 bucket.
You can configure Windows AMIs that you own for faster launching using the Amazon EC2 console, API,
SDKs, or ec2 commands in the AWS CLI. The following sections cover configuration steps for the Amazon
EC2 console and AWS CLI.
Contents
• Prerequisites (p. 38)
• Use a launch template when you set up Windows Fast Launch (p. 39)
• Start Windows Fast Launch (p. 40)
• Stop Windows Fast Launch (p. 42)
• View AMIs with Windows Fast Launch enabled (AWS CLI) (p. 43)
• Monitor state changes with EventBridge (p. 45)
• Service-linked role for Windows Fast Launch (p. 47)
Prerequisites
Before you set up Windows Fast Launch, verify that you've met the following prerequisites:
• If you don't use a launch template to configure your settings, ensure that a default VPC is configured
for the Region in which you use Windows Fast Launch. You cannot have EC2 Classic enabled in the
Region, even if you have a default VPC configured. For more information about EC2 Classic, see EC2-
Classic Networking is Retiring - Here's How to Prepare.
Note
If you accidentally delete your default VPC in the Region where you plan to configure
Windows Fast Launch, you can create a new default VPC in that Region. To learn more, see
Create a default VPC in the Amazon VPC User Guide.
• To specify a non-default VPC, you must use a launch template when you configure Windows
fast launch. For more information, see Use a launch template when you set up Windows Fast
Launch (p. 39).
38
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
• If your account includes a policy that enforces IMDSv2 for Amazon EC2 instances, you must create a
launch template that specifies the metadata configuration to enforce IMDSv2.
• To change the settings for Windows Fast Launch, your AWS account must own the Windows AMI.
• To configure Windows Fast Launch for an AMI, you must create the AMI using Sysprep with the
shutdown option. EC2 Windows Fast Launch doesn't currently support AMIs that were created from a
running instance. To create an AMI using Sysprep, see Create a custom Windows AMI (p. 143).
Launch templates are optional, except for the following specific cases, where you must use a launch
template for your Windows AMI when you configure faster launching:
• You must use a launch template to specify a non-default VPC for your Windows AMI.
• If your account includes a policy that enforces IMDSv2 for Amazon EC2 instances, you must create a
launch template that specifies the metadata configuration to enforce IMDSv2.
Use the launch template that includes your metadata configuration from the EC2 console, or when you
run the enable-fast-launch command in the AWS CLI, or call the EnableFastLaunch API action.
Note
Amazon EC2 Windows Fast Launch doesn't support user data scripts in the launch template. If
you use a launch template for Windows Fast Launch, you must not specify user data.
Create a launch template that specifies the VPC for your Windows instances from the AWS Management
Console or from the AWS CLI. For more information, see Create a launch template (p. 556).
Step 2: Specify the launch template for your Windows Fast Launch AMI
• To specify the launch template for Windows Fast Launch, follow these steps:
To create a new launch template, you can choose Create launch template.
6. When you select a launch template, Amazon EC2 shows the default version for that template in
the Source template version box. To specify a different version, highlight the default version to
replace it, and enter the version number you want in the box.
39
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
For more information about EC2 launch templates, see Launch an instance from a launch
template (p. 554).
Console
Note
If you need to use a launch template to specify a non-default VPC, or to configure
metadata settings for IMDSv2, see Use a launch template when you set up Windows Fast
Launch (p. 39).
AWS CLI
The enable-fast-launch command calls the Amazon EC2 EnableFastLaunch API operation.
Syntax:
Example:
40
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
The following enable-fast-launch example starts Windows Fast Launch for the specified AMI,
launching six parallel instances for pre-provisioning. The ResourceType is set to snapshot, which
is the default value.
Output:
{
"ImageId": "ami-01234567890abcedf",
"ResourceType": "snapshot",
"SnapshotConfiguration": {
"TargetResourceCount": 10
},
"LaunchTemplate": {},
"MaxParallelLaunches": 6,
"OwnerId": "0123456789123",
"State": "enabling",
"StateTransitionReason": "Client.UserInitiated",
"StateTransitionTime": "2022-01-27T22:16:03.199000+00:00"
}
The Enable-EC2FastLaunch cmdlet calls the Amazon EC2 EnableFastLaunch API operation.
Syntax:
Enable-EC2FastLaunch
-ImageId <String>
-LaunchTemplate_LaunchTemplateId <String>
-LaunchTemplate_LaunchTemplateName <String>
-MaxParallelLaunch <Int32>
-ResourceType <String>
-SnapshotConfiguration_TargetResourceCount <Int32>
-LaunchTemplate_Version <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
Example:
The following Enable-EC2FastLaunch example starts Windows Fast Launch for the specified AMI,
launching six parallel instances for pre-provisioning. The ResourceType is set to snapshot, which
is the default value.
Enable-EC2FastLaunch `
-ImageId ami-01234567890abcedf `
-MaxParallelLaunch 6 `
-Region us-west-2 `
-ResourceType snapshot
Output:
41
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
ImageId : ami-01234567890abcedf
LaunchTemplate :
MaxParallelLaunches : 6
OwnerId : 0123456789123
ResourceType : snapshot
SnapshotConfiguration : Amazon.EC2.Model.FastLaunchSnapshotConfigurationResponse
State : enabling
StateTransitionReason : Client.UserInitiated
StateTransitionTime : 2/25/2022 12:24:11 PM
Console
AWS CLI
The disable-fast-launch command calls the Amazon EC2 DisableFastLaunch API operation.
Syntax:
Example:
The following disable-fast-launch example stops Windows Fast Launch on the specified AMI, and
cleans up existing pre-provisioned snapshots.
42
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
--image-id ami-01234567890abcedf
Output:
{
"ImageId": "ami-01234567890abcedf",
"ResourceType": "snapshot",
"SnapshotConfiguration": {},
"LaunchTemplate": {
"LaunchTemplateId": "lt-01234567890abcedf",
"LaunchTemplateName": "EC2FastLaunchDefaultResourceCreation-
a8c6215d-94e6-441b-9272-dbd1f87b07e2",
"Version": "1"
},
"MaxParallelLaunches": 6,
"OwnerId": "0123456789123",
"State": "disabling",
"StateTransitionReason": "Client.UserInitiated",
"StateTransitionTime": "2022-01-27T22:47:29.265000+00:00"
}
The Disable-EC2FastLaunch cmdlet calls the Amazon EC2 DisableFastLaunch API operation.
Syntax:
Disable-EC2FastLaunch
-ImageId <String>
-ForceStop <Boolean>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
Example:
The following Disable-EC2FastLaunch example stops Windows Fast Launch on the specified AMI, and
cleans up existing pre-provisioned snapshots.
Output:
ImageId : ami-01234567890abcedf
LaunchTemplate : Amazon.EC2.Model.FastLaunchLaunchTemplateSpecificationResponse
MaxParallelLaunches : 6
OwnerId : 0123456789123
ResourceType : snapshot
SnapshotConfiguration :
State : disabling
StateTransitionReason : Client.UserInitiated
StateTransitionTime : 2/25/2022 1:10:08 PM
43
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
Amazon EC2 provides the following details for each Windows AMI that is returned in the results:
AWS CLI
Syntax:
Example:
The following describe-fast-launch-images example describes the details for each of the AMIs in the
account that are configured for Windows Fast Launch. In this example, only one AMI in the account is
configured for Windows Fast Launch.
Output:
{
"FastLaunchImages": [
{
"ImageId": "ami-01234567890abcedf",
44
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
"ResourceType": "snapshot",
"SnapshotConfiguration": {},
"LaunchTemplate": {
"LaunchTemplateId": "lt-01234567890abcedf",
"LaunchTemplateName": "EC2FastLaunchDefaultResourceCreation-
a8c6215d-94e6-441b-9272-dbd1f87b07e2",
"Version": "1"
},
"MaxParallelLaunches": 6,
"OwnerId": "0123456789123",
"State": "enabled",
"StateTransitionReason": "Client.UserInitiated",
"StateTransitionTime": "2022-01-27T22:20:06.552000+00:00"
}
]
}
Syntax:
Get-EC2FastLaunchImage
-Filter <Filter[]>
-ImageId <String[]>
-MaxResult <Int32>
-NextToken <String>
-Select <String>
-NoAutoIteration <SwitchParameter>
Example:
The following Get-EC2FastLaunchImage example describes the details for each of the AMIs in the
account that are configured for Windows Fast Launch. In this example, only one AMI in the account is
configured for Windows Fast Launch.
Output:
ImageId : ami-01234567890abcedf
LaunchTemplate : Amazon.EC2.Model.FastLaunchLaunchTemplateSpecificationResponse
MaxParallelLaunches : 6
OwnerId : 0123456789123
ResourceType : snapshot
SnapshotConfiguration :
State : enabled
StateTransitionReason : Client.UserInitiated
StateTransitionTime : 2/25/2022 12:54:43 PM
45
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
You can create EventBridge rules that trigger one or more actions in response to the state change event.
For example, you can create an EventBridge rule that detects when Windows Fast Launch is enabled and
performs the following actions:
For more information, see Creating Amazon EventBridge rules that react to events in the Amazon
EventBridge User Guide.
The Windows Fast Launch feature emits JSON formatted state change events on a best-effort basis.
Amazon EC2 sends the events to EventBridge in near real time. This section describes the event fields
and shows an example of the event format.
imageId
Identifies the AMI with the Windows Fast Launch state change.
resourceType
The type of resource to use for pre-provisioning. Supported value: snapshot. The default value is
snapshot.
state
The current state of the Windows Fast Launch feature for the specified AMI. Valid values include the
following:
• enabling – You've enabled the Windows Fast Launch feature for the AMI, and Amazon EC2 has
started creating snapshots for the pre-provisioning process.
• enabling-failed – Something went wrong that caused the pre-provisioning process to fail the first
time that you enabled the Windows Fast Launch for an AMI. This can happen anytime during the
pre-provisioning process.
• enabled – The Windows Fast Launch feature is enabled. The state changes to enabled as soon as
Amazon EC2 creates the first pre-provisioned snapshot for a newly enabled Windows Fast Launch
AMI. If the AMI was already enabled and goes through pre-provisioning again, the state change
happens right away.
• enabled-failed – This state applies only if this is not the first time your Windows Fast Launch AMI
goes through the pre-provisioning process. This can happen if the Windows Fast Launch feature
is disabled and then later enabled again, or if there is a configuration change or other error after
pre-provisioning is completed for the first time.
• disabling – The AMI owner has turned off the Windows Fast Launch feature for the AMI, and
Amazon EC2 has started the clean up process.
• disabled – The Windows Fast Launch feature is disabled. The state changes to disabled as soon
as Amazon EC2 completes the clean up process.
• disabling-failed – Something went wrong that caused the clean up process to fail. This means
that some pre-provisioned snapshots may still remain in the account.
stateTransitionReason
The reason that the state changed for the Windows Fast Launch AMI.
46
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
Note
All fields in this event message are required.
The following example shows a newly enabled Windows Fast Launch AMI that has launched the first
instance to start the pre-provisioning process. At this point, the state is enabling. After Amazon EC2
creates the first pre-provisioned snapshot, the state changes to enabled.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EC2 Fast Launch State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2022-08-31T20:30:12Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:image/ami-123456789012"
],
"detail": {
"imageId": "ami-123456789012",
"resourceType": "snapshot",
"state": "enabling",
"stateTransitionReason": "Client.UserInitiated"
}
}
Amazon EC2 uses the service-linked role named AWSServiceRoleForEC2FastLaunch to create and
manage a set of pre-provisioned snapshots that reduce the time it takes to launch instances from your
Windows AMI.
You don't need to create this service-linked role manually. When you start using Windows Fast Launch
for your AMI, Amazon EC2 creates the service-linked role for you, if it doesn't already exist.
Note
If the service-linked role is deleted from your account, you can start Windows Fast Launch for
another Windows AMI to re-create the role in your account. Alternatively, you can stop Windows
Fast Launch for your current AMI, and then start it again. However, stopping the feature results
in your AMI using the standard launch process for all new instances while Amazon EC2 removes
all of your pre-provisioned snapshots. After all of the pre-provisioned snapshots are gone, you
can start using Windows Fast Launch for your AMI again.
Amazon EC2 does not allow you to edit the AWSServiceRoleForEC2FastLaunch service-linked role.
After you create a service-linked role, you cannot change the name of the role because various entities
might reference the role. However, you can edit the description of the role by using IAM. For more
information, see Editing a Service-Linked Role in the IAM User Guide.
You can delete a service-linked role only after first deleting all of the related resources. This protects the
Amazon EC2 resources that are associated with your AMI with Windows Fast Launch enabled, because
you can't inadvertently remove permission to access the resources.
Amazon EC2 supports the Windows Fast Launch service-linked role in all of the Regions where the
Amazon EC2 service is available. For more information, see Regions (p. 1176).
47
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your Windows AMI for faster launching
• cloudwatch:PutMetricData – Post metric data associated with Windows Fast Launch to the
Amazon EC2 namespace.
• ec2:CreateLaunchTemplate – Create a launch template for your AMI with Windows Fast Launch
enabled.
• ec2:CreateSnapshot – Create pre-provisioned snapshots for your AMI with Windows Fast Launch
enabled.
• ec2:CreateTags – Create tags for resources that are associated with launching and pre-provisioning
Windows instances for your AMI with Windows Fast Launch enabled.
• ec2:DeleteSnapshots – Delete all associated pre-provisioned snapshots if Windows Fast Launch is
turned off for a previously enabled AMI.
• ec2:DescribeImages – Describe images for all resources.
• ec2:DescribeInstanceAttribute – Describe instance attributes for all resources.
• ec2:DescribeInstanceStatus – Describe instance status for all resources.
• ec2:DescribeInstances – Describe instances for all resources.
• ec2:DescribeInstanceTypeOfferings – Describe instance type offerings for all resources.
• ec2:DescribeLaunchTemplates – Describe launch templates for all resources.
• ec2:DescribeLaunchTemplateVersions – Describe launch template versions for all resources.
• ec2:DescribeSnapshots – Describe snapshot resources for all resources.
• ec2:DescribeSubnets – Describe subnets for all resources.
• ec2:RunInstances – Launch instances from an AMI with Windows Fast Launch enabled, in order to
perform provisioning steps.
• ec2:StopInstances – Stop instances that were launched from an AMI with Windows Fast Launch
enabled, in order to create pre-provisioned snapshots.
• ec2:TerminateInstances – Terminate an instance that was launched from an AMI with Windows
Fast Launch enabled, after creating the pre-provisioned snapshot from it.
• iam:PassRole – Allows the AWSServiceRoleForEC2FastLaunch service-linked role to launch
instances on your behalf using the instance profile from your launch template.
For more information about using managed policies for Amazon EC2, see AWS managed policies for
Amazon Elastic Compute Cloud (p. 1461).
Access to customer managed keys for use with encrypted AMIs and EBS
snapshots
Prerequisite
• To enable Amazon EC2 to access an encrypted AMI on your behalf, you must have permission for the
createGrant action in the customer managed key.
When you enable Windows Fast Launch for an encrypted AMI, Amazon EC2 ensures that permission is
granted for the AWSServiceRoleForEC2FastLaunch role to use the customer managed key to access
your AMI. This permission is needed to launch instances and create pre-provisioned snapshots on your
behalf.
48
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
For information about other customizations, see AWS Windows AMIs (p. 34).
49
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
from Microsoft’s Volume Licensing Service Center (VLSC) and validates the hash to ensure it matches
Microsoft’s documentation for new Windows Server operating systems.
We perform the following changes using automation on AWS to take the current Windows Server AMIs
and update them:
• Install all Microsoft recommended Windows security patches. We release images shortly after the
monthly Microsoft patches are made available.
• Install the latest drivers for AWS hardware, including network and disk drivers, EC2WinUtil for
troubleshooting, as well as GPU drivers in selected AMIs.
• Include the following AWS launch agent software by default:
• EC2Launch v2 (p. 653) for Windows Server 2022 and optionally for Windows Server 2019 and
2016 with specific AMIs. For more information, see Configure a Windows instance using EC2Launch
v2.
• EC2Launch (p. 702) for Windows Server 2016 and 2019.
• EC2Config (p. 712) for Windows Server 2012 R2 and earlier.
• Configure Windows Time to use the Amazon Time Sync Service (p. 795) .
• Make changes in all power schemes to set the display to never turn off.
• Perform minor bug fixes – generally one-line registry changes to enable or disable features that we
have found to improve performance on AWS.
• Tests and validates AMIs across new and existing EC2 platforms to ensure compatibility, stability, and
consistency prior to release.
• Other than the previously mentioned changes, we keep the AMIs as close as possible to the Microsoft
default installation of Windows Server. For example, we keep the PowerShell and .NET Framework
installations as they are and don't install additional Windows roles, role services, or features.
• AWS provided Windows AMIs are built using source media obtained directly from Microsoft.
• Windows Updates are downloaded directly from Microsoft’s Windows Update Service by Windows, and
installed on the instance used to create the AMI during the image build process.
• AWS Software is downloaded from secure S3 buckets and installed in the AMIs.
• Drivers—such as for the chipset and GPU—are obtained directly from the vendor, stored in secure S3
buckets, and installed on the AMIs during the image build process.
• New AMI offerings are created for new OS releases. You can count on AWS releasing “Base,” “Core/
Container,” and “SQL Express/Standard/Web/Enterprise” offerings in English and other widely used
languages. The primary difference between Base and Core offerings is that Base offerings have a
desktop/GUI whereas Core offerings are PowerShell command line only. For more information about
Windows Server Core, see https://docs.microsoft.com/en-us/windows-server/administration/server-
core/what-is-server-core.
• New AMI offerings are created to support new platforms – for example, the Deep Learning and
“NVidia” AMIs were created to support customers using our GPU-based instance types (P2 and P3, G2
and G3, and more).
50
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
• Less popular AMIs are sometimes removed. If we see a particular AMI is launched only a few times in
its entire lifespan, we will remove it in favor of more widely used options.
If there is an AMI variant that you would like to see, let us know by filing a ticket with Cloud Support, or
by providing feedback through one of our established channels.
To ensure that customers have the latest security updates by default, AWS keeps Windows AMIs available
for three months. After releasing new Windows AMIs, AWS makes the Windows AMIs that are older than
three months private within 10 days. After an AMI has been made private, when you look at an instance
launched from that AMI in the console, the AMI ID field states, "Cannot load detail for ami-xxxxx. You
may not be permitted to view it." You can still retrieve the AMI ID using the AWS CLI or an AWS SDK.
The Windows AMIs in each release have new AMI IDs. Therefore, we recommend that you write scripts
that locate the latest AWS Windows AMIs by their names, rather than by their IDs. For more information,
see the following examples:
Change Applies to
Check for pending file renames or reboots, and reboot as needed All AMIs
Clear recent history (Start menu, Windows Explorer, and more) Windows Server 2012 R2 and
earlier
51
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
Change Applies to
Set EC2Launch to run at the next launch Windows Server 2016 and 2019
Change Applies to
Install the current AWS Tools for Windows PowerShell All AMIs
Install the current EC2Config and SSM Agent Windows Server 2012 R2 and
earlier
Install the current EC2Launch and SSM Agent Windows Server 2016 and 2019
Install the current EC2Launch v2 and SSM Agent Windows Server 2022 and later
Install the current AWS PV, ENA, and NVMe drivers Windows Server 2008 R2 and
later
Install the current Citrix PV driver Windows Server 2008 SP2 and
earlier
Install PowerShell 2.0 and 3.0 Windows Server 2008 SP2 and
R2
52
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
Change Applies to
• KB2582281
• KB2634328
• KB2800213
• KB2922223
• KB2394911
• KB2780879
Allow ICMP traffic through the firewall Windows Server 2012 R2 and
earlier
Configure an additional system managed paging file on Z:, if Windows Server 2012 R2 and
available earlier
Disable the Connected User Experiences and Telemetry service All AMIs
Run Windows Update and reboot until there are no pending All AMIs
updates
Set the display in all power schemes to never turn off All AMIs
53
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
You can manually install only the updates that interest you, or you can start from a current AWS
Windows AMI and build a new Windows instance. For information about finding the current AWS
Windows AMIs, and keeping your AMIs up to date, see Find a Windows AMI (p. 115) and Keep your AMIs
up to date (p. 35).
Note
Instances should be stateless when updating. For more information, see Managing Your AWS
Infrastructure at Scale.
For Windows instances, you can install updates to the following services or applications:
We recommend that you reboot your Windows instance after installing updates. For more information,
see Reboot your instance (p. 597).
a. For Topic ARN, copy and paste one of the following Amazon Resource Names (ARNs):
• arn:aws:sns:us-east-1:801119661308:ec2-windows-ami-update
• arn:aws:sns:us-east-1:801119661308:ec2-windows-ami-private
54
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Managed AWS Windows AMIs
arn:aws-us-gov:sns:us-gov-west-1:077303321853:ec2-windows-ami-update
b. For Protocol, choose Email.
c. For Endpoint, type an email address that you can use to receive the notifications.
d. Choose Create subscription.
6. You'll receive a confirmation email with the subject line AWS Notification - Subscription
Confirmation. Open the email and choose Confirm subscription to complete your subscription.
Whenever Windows AMIs are released, we send notifications to the subscribers of the ec2-windows-
ami-update topic. Whenever released Windows AMIs are made private, we send notifications to
the subscribers of the ec2-windows-ami-private topic. If you no longer want to receive these
notifications, use the following procedure to unsubscribe.
• To accommodate the change from .NET Framework to .NET Core, the EC2Config service has been
deprecated on Windows Server 2016 AMIs and replaced by EC2Launch. EC2Launch is a bundle of
Windows PowerShell scripts that perform many of the tasks performed by the EC2Config service.
For more information, see Configure a Windows instance using EC2Launch (p. 702). EC2Launch
v2 replaces EC2Launch in Windows Server 2022 and later. For more information, see Configure a
Windows instance using EC2Launch v2 (p. 653).
• On earlier versions of Windows Server AMIs, you can use the EC2Config service to join an EC2 instance
to a domain and configure integration with Amazon CloudWatch. On Windows Server 2016 and later
AMIs, you can use the CloudWatch agent to configure integration with Amazon CloudWatch. For
more information about configuring instances to send log data to CloudWatch, see Collect Metrics
and Logs from Amazon EC2 Instances and On-Premises Servers with the CloudWatch Agent. For
information about joining an EC2 instance to a domain, see Join an Instance to a Domain Using the
AWS-JoinDirectoryServiceDomain JSON Document in the AWS Systems Manager User Guide.
Other differences
Note the following additional important differences for instances created from Windows Server 2016
and later AMIs.
• By default, EC2Launch does not initialize secondary EBS volumes. You can configure EC2Launch to
initialize disks automatically by either scheduling the script to run or by calling EC2Launch in user data.
For the procedure to initialize disks using EC2Launch, see "Initialize Drives and Drive Letter Mappings"
in Configure EC2Launch (p. 705).
• If you previously enabled CloudWatch integration on your instances by using a local configuration file
(AWS.EC2.Windows.CloudWatch.json), you can configure the file to work with the SSM Agent on
instances created from Windows Server 2016 and later AMIs.
55
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
Topics
• SQL Server AMIs provided by AWS (p. 56)
• STIG Hardened Amazon EC2 Windows Server AMIs (p. 56)
To view changes to each release of the AWS Windows AMIs, including SQL Server updates, see the AWS
Windows AMI version history in the Amazon EC2 User Guide.
• Category I — The highest level of risk. It covers the most severe risks, and includes any vulnerability
that can result in a loss of confidentiality, availability, or integrity.
• Category II — Medium risk.
• Category III — Low risk.
Each compliance level includes all STIG settings from lower levels. This means that the highest level
includes all applicable settings from all levels.
To ensure that your systems are compliant with STIG standards, you must install, configure, and test a
variety of security settings. STIG Hardened EC2 Windows Server AMIs are pre-configured with over 160
required security settings. Amazon EC2 supports the following operating systems for STIG Hardened
AMIs:
56
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
The STIG Hardened AMIs include updated Department of Defense (DoD) certificates to help you get
started and achieve STIG compliance. STIG Hardened AMIs are available in all public AWS and GovCloud
Regions. You can launch instances from these AMIs directly from the Amazon EC2 console. They are
billed using standard Windows pricing. There are no additional charges for using STIG Hardened AMIs.
You can find the STIG Hardened EC2 Windows Server AMIs in the Community AMIs when you launch an
instance, as follows.
• Windows_Server-2022-English-STIG-Full-YYYY.MM.DD
• Windows_Server-2022-English-STIG-Core-YYYY.MM.DD
• Windows_Server-2019-English-STIG-Full-YYYY.MM.DD
• Windows_Server-2019-English-STIG-Core-YYYY.MM.DD
• Windows_Server-2016-English-STIG-Full-YYYY.MM.DD
• Windows_Server-2016-English-STIG-Core-YYYY.MM.DD
• Windows_Server-2012-R2-English-STIG-Full-YYYY.MM.DD
• Windows_Server-2012-R2-English-STIG-Core-YYYY.MM.DD
The following sections list the STIG settings that Amazon applies to Windows Operating Systems and
components.
Topics
• Core and base operating systems (p. 58)
• Microsoft .NET Framework 4.0 STIG Version 2 Release 2 (p. 60)
• Windows Firewall STIG Version 2 Release 1 (p. 60)
• Internet Explorer (IE) 11 STIG Version 2 Release 3 (p. 61)
• Microsoft Edge STIG Version 1 Release 6 (p. 61)
• Microsoft Defender STIG Version 2 Release 4 (p. 61)
• Version history (p. 62)
57
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
The following list contains STIG settings that apply for STIG Hardened Windows AMIs. Not all settings
apply in all cases. For example, some STIG settings might not apply to standalone servers. Organization-
specific policies can also affect which settings apply, such as a requirement for administrators to review
document settings.
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
This release includes the following STIG settings for Windows operating systems:
This release includes the following STIG settings for Windows operating systems:
58
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
This release includes the following STIG settings for Windows operating systems:
This release includes the following STIG settings for Windows operating systems:
59
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
V-225238
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
60
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
V-46473, V-46475, V-46477, V-46481, V-46483, V-46501, V-46507, V-46509, V-46511, V-46513,
V-46515, V-46517, V-46521, V-46523, V-46525, V-46543, V-46545, V-46547, V-46549, V-46553,
V-46555, V-46573, V-46575, V-46577, V-46579, V-46581, V-46583, V-46587, V-46589, V-46591,
V-46593, V-46597, V-46599, V-46601, V-46603, V-46605, V-46607, V-46609, V-46615, V-46617,
V-46619, V-46621, V-46625, V-46629, V-46633, V-46635, V-46637, V-46639, V-46641, V-46643,
V-46645, V-46647, V-46649, V-46653, V-46663, V-46665, V-46669, V-46681, V-46685, V-46689,
V-46691, V-46693, V-46695, V-46701, V-46705, V-46709, V-46711, V-46713, V-46715, V-46717,
V-46719, V-46721, V-46723, V-46725, V-46727, V-46729, V-46731, V-46733, V-46779, V-46781,
V-46787, V-46789, V-46791, V-46797, V-46799, V-46801, V-46807, V-46811, V-46815, V-46819,
V-46829, V-46841, V-46847, V-46849, V-46853, V-46857, V-46859, V-46861, V-46865, V-46869,
V-46879, V-46883, V-46885, V-46889, V-46893, V-46895, V-46897, V-46903, V-46907, V-46921,
V-46927, V-46939, V-46975, V-46981, V-46987, V-46995, V-46997, V-46999, V-47003, V-47005,
V-47009, V-64711, V-64713, V-64715, V-64717, V-64719, V-64721, V-64723, V-64725, V-64729,
V-72757, V-72759, V-72761, V-72763, V-75169, V-75171, and V-97527
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
For a complete list of Windows STIGs, see the STIGs Document Library. For information about how to
view the complete list, see STIG Viewing Tools.
61
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
Version history
The following table provides version history updates for STIG settings that are applied to Windows
operating systems and Windows components.
04/24/2023Windows Server 2022 STIG Version 1 Added support for Windows Server 2022,
Release 1 Microsoft Edge, and Microsoft Defender.
03/01/2023Windows Server 2019 STIG Version 2 AMIs released for 2022 Q4 with updated
Release 5 versions where applicable, and applied
STIGs.
Windows Server 2016 STIG Version 2
Release 5
07/21/2022Windows Server 2019 STIG Version 2 R4 AMIs released with updated versions where
applicable, and applied STIGs.
Windows Server 2016 STIG Version 2 R4
12/15/2021Windows Server 2019 STIG Version 2 R3 AMIs released with updated versions where
applicable, and applied STIGs.
Windows Server 2016 STIG Version 2 R3
62
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Specialized Windows AMIs
6/9/2021 Windows Server 2019 STIG Version 2 R2 Updated versions where applicable, and
applied STIGs.
Windows Server 2016 STIG Version 2 R2
4/5/2021 Windows Server 2019 STIG Version 2 R 1 Updated versions where applicable, and
applied STIGs.
Windows Server 2016 STIG Version 2 R 1
9/18/2020 Windows Server 2019 STIG V1 R 5 Updated versions and applied STIGs.
12/6/2019 Server 2012 R2 Core and Base V2 R17 Updated versions and applied STIGs.
63
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
For more information about components included in these AMIs, see the following:
Release Changes
64
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Windows Server 2012 R2
• TPM-Windows_Server-2019-English-Full-SQL_2019_Enterprise
• TPM-Windows_Server-2019-English-Full-SQL_2019_Standard
• TPM-Windows_Server-2022-English-Full-SQL_2022_Enterprise
• TPM-Windows_Server-2022-English-Full-SQL_2022_Standard
New Windows AMIs with Microsoft SQL Server with support for NitroTPM and
UEFI Secure Boot have been released. The images include Windows Server 2019
or Windows Server 2022 with SQL Server 2019 or SQL Server 2022. Each SQL
Server version is available in Standard and Enterprise editions.
65
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Release Changes
• Windows_Server-2019-English-Full-SQL_2022_Enterprise
• Windows_Server-2019-English-Full-SQL_2022_Express
• Windows_Server-2019-English-Full-SQL_2022_Standard
• Windows_Server-2019-English-Full-SQL_2022_Web
• Windows_Server-2019-Japanese-Full-SQL_2022_Enterprise
• Windows_Server-2019-Japanese-Full-SQL_2022_Standard
• Windows_Server-2019-Japanese-Full-SQL_2022_Web
• Windows_Server-2022-English-Full-SQL_2022_Enterprise
• Windows_Server-2022-English-Full-SQL_2022_Express
• Windows_Server-2022-English-Full-SQL_2022_Standard
• Windows_Server-2022-English-Full-SQL_2022_Web
• Windows_Server-2022-Japanese-Full-SQL_2022_Enterprise
66
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2022-Japanese-Full-SQL_2022_Standard
• Windows_Server-2022-Japanese-Full-SQL_2022_Web
This is an out of band release for images that use EC2Config as the default launch
agent. This includes all Windows Server 2012 RTM and Windows Server 2012 R2
AMIs. This release updates EC2Config to the latest version to improve support for
our newest EC2 instance types.
Previous versions of Amazon-published Windows AMIs dated July 13, 2022 and
earlier were made private.
67
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Previous versions of Amazon-published Windows AMIs dated June 15, 2022 and
earlier were made private.
Previous versions of Amazon-published Windows AMIs dated May 25, 2022 and
earlier were made private.
Windows Server version 20H2 will reach end-of-support on August 9th, 2022.
Existing instances and custom images owned by your account that are based on
Windows Server version 20H2 will not be impacted. If you would like to retain
access to Windows Server version 20H2, create a custom image in your account
prior to August 9th, 2022. All public versions of the following images will be
made private on the end-of-support date.
• Windows_Server-20H2-English-Core-Base
• Windows_Server-20H2-English-Core-ContainersLatest
Previous versions of Amazon-published Windows AMIs dated April 13th, 2022 and
earlier were made private.
68
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2012-R2_RTM-English-64Bit-SQL_2012_SP4_Enterprise-*
• Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Enterprise-*
• Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Express-*
• Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Standard-*
• Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Web-*
• Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Express-*
• Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Standard-*
• Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Web-*
• Windows_Server-2016-English-64Bit-SQL_2012_SP4_Enterprise-*
• Windows_Server-2016-English-Full-SQL_2012_SP4_Standard-*
For more information on Windows Server product lifecycles, please consult the
following Microsoft documentation and AWS Microsoft FAQ:
• https://docs.microsoft.com/en-us/lifecycle/products/microsoft-sql-
server-2012
• https://aws.amazon.com/windows/faq/#eos-mhttps://aws.amazon.com/
windows/faq/#eos-m
• Out-of-band updates applied to resolve issues resulting from May patches. For
additional details, see https://docs.microsoft.com/en-us/windows/release-
health/status-windows-10-20h2#2826msgdesc.
69
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
New Windows AMIs with support for NitroTPM and UEFI Secure Boot have been
released. These images feature EC2Launch v2 as the default launch agent. They
are available to launch on any instance type that supports NitroTPM and UEFI
boot mode.
• TPM-Windows_Server-2022-English-Core-Base-2022.05.05
• TPM-Windows_Server-2022-English-Full-Base-2022.05.05
• TPM-Windows_Server-2019-English-Core-Base-2022.05.05
• TPM-Windows_Server-2019-English-Full-Base-2022.05.05
• TPM-Windows_Server-2016-English-Core-Base-2022.05.05
• TPM-Windows_Server-2016-English-Full-Base-2022.05.05
70
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
After June 2022, we will no longer release updated versions of the following
images that include SQL Server 2016 SP2. SQL Server SP3 AMIs are available and
will continue to be updated and released monthly.
• Windows_Server-2019-English-Full-SQL_2016_SP2_Web
• Windows_Server-2019-English-Full-SQL_2016_SP2_Standard
• Windows_Server-2019-English-Full-SQL_2016_SP2_Express
• Windows_Server-2019-English-Full-SQL_2016_SP2_Enterprise
• Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Web
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Express
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Enterprise
• Windows_Server-2016-English-Full-SQL_2016_SP2_Web
• Windows_Server-2016-English-Full-SQL_2016_SP2_Standard
• Windows_Server-2016-English-Full-SQL_2016_SP2_Express
• Windows_Server-2016-English-Full-SQL_2016_SP2_Enterprise
• Windows_Server-2016-English-Core-SQL_2016_SP2_Web
• Windows_Server-2016-English-Core-SQL_2016_SP2_Standard
• Windows_Server-2016-English-Core-SQL_2016_SP2_Express
• Windows_Server-2016-English-Core-SQL_2016_SP2_Enterprise
• Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Web
• Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Standard
• Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Express
• Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Enterprise
• Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Web
• Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Standard
• Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Express
• Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Enterprise
71
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
72
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2004-English-Core-Base
• Windows_Server-2004-English-Core-ContainersLatest
• Windows_Server-2022-Japanese-Full-SQL_2019_Enterprise-2021.11.10
• Windows_Server-2022-Japanese-Full-SQL_2019_Standard-2021.11.10
• Windows_Server-2022-Japanese-Full-SQL_2019_Web-2021.11.10
• Windows_Server-2022-Japanese-Full-SQL_2017_Enterprise-2021.11.10
• Windows_Server-2022-Japanese-Full-SQL_2017_Standard-2021.11.10
• Windows_Server-2022-Japanese-Full-SQL_2017_Web-2021.11.10
73
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• SSM version 3.1.338.0
• Windows_Server-2022-English-Full-SQL_2019_Enterprise-2021.10.13
• Windows_Server-2022-English-Full-SQL_2019_Standard-2021.10.13
• Windows_Server-2022-English-Full-SQL_2019_Web-2021.10.13
• Windows_Server-2022-English-Full-SQL_2019_Express-2021.10.13
• Windows_Server-2022-English-Full-SQL_2017_Enterprise-2021.10.13
• Windows_Server-2022-English-Full-SQL_2017_Standard-2021.10.13
• Windows_Server-2022-English-Full-SQL_2017_Web-2021.10.13
• Windows_Server-2022-English-Full-SQL_2017_Express-2021.10.13
The following AMIs with EC2Launch v2 long-term support are now available. The
following AMIs include EC2Launch v2 as the default launch agent and will be
updated with new versions each month.
• EC2LaunchV2-Windows_Server-2019-English-Full-Base-2021.10.13
• EC2LaunchV2-Windows_Server-2019-English-Core-Base-2021.10.13
• EC2LaunchV2-Windows_Server-2019-English-Full-
ContainersLatest-2021.10.13
• EC2LaunchV2-Windows_Server-2016-English-Full-Base-2021.10.13
• EC2LaunchV2-Windows_Server-2016-English-Core-Base-2021.10.13
• EC2LaunchV2-Windows_Server-2012_R2_RTM-English-Full-Base-2021.10.13
• EC2LaunchV2-Windows_Server-2012_RTM-English-Full-Base-2021.10.13
EC2LaunchV2_Preview AMIs are discontinued, and will not be updated with new
versions. However, earlier versions will continue to be available until January
2022. Existing images and custom images based on EC2LaunchV2_Preview AMIs
will not be impacted, and you can continue to use them in your account. We
recommend that you use the new EC2Launch v2 AMIs going forward to receive
security and software updates.
74
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2004-English-Core-Base
• Windows_Server-2004-English-Core-ContainersLatest
Previous versions of Amazon-published Windows AMIs dated July 14th, 2021 and
earlier were made private.
Previous versions of Amazon-published Windows AMIs dated June 9th, 2021 and
earlier were made private.
75
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2022-English-Full-Base-2021.08.25
• Windows_Server-2022-English-Full-ContainersLatest-2021.08.25
• Windows_Server-2022-English-Core-Base-2021.08.25
• Windows_Server-2022-English-Core-ContainersLatest-2021.08.25
• Windows_Server-2022-Chinese_Simplified-Full-Base-2021.08.25
• Windows_Server-2022-Chinese_Traditional-Full-Base-2021.08.25
• Windows_Server-2022-Czech-Full-Base-2021.08.25
• Windows_Server-2022-Dutch-Full-Base-2021.08.25
• Windows_Server-2022-French-Full-Base-2021.08.25
• Windows_Server-2022-German-Full-Base-2021.08.25
• Windows_Server-2022-Hungarian-Full-Base-2021.08.25
• Windows_Server-2022-Italian-Full-Base-2021.08.25
• Windows_Server-2022-Japanese-Full-Base-2021.08.25
• Windows_Server-2022-Korean-Full-Base-2021.08.25
• Windows_Server-2022-Polish-Full-Base-2021.08.25
• Windows_Server-2022-Portuguese_Brazil-Full-Base-2021.08.25
• Windows_Server-2022-Portuguese_Portugal-Full-Base-2021.08.25
• Windows_Server-2022-Russian-Full-Base-2021.08.25
• Windows_Server-2022-Spanish-Full-Base-2021.08.25
• Windows_Server-2022-Swedish-Full-Base-2021.08.25
• Windows_Server-2022-Turkish-Full-Base-2021.08.25
EC2LaunchV2_Preview AMIs
Previous versions of Amazon-published Windows AMIs dated May 12th, 2021 and
earlier were made private.
76
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
EC2LaunchV2_Preview AMIs
Previous versions of Amazon-published Windows AMIs dated April 14th, 2021 and
earlier were made private.
Out-of-band AMI release that applies the July out-of-band security update
recently released by Microsoft as an additional mitigation to CVE-34527.
Note
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows
NT\Printers\PointAndPrint is not defined on Windows AMIs
provided by AWS, which is the default state.
• https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527
• https://support.microsoft.com/en-us/topic/kb5005010-restricting-
installation-of-new-printer-drivers-after-applying-the-july-6-2021-
updates-31b91c02-05bc-4ada-a7ea-183b129578a7
77
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
78
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
EC2LaunchV2_Preview AMIs
79
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Note
Amazon Root CAs have been added to the Trusted Root Certification
Authorities certificate store on all AMIs. For more information, see
https://www.amazontrust.com/repository/#rootcas.
80
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Beginning in March 2021, Windows AMIs provided by AWS include Amazon Root
CAs in the certificate store to minimize potential disruption from the upcoming
S3 and CloudFront certificate migration, which is scheduled for March 23rd, 2021.
For more information, see the following:
• https://aws.amazon.com/blogs/security/how-to-prepare-for-aws-move-to-its-
own-certificate-authority/
• https://forums.aws.amazon.com/ann.jspa?annID=7541
• https://blogs.windows.com/msedgedev/2020/09/04/update-adobe-flash-end-
support/
• https://www.adobe.com/products/flashplayer/end-of-life.html
EC2LaunchV2_Preview AMIs
• Windows_Server-2016-Japanese-Full-SQL_2019_Enterprise-2021.02.10
• Windows_Server-2016-Japanese-Full-SQL_2019_Standard-2021.02.10
• Windows_Server-2016-Japanese-Full-SQL_2019_Web-2021.02.10
• Windows_Server-2019-Japanese-Full-SQL_2019_Enterprise-2021.02.10
• Windows_Server-2019-Japanese-Full-SQL_2019_Standard-2021.02.10
• Windows_Server-2019-Japanese-Full-SQL_2019_Web-2021.02.10
81
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
EC2LaunchV2_Preview AMIs
• Windows_Server-20H2-English-Core-Base-2020.11.11
• Windows_Server-20H2-English-Core-ContainersLatest-2020.11.11
82
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• cfn-init version 1.4.34
• Previous versions of Amazon-published Windows AMIs dated July 15th, 2020
and earlier were made private.
2020.9.25 A new version of Amazon Machine Images with SQL Server 2019 dated
2020.09.25 has been released. This release includes the same software
components as the previous release dated 2020.09.09 but does not include
CU7 for SQL 2019, which has recently been removed from public availability by
Microsoft due to a known issue with reliability of the database snapshot feature.
For more information, please see the following Microsoft blog post: https://
techcommunity.microsoft.com/t5/sql-server/cumulative-update-7-for-sql-
server-2019-rtm-removed/ba-p/1629317.
• Windows_Server-2016-English-Full-SQL_2019_Enterprise-2020.09.25
• Windows_Server-2016-English-Full-SQL_2019_Express-2020.09.25
• Windows_Server-2016-English-Full-SQL_2019_Standard-2020.09.25
• Windows_Server-2016-English-Full-SQL_2019_Web-2020.09.25
• Windows_Server-2019-English-Full-SQL_2019_Enterprise-2020.09.25
• Windows_Server-2019-English-Full-SQL_2019_Express-2020.09.25
• Windows_Server-2019-English-Full-SQL_2019_Standard-2020.09.25
• Windows_Server-2019-English-Full-SQL_2019_Web-2020.09.25
EC2LaunchV2_Preview AMIs
• EC2LaunchV2_Preview-Windows_Server-2019-English-Full-
SQL_2019_Express-2020.09.25
EC2LaunchV2_Preview AMIs
83
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
84
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
2020.7.01 A new version of Amazon Machine Images has been released. These images
include EC2Launch v2 and serve as a functional preview of the new launch agent
in advance of it being included by default on all Windows AMIs currently provided
by AWS later this year. Note that some SSM documents and dependent services,
such as EC2 Image Builder, may require updates to support EC2 Launch v2. These
updates will follow in the coming weeks. These images are not recommended
for use in production environments. You can read more about EC2Launch v2
at https://aws.amazon.com/about-aws/whats-new/2020/07/introducing-ec2-
launch-v2-simplify-customizing-windows-instances/ and Configure a Windows
instance using EC2Launch v2 (p. 653). All current Windows Server AMIs will
continue to be provided without changes to the current launch agent, either
EC2Config (Server 2012 RTM or 2012 R2) or EC2Launch v1 (Server 2016 or later),
for the next several months. In the near future, all Windows Server AMIs currently
provided by AWS will be migrated to use EC2Launch v2 by default as part of
the monthly release. EC2LaunchV2_Preview AMIs will be updated monthly and
remain available until this migration occurs.
• EC2LaunchV2_Preview-Windows_Server-2004-English-Core-Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2019-English-Full-Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2019-English-Core-Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2016-English-Full-Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2016-English-Core-Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2012_R2_RTM-English-Full-
Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2012_R2_RTM-English-Core-
Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2012_RTM-English-Full-
Base-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2019-English-Full-
SQL_2019_Express-2020.06.30
• EC2LaunchV2_Preview-Windows_Server-2016-English-Full-
SQL_2017_Express-2020.06.30
• Windows_Server-2004-English-Core-Base-2020.05.27
• Windows_Server-2004-English-Core-ContainersLatest-2020.05.27
85
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
86
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Windows Server 2008 SP2 and Window Server 2008 R2 reached End of Support
(EOS) on 01/14/20 and will no longer receive regular security updates from
Microsoft. AWS will no longer publish or distribute Windows Server 2008 SP2 or
Windows Server 2008 R2 AMIs. Existing 2008 SP2/R2 instances and custom AMIs
in your account are not impacted, and you can continue to use them after the EOS
date.
For more information about Microsoft End of Service on AWS, including upgrade
and import options, as well as a full list of AMIs that are no longer published as of
01/14/2020, see End of Support (EOS) for Microsoft Products.
Windows Server 2008 SP2 and Window Server 2008 R2 reached End of Support
(EOS) on 01/14/20 and will no longer receive regular security updates from
Microsoft. AWS will no longer publish or distribute Windows Server 2008 SP2 or
Windows Server 2008 R2 AMIs. Existing 2008 SP2/R2 instances and custom AMIs
in your account are not impacted, and you can continue to use them after the EOS
date.
For more information about Microsoft End of Service on AWS, including upgrade
and import options, as well as a full list of AMIs that are no longer published as of
01/14/2020, see End of Support (EOS) for Microsoft Products.
87
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Microsoft will end mainstream support for Windows Server 2008 SP2 and
Windows Server 2008 R2 on January 14, 2020. On this date, AWS will no longer
publish or distribute Windows Server 2008 SP2 or Windows Server 2008 R2 AMIs.
Existing 2008 SP2/R2 instances and custom AMIs in your account will not be
impacted and you can continue to use them after the end-of-service (EOS) date.
For more information about Microsoft EOS on AWS, including upgrade and
import options, along with a full list of AMIS that will no longer be published or
distributed on January 14, 2020, see End of Support (EOS) for Microsoft Products.
• Windows_Server-1909-English-Core-Base-2019.11.13
• Windows_Server-1909-English-Core-ContainersLatest-2019.11.13
• Windows_Server-2016-English-Full-SQL_2019_Enterprise-2019.11.13
• Windows_Server-2016-English-Full-SQL_2019_Express-2019.11.13
• Windows_Server-2016-English-Full-SQL_2019_Standard-2019.11.13
• Windows_Server-2016-English-Full-SQL_2019_Web-2019.11.13
• Windows_Server-2019-English-Full-SQL_2019_Enterprise-2019.11.13
• Windows_Server-2019-English-Full-SQL_2019_Express-2019.11.13
• Windows_Server-2019-English-Full-SQL_2019_Standard-2019.11.13
• Windows_Server-2019-English-Full-SQL_2019_Web-2019.11.13
• Windows_Server-2016-English-Full-SQL_2019_Enterprise-2019.11.05
• Windows_Server-2016-English-Full-SQL_2019_Express-2019.11.05
• Windows_Server-2016-English-Full-SQL_2019_Standard-2019.11.05
• Windows_Server-2016-English-Full-SQL_2019_Web-2019.11.05
• Windows_Server-2019-English-Full-SQL_2019_Enterprise-2019.11.05
• Windows_Server-2019-English-Full-SQL_2019_Express-2019.11.05
88
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2019-English-Full-SQL_2019_Standard-2019.11.05
• Windows_Server-2019-English-Full-SQL_2019_Web-2019.11.05
• Windows_Server-2019-English-Core-ECS_Optimized-2019.10.09
• amzn2-ami-hvm-2.0.20190618-x86_64-gp2-mono
.NET Core 2.2, Mono 5.18, and PowerShell 6.2 pre-installed to run your .NET
applications on Amazon Linux 2 with Long Term Support (LTS)
89
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2012-R2-English-STIG-Full
• Windows_Server-2012-R2-English-STIG-Core
• Windows_Server-2016-English-STIG-Full
• Windows_Server-2016-English-STIG-Core
• Windows_Server-2019-English-STIG-Full
• Windows_Server-2019-English-STIG-Core
Includes the following updates, which are required for Microsoft Extended
Security (ESU) updates.
• KB4490628
• KB4474419
• KB4516655
Includes the following updates, which are required for Microsoft Extended
Security (ESU) updates.
• KB4493730
• KB4474419
• KB4517134
90
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Note
NLA is now enabled on all 2012 RTM, 2012 R2, and 2016 AMIs to
increase default RDP security posture. NLA remains enabled on 2019
AMIs.
• Windows_Server-2016-English-Full-ECS_Optimized-2019.07.19
• Windows_Server-2019-English-Full-ECS_Optimized-2019.07.19
• Windows_Server-2019-English-Tesla-2019.06.12
91
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Fixed AMIs for Windows Server 2019 with SQL to address edge cases where
the first launch of an instance may result in Instance Impairment and Windows
displays the message "Please wait for the User Profile Service".
• Windows_Server-2016-English-Full-SQL_2012_SP4_Standard-2019.04.10
• Windows_Server-2016-English-Full-SQL_2014_SP3_Standard-2019.04.10
• Windows_Server-2016-English-Full-SQL_2014_SP3_Enterprise-2019.04.10
92
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
SQL 2014 with Service Pack 2 and SQL 2016 with Service Pack 1 will no longer be
updated after this release.
• Windows AMIs have been updated. New AMIs can be found with the following
date versions:
November "2018.11.29"
December "2018.12.13"
January "2019.02.09"
Release Changes
93
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• EC2Launch version 1.3.2000760
• Windows_Server-2012-R2_RTM-Japanese-64Bit-
SQL_2014_SP3_Standard-2018.12.12
• Windows_Server-2012-R2_RTM-Japanese-64Bit-
SQL_2014_SP3_Express-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2014_SP3_Enterprise-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2014_SP3_Standard-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2014_SP3_Express-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2014_SP3_Web-2018.12.12
• Windows_Server-2012-RTM-Japanese-64Bit-
SQL_2014_SP3_Express-2018.12.12
• Windows_Server-2012-RTM-Japanese-64Bit-
SQL_2014_SP3_Standard-2018.12.12
• Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Web-2018.12.12
• Windows_Server-2012-RTM-English-64Bit-
SQL_2014_SP3_Standard-2018.12.12
• Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Express-2018.12.12
• Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Web-2018.12.12
• Windows_Server-2012-R2_RTM-Japanese-64Bit-
SQL_2016_SP2_Web-2018.12.12
• Windows_Server-2012-R2_RTM-Japanese-64Bit-
SQL_2016_SP2_Express-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2016_SP2_Enterprise-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2016_SP2_Express-2018.12.12
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2016_SP2_Web-2018.12.12
• Windows_Server-2012-R2_RTM-Japanese-64Bit-
SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Enterprise-2018.12.12
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Web-2018.12.12
• Windows_Server-2016-English-Full-SQL_2016_SP2_Web-2018.12.12
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-English-Full-SQL_2016_SP2_Express-2018.12.12
• Windows_Server-2016-English-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-English-Core-SQL_2016_SP2_Enterprise-2018.12.12
• Windows_Server-2016-English-Core-SQL_2016_SP2_Web-2018.12.12
94
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2016-English-Core-SQL_2016_SP2_Express-2018.12.12
• Windows_Server-2016-English-Core-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2019-Spanish-Full-Base-2018.12.12
• Windows_Server-2019-Japanese-Full-Base-2018.12.12
• Windows_Server-2019-Portuguese_Portugal-Full-Base-2018.12.12
• Windows_Server-2019-Chinese_Traditional-Full-Base-2018.12.12
• Windows_Server-2019-Italian-Full-Base-2018.12.12
• Windows_Server-2019-Swedish-Full-Base-2018.12.12
• Windows_Server-2019-English-Core-Base-2018.12.12
• Windows_Server-2019-Hungarian-Full-Base-2018.12.12
• Windows_Server-2019-Polish-Full-Base-2018.12.12
• Windows_Server-2019-Turkish-Full-Base-2018.12.12
• Windows_Server-2019-Korean-Full-Base-2018.12.12
• Windows_Server-2019-Dutch-Full-Base-2018.12.12
• Windows_Server-2019-German-Full-Base-2018.12.12
• Windows_Server-2019-Russian-Full-Base-2018.12.12
• Windows_Server-2019-Czech-Full-Base-2018.12.12
• Windows_Server-2019-English-Full-Base-2018.12.12
• Windows_Server-2019-French-Full-Base-2018.12.12
• Windows_Server-2019-Portuguese_Brazil-Full-Base-2018.12.12
• Windows_Server-2019-Chinese_Simplified-Full-Base-2018.12.12
• Windows_Server-2019-English-Full-HyperV-2018.12.12
• Windows_Server-2019-English-Full-ContainersLatest-2018.12.12
• Windows_Server-2019-English-Core-ContainersLatest-2018.12.12
• Windows_Server-2019-English-Full-SQL_2017_Enterprise-2018.12.12
• Windows_Server-2019-English-Full-SQL_2017_Standard-2018.12.12
• Windows_Server-2019-English-Full-SQL_2017_Web-2018.12.12
• Windows_Server-2019-English-Full-SQL_2017_Express-2018.12.12
• Windows_Server-2019-English-Full-SQL_2016_SP2_Enterprise-2018.12.12
• Windows_Server-2019-English-Full-SQL_2016_SP2_Standard-2018.12.12
• Windows_Server-2019-English-Full-SQL_2016_SP2_Web-2018.12.12
• Windows_Server-2019-English-Full-SQL_2016_SP2_Express-2018.12.12
• amzn2-ami-hvm-2.0.20180622.1-x86_64-gp2-dotnetcore-2018.12.12
95
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
2018.11.20 Windows_Server-2016-English-Deep-Learning
Windows_Server-2016-English-Deep-Learning
Microsoft Windows Server 2016 Datacenter and Standard Editions for Nano
Server
Microsoft ended mainstream support for Windows Server 2016 Datacenter and
Standard Editions for Nano Server installation options as of April 10, 2018.
96
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Resolves an issue with the 2018.06.13 AMIs when changing an instance from a
previous generation to a current generation (for example, M4 to M5).
97
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• AMIs are now available. For more information, see Windows Server version
1709 and 1803 AMIs for Amazon EC2.
• EC2Launch 1.3.2000080
2018.03.16 AWS has removed all Windows AMIs dated 2018.03.16 due to an issue with an
unquoted path in the configuration for the Amazon EC2 Hibernate Agent.
98
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• AWS PV driver 7.4.6 (rollback from 8.2 in the 2018.02.13 AMI release)
• EC2Launch 1.3.740
Release Changes
99
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• EC2Launch 1.3.640
100
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Windows Server 2016 with Microsoft SQL Server 2017 AMIs are now public in all
regions.
• Windows_Server-2016-English-Full-SQL_2017_Enterprise-2017.10.04
• Windows_Server-2016-English-Full-SQL_2017_Standard-2017.10.04
• Windows_Server-2016-English-Full-SQL_2017_Web-2017.10.04
• Windows_Server-2016-English-Full-SQL_2017_Express-2017.10.04
• Machine Learning Services with Python (ML and AI) and R language support
• Automatic database tuning
• Clusterless Availability Groups
• Runs on Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server
(SLES), and Ubuntu. For more information, see the following Microsoft article:
Installation guidance for SQL Server on Linux. Not supported on Amazon Linux.
• Windows-Linux cross-OS migrations
• Resumable online index rebuild
• Improved adaptive query processing
• Graph data support
• Due to an internal error, these AMIs were released with an older version of AWS
Tools for Windows PowerShell, 3.3.58.0.
101
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• EC2Launch 1.3.610
102
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
2017.02.21 Microsoft recently announced that they will not release monthly patches or
security updates for the month of February. All February patches and security
updates will be included in the March update.
Amazon Web Services did not release updated Windows Server AMIs in February.
103
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Windows_Server-2016-English-Core-Base
All Microsoft SQL Server AMIs with the latest service pack are now public in all
regions. These new AMIs replace old SQL Service Pack AMIs going forward.
• Windows_Server-2008-R2_SP1-English-64Bit-
SQL_2012_SP3_edition-2016.12.14
• Windows_Server-2012-RTM-English-64Bit-
SQL_2012_SP3_edition-2016.12.14
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2014_SP2_edition-2016.12.14
• Windows_Server-2012-RTM-English-64Bit-
SQL_2014_SP2_edition-2016.12.14
• Windows_Server-2012-R2_RTM-English-64Bit-
SQL_2016_SP1_edition-2016.12.14
• Windows_Server-2016-English-Full-SQL_2016_SP1_edition-2016.12.14
SQL Server 2016 SP1 is a major release. The following features, which were
previously available in Enterprise edition only, are now enabled in Standard, Web,
and Express editions with SQL Server 2016 SP1:
• Row-level security
• Dynamic Data Masking
• Change Data Capture
• Database snapshot
• Column store
• Partitioning
• Compression
104
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• In Memory OLTP
• Always Encrypted
• Released AMIs for Windows Server 2016. These AMIs include significant
changes. For example, they don't include the EC2Config service. For more
information, see Changes in Windows Server 2016 and later AMIs (p. 55).
2016.8.26 All Windows Server 2008 R2 AMIs dated 2016.08.11 were updated to fix a known
issue. New AMIs are dated 2016.08.25.
105
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• Ec2Config v3.19.1153
• Microsoft security updates current to August 10, 2016
• Enabled the registry key User32 exception handler hardening feature in
Internet Explorer for MS15-124
Windows Server 2008 R2, Windows Server 2012 RTM, and Windows
Server 2012 R2
2016.8.2 All Windows Server 2008 R2 AMIs for July were removed and rolled back to AMIs
dated 2016.06.15, because of an issue discovered in the AWS PV driver. The AWS
PV driver issue has been fixed. The August AMI release will include Windows
Server 2008 R2 AMIs with the fixed AWS PV driver and July/August Windows
updates.
• Ec2Config v3.18.1118
• 2016.07.13 AMIs were missing security patches. AMIs were re-patched.
Additional processes were put in place to verify successful patch installations
going forward.
106
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Release Changes
107
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
2015.10.26 Corrected boot volume sizes of base AMIs to be 30GB instead of 35GB
Only AMIs with Windows Server 2012 and Windows Server 2012 R2
108
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
109
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• AWS PV Driver 7.2.4.1 (resolves the issues with Plug and Play Cleanup, which is
now enabled by default)
110
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Release Changes
111
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• EC2Config service version 2.1.19
• Current AWS Tools for Windows PowerShell
• Configure NTP to synchronize the time once a day (the default is every seven
days)
• Clean up the WinSXS folder using the following command: dism /online /
cleanup-image /StartComponentCleanup
112
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
Release Changes
113
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Windows AMI version history
Release Changes
• KB2545227
Release Changes
114
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find a Windows AMI
Release Changes
• Initial release
• The Region
• The operating system
• The architecture: 32-bit (i386) or 64-bit (x86_64)
• The provider (for example, Amazon Web Services)
• Additional software (for example, SQL Server)
If you want to find an Ubuntu AMI, see their EC2 AMI Locator.
If you want to find a RedHat AMI, see the RHEL knowledgebase article.
If you want to find a Linux AMI, see Find a Linux AMI in the Amazon EC2 User Guide for Linux Instances.
115
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find a Windows AMI using the Amazon EC2 console
(Old console) On the Quick Start tab, select from one of the commonly used AMIs in the list. If you
don't see the AMI that you want to use, choose the My AMIs, AWS Marketplace, or Community
AMIs tab to find additional AMIs. For more information, see Step 1: Choose an Amazon Machine
Image (AMI) (p. 549).
(New console) Choose the Search bar and, from the menu, choose Owner alias, then the = operator,
and then the value amazon. Choose the Search bar again to choose Platform, then the = operator,
and then the operating system from the list provided.
(Old console) Choose the Search bar and, from the menu, choose Owner and then the value
Amazon images. Choose the Search bar again to choose Platform and then the operating system
from the list provided.
5. (Optional) Choose the Preferences icon (new console) or Show/Hide Columns icon (old console) to
select which image attributes to display, such as the root device type. Alternatively, you can select an
AMI from the list and view its properties on the Details tab.
6. To launch an instance from this AMI, select it and then choose Launch instance from image (new
console) or Launch (old console). For more information about launching an instance using the
console, see Launch an instance using the new launch instance wizard (p. 539). If you're not ready
to launch the instance now, make note of the AMI ID for later.
116
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find an AMI using the AWS Tools for Windows PowerShell
Amazon EC2
For information and examples, see Find an AMI Using Windows PowerShell in the AWS Tools for Windows
PowerShell User Guide.
For information and examples, see Query for the Latest Windows AMI Using Systems Manager Parameter
Store.
Amazon EC2
The describe-images command supports filtering parameters. For example, use the --owners parameter
to display public AMIs owned by Amazon.
You can add the following filter to the previous command to display only Windows AMIs.
--filters "Name=platform,Values=windows"
Important
Omitting the --owners flag from the describe-images command returns all images for which
you have launch permissions, regardless of ownership.
For information and examples, see Query for the Latest Windows AMI Using Systems Manager Parameter
Store.
To find the latest Amazon Linux 2023 AMI using AWS Systems Manager, see Get started with Amazon
Linux 2023.
The Amazon EC2 AMI public parameters are available from the following path:
117
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Use a Systems Manager parameter to find an AMI
/aws/service/ami-windows-latest
You can view a list of all Windows AMIs in the current AWS Region by running the following AWS CLI
command.
For more information, see Using public parameters in the AWS Systems Manager User Guide and Query
for the Latest Windows AMI Using AWS Systems Manager Parameter Store.
A Systems Manager parameter is a customer-defined key-value pair that you can create in Systems
Manager Parameter Store. The Parameter Store provides a central store to externalize your application
configuration values. For more information, see AWS Systems Manager Parameter Store in the AWS
Systems Manager User Guide.
When you create a parameter that points to an AMI ID, make sure that you specify the data type as
aws:ec2:image. Specifying this data type ensures that when the parameter is created or modified,
the parameter value is validated as an AMI ID. For more information, see Native parameter support for
Amazon Machine Image IDs in the AWS Systems Manager User Guide.
Use cases
When you use Systems Manager parameters to point to AMI IDs, it is easier for your users to select the
correct AMI when launching instances. Systems Manager parameters can also simplify the maintenance
of automation code.
If you require instances to be launched using a specific AMI, and the AMI is regularly updated, we
recommend that you require your users to select a Systems Manager parameter to find the AMI.
Requiring your users to select a Systems Manager parameter ensures that the latest AMI is used to
launch instances.
For example, every month in your organization you might create a new version of your AMI that has
the latest operating system and application patches. You also require your users to launch instances
using the latest version of your AMI. To ensure that your users use the latest version, you can create a
Systems Manager parameter (for example, golden-ami) that points to the correct AMI ID. Each time a
new version of the AMI is created, you update the AMI ID value in the parameter so that it always points
to the latest AMI. Your users don't have to know about the periodic updates to the AMI because they
continue to select the same Systems Manager parameter each time. Using a Systems Manager parameter
for your AMI makes it easier for them to select the correct AMI for an instance launch.
118
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Use a Systems Manager parameter to find an AMI
If you use automation code to launch your instances, you can specify the Systems Manager parameter
instead of the AMI ID. If a new version of the AMI is created, you can change the AMI ID value in the
parameter so that it points to the latest AMI. The automation code that references the parameter doesn’t
have to be modified each time a new version of the AMI is created. This simplifies the maintenance of the
automation and helps to drive down deployment costs.
Note
Running instances are not affected when you change the AMI ID pointed to by the Systems
Manager parameter.
Permissions
If you use Systems Manager parameters that point to AMI IDs in the launch instance wizard,
you must add ssm:DescribeParameters and ssm:GetParameters to your IAM policy.
ssm:DescribeParameters grants your users permission to view and select Systems Manager
parameters. ssm:GetParameters grants your users permission to retrieve the values of the Systems
Manager parameters. You can also restrict access to specific Systems Manager parameters. For more
information, see Use the EC2 launch instance wizard (p. 1454).
Limitations
AMIs and Systems Manager parameters are Region specific. To use the same Systems Manager parameter
name across Regions, create a Systems Manager parameter in each Region with the same name (for
example, golden-ami). In each Region, point the Systems Manager parameter to an AMI in that Region.
New console
For more information about launching an instance using the launch instance wizard, see Launch an
instance using the new launch instance wizard (p. 539).
Old console
119
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Use a Systems Manager parameter to find an AMI
2. From the navigation bar, select the Region in which to launch your instances. You can select any
Region that's available to you, regardless of your location.
3. From the console dashboard, choose Launch instance.
4. Choose Search by Systems Manager parameter (at top right).
5. For Systems Manager parameter, select a parameter. The corresponding AMI ID appears next to
Currently resolves to.
6. Choose Search. The AMIs that match the AMI ID appear in the list.
7. Select the AMI from the list, and choose Select.
For more information about launching an instance from an AMI using the launch instance wizard, see
Step 1: Choose an Amazon Machine Image (AMI) (p. 549).
To launch an instance using an AWS Systems Manager parameter instead of an AMI ID (AWS CLI)
The following example uses the Systems Manager parameter golden-ami to launch an m5.xlarge
instance. The parameter points to an AMI ID.
To specify the parameter in the command, use the following syntax: resolve:ssm:/parameter-name,
where resolve:ssm is the standard prefix and parameter-name is the unique parameter name. Note
that the parameter name is case-sensitive. Backslashes for the parameter name are only necessary when
the parameter is part of a hierarchy, for example, /amis/production/golden-ami. You can omit the
backslash if the parameter is not part of a hierarchy.
In this example, the --count and --security-group parameters are not included. For --count, the
default is 1. If you have a default VPC and a default security group, they are used.
To launch an instance using a specific version of an AWS Systems Manager parameter (AWS CLI)
Systems Manager parameters have version support. Each iteration of a parameter is assigned a unique
version number. You can reference the version of the parameter as follows resolve:ssm:parameter-
name:version, where version is the unique version number. By default, the latest version of the
parameter is used when no version is specified.
In this example, the --count and --security-group parameters are not included. For --count, the
default is 1 If you have a default VPC and a default security group, they are used.
Amazon EC2 provides Systems Manager public parameters for public AMIs provided by AWS. For
example, the public parameter /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 is
available in all Regions, and always points to the latest version of the Amazon Linux 2 AMI in the Region.
120
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Shared AMIs
--instance-type m5.xlarge
...
Shared AMIs
A shared AMI is an AMI that a developer created and made available for others to use. One of the easiest
ways to get started with Amazon EC2 is to use a shared AMI that has the components you need and then
add custom content. You can also create your own AMIs and share them with others.
You use a shared AMI at your own risk. Amazon can't vouch for the integrity or security of AMIs shared
by other Amazon EC2 users. Therefore, you should treat shared AMIs as you would any foreign code that
you might consider deploying in your own data center, and perform the appropriate due diligence. We
recommend that you get an AMI from a trusted source, such as a verified provider.
Verified provider
In the Amazon EC2 console, public AMIs that are owned by Amazon or a verified Amazon partner are
marked Verified provider.
You can also use the describe-images AWS CLI command to identify the public AMIs that come from
a verified provider. Public images that are owned by Amazon or a verified partner have an aliased
owner, which is either amazon or aws-marketplace. In the CLI output, these values appear for
ImageOwnerAlias. Other users can't alias their AMIs. This enables you to easily find AMIs from Amazon
or verified partners.
To become a verified provider, you must register as a seller on the AWS Marketplace. Once registered,
you can list your AMI on the AWS Marketplace. For more information, see Getting started as a seller and
AMI-based products in the AWS Marketplace Seller Guide.
• For information about creating an AMI, see Create a custom Windows AMI.
• For information about building, delivering, and maintaining your applications on the AWS Marketplace,
see the AWS Marketplace Documentation.
AMIs are a Regional resource. When you search for a shared AMI (public or private), you must search for
it from the same Region from which it is shared. To make an AMI available in a different Region, copy the
AMI to the Region, and then share it. For more information, see Copy an AMI (p. 158).
121
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find shared AMIs
Topics
• Find a shared AMI (console) (p. 122)
• Find a shared AMI (Tools for Windows PowerShell) (p. 122)
• Find a shared AMI (AWS CLI) (p. 123)
To find a shared public AMI from a verified provider using the console
The following command lists all public AMIs, including any public AMIs that you own.
122
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find shared AMIs
The following command lists the AMIs for which you have explicit launch permissions. This list does not
include any AMIs that you own.
The following command lists the AMIs owned by verified providers. Public AMIs owned by verified
providers (either Amazon or verified partners) have an aliased owner, which appears as amazon or aws-
marketplace in the account field. This helps you to easily find AMIs from verified providers. Other users
can't alias their AMIs.
The following command lists the AMIs owned by the specified AWS account.
To reduce the number of displayed AMIs, use a filter to list only the types of AMIs that interest you. For
example, use the following filter to display only EBS-backed AMIs.
The following command lists all public AMIs, including any public AMIs that you own.
The following command lists the AMIs for which you have explicit launch permissions. This list does not
include any AMIs that you own.
The following command lists the AMIs owned by verified providers. Public AMIs owned by verified
providers (either Amazon or verified partners) have an aliased owner, which appears as amazon or aws-
marketplace in the account field. This helps you to easily find AMIs from verified providers. Other users
can't alias their AMIs.
123
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Make an AMI public
The following command lists the AMIs owned by the specified AWS account.
To reduce the number of displayed AMIs, use a filter to list only the types of AMIs that interest you. For
example, use the following filter to display only EBS-backed AMIs.
--filters "Name=root-device-type,Values=ebs"
Considerations
Consider the following before making an AMI public.
• Ownership – To make an AMI public, your AWS account must own the AMI.
• Some AMIs can't be made public – If your AMI includes one of the following components, you can't
make it public (but you can share the AMI with specific AWS accounts (p. 133)):
• Encrypted volumes
• Snapshots of encrypted volumes
• Product codes
• Region – AMIs are a Regional resource. When you share an AMI, it is available only in the Region from
which you shared it. To make an AMI available in a different Region, copy the AMI to the Region and
then share it. For more information, see Copy an AMI (p. 158).
• Usage – When you share an AMI, users can only launch instances from the AMI. They can’t delete,
share, or modify it. However, after they have launched an instance using your AMI, they can then
create an AMI from the instance they launched.
• Automatic deprecation – By default, the deprecation date of all public AMIs is set to two years from
the AMI creation date. You can set the deprecation date to earlier than two years. To cancel the
deprecation date, or to move the deprecation to a later date, you must make the AMI private by only
sharing it with specific AWS accounts (p. 133).
• Billing – You are not billed when your AMI is used by other AWS accounts to launch instances. The
accounts that launch instances using the AMI are billed for the instances that they launch.
124
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Make an AMI public
New console
Old console
You can add or remove account IDs from the list of accounts that have launch permissions for an AMI. To
make the AMI public, specify the all group. You can specify both public and explicit launch permissions.
1. Use the Edit-EC2ImageAttribute command as follows to add the all group to the
launchPermission list for the specified AMI.
2. To verify the launch permissions of the AMI, use the following Get-EC2ImageAttribute command.
3. (Optional) To make the AMI private again, remove the all group from its launch permissions.
Note that the owner of the AMI always has launch permissions and is therefore unaffected by this
command.
125
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
You can add or remove account IDs from the list of accounts that have launch permissions for an AMI. To
make the AMI public, specify the all group. You can specify both public and explicit launch permissions.
1. Use the modify-image-attribute command as follows to add the all group to the
launchPermission list for the specified AMI.
2. To verify the launch permissions of the AMI, use the describe-image-attribute command.
3. (Optional) To make the AMI private again, remove the all group from its launch permissions.
Note that the owner of the AMI always has launch permissions and is therefore unaffected by this
command.
An organization is an entity that you create to consolidate and centrally manage your AWS accounts. You
can organize the accounts in a hierarchical, tree-like structure, with a root at the top and organizational
units nested under the organization root. Each account can be added directly to the root, or placed in
one of the OUs in the hierarchy. For more information, see AWS Organizations terminology and concepts
in the AWS Organizations User Guide.
When you share an AMI with an organization or an OU, all of the children accounts gain access to the
AMI. For example, in the following diagram, the AMI is shared with a top-level OU (indicated by the
arrow at the number 1). All of the OUs and accounts that are nested underneath that top-level OU
126
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
(indicated by the dotted line at number 2) also have access to the AMI. The accounts in the organization
and OU outside the dotted line (indicated by the number 3) do not have access to the AMI because they
are not children of the OU that the AMI is shared with.
Considerations
Consider the following when sharing AMIs with specific organizations or organizational units.
• Ownership – To share an AMI, your AWS account must own the AMI.
• Sharing limits – The AMI owner can share an AMI with any organization or OU, including organizations
and OUs that they’re not a member of.
For the maximum number of entities to which an AMI can be shared within a Region, see the Amazon
EC2 service quotas.
• Tags – You can't share user-defined tags (tags that you attach to an AMI). When you share an AMI, your
user-defined tags are not available to any AWS account in an organization or OU with which the AMI is
shared.
127
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
• ARN format – When you specify an organization or OU in a command, make sure to use the
correct ARN format. You'll get an error if you specify only the ID, for example, if you specify only
o-123example or ou-1234-5example.
Where:
• account-id is the 12-digit management account number, for example, 123456789012. If
you don't know the management account number, you can describe the organization or the
organizational unit to get the ARN, which includes the management account number. For more
information, see Get the ARN (p. 133).
• organization-id is the organization ID, for example, o-123example.
• ou-id is the organizational unit ID, for example, ou-1234-5example.
For more information about the format of ARNs, see Amazon Resource Names (ARNs) in the AWS
General Reference.
• Encryption and keys – You can share AMIs that are backed by unencrypted and encrypted snapshots.
• The encrypted snapshots must be encrypted with a customer managed key. You can’t share AMIs
that are backed by snapshots that are encrypted with the default AWS managed key. For more
information, see Share an Amazon EBS snapshot (p. 1621).
• If you share an AMI that is backed by encrypted snapshots, you must allow the organizations or OUs
to use the customer managed keys that were used to encrypt the snapshots. For more information,
see Allow organizations and OUs to use a KMS key (p. 128).
• Region – AMIs are a Regional resource. When you share an AMI, it is available only in the Region from
which you shared it. To make an AMI available in a different Region, copy the AMI to the Region and
then share it. For more information, see Copy an AMI (p. 158).
• Usage – When you share an AMI, users can only launch instances from the AMI. They can’t delete,
share, or modify it. However, after they have launched an instance using your AMI, they can then
create an AMI from the instance they launched.
• Billing – You are not billed when your AMI is used by other AWS accounts to launch instances. The
accounts that launch instances using the AMI are billed for the instances that they launch.
For information about editing a key policy, see Allowing users in other accounts to use a KMS key in the
AWS Key Management Service Developer Guide and Share a KMS key (p. 1623).
To give an organization or OU permission to use a KMS key, add the following statement to the key
policy.
{
"Sid": "Allow access for organization root",
128
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
"Effect": "Allow",
"Principal": "*",
"Action": [
"kms:Describe*",
"kms:List*",
"kms:Get*",
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:PrincipalOrgID": "o-123example"
}
}
}
To share a KMS key with multiple OUs, you can use a policy similar to the following example.
{
"Sid": "Allow access for specific OUs and their descendants",
"Effect": "Allow",
"Principal": "*",
"Action": [
"kms:Describe*",
"kms:List*",
"kms:Get*",
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:PrincipalOrgID": "o-123example"
},
"ForAnyValue:StringLike": {
"aws:PrincipalOrgPaths": [
"o-123example/r-ab12/ou-ab12-33333333/*",
"o-123example/r-ab12/ou-ab12-22222222/*"
]
}
}
}
Share an AMI
You can use the Amazon EC2 console or the AWS CLI to share an AMI with an organization or OU.
129
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
6. For Organization/OU ARN, enter the organization ARN or OU ARN with which you want to share
the AMI, and then choose Share AMI. Note that you must specify the full ARN, not just the ID.
To share this AMI with multiple organizations or OUs, repeat this step until you have added all of the
required organizations or OUs.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order
to share the AMI. Only the AMI itself needs to be shared, and the system automatically
provides the instance with access to the referenced Amazon EBS snapshots for the
launch. However, you do need to share the KMS keys used to encrypt snapshots that the
AMI references. For more information, see Allow organizations and OUs to use a KMS
key (p. 128).
7. Choose Save changes when you're done.
8. (Optional) To view the organizations or OUs with which you have shared the AMI, select the AMI in
the list, choose the Permissions tab, and scroll down to Shared organizations/OUs. To find AMIs
that are shared with you, see Find shared AMIs (p. 121).
The following command grants launch permissions for the specified AMI to the specified organization.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order to share
the AMI. Only the AMI itself needs to be shared, and the system automatically provides the
instance with access to the referenced Amazon EBS snapshots for the launch. However, you
do need to share the KMS keys used to encrypt snapshots that the AMI references. For more
information, see Allow organizations and OUs to use a KMS key (p. 128).
The following command removes launch permissions for the specified AMI from the specified
organization:
To stop sharing an AMI with all organizations, OUs, and AWS accounts
The following command removes all public and explicit launch permissions from the specified AMI. Note
that the owner of the AMI always has launch permissions and is therefore unaffected by this command.
130
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
The modify-image-attribute command grants launch permissions for the specified AMI to the specified
organization. Note that you must specify the full ARN, not just the ID.
The modify-image-attribute command grants launch permissions for the specified AMI to the specified
OU. Note that you must specify the full ARN, not just the ID.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order to share
the AMI. Only the AMI itself needs to be shared, and the system automatically provides the
instance with access to the referenced Amazon EBS snapshots for the launch. However, you
do need to share the KMS keys used to encrypt snapshots that the AMI references. For more
information, see Allow organizations and OUs to use a KMS key (p. 128).
The modify-image-attribute command removes launch permissions for the specified AMI from the
specified organization. Note that you must specify the ARN.
131
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with organizations or OUs
--launch-permission
"Remove=[{OrganizationArn=arn:aws:organizations::123456789012:organization/o-123example}]"
To stop sharing an AMI with all organizations, OUs, and AWS accounts using the AWS CLI
The reset-image-attribute command removes all public and explicit launch permissions from the
specified AMI. Note that the owner of the AMI always has launch permissions and is therefore unaffected
by this command.
Note
You can't stop sharing an AMI with a specific account if it's in an organization or OU with which
an AMI is shared. If you try to stop sharing the AMI by removing launch permissions for the
account, Amazon EC2 returns a success message. However, the AMI continues to be shared with
the account.
View the organizations and OUs with which an AMI is shared (console)
To check with which organizations and OUs you've shared your AMI using the console
To find AMIs that are shared with you, see Find shared AMIs (p. 121).
View the organizations and OUs with which an AMI is shared (AWS CLI)
You can check which organizations and OUs you've shared your AMI with by using the describe-image-
attribute command (AWS CLI) and the launchPermission attribute.
To check with which organizations and OUs you've shared your AMI using the AWS CLI
The describe-image-attribute command describes the launchPermission attribute for the specified
AMI, and returns the organizations and OUs with which you've shared the AMI.
Example response
{
"ImageId": "ami-0abcdef1234567890",
"LaunchPermissions": [
{
"OrganizationalUnitArn": "arn:aws:organizations::111122223333:ou/o-123example/
ou-1234-5example"
132
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with specific AWS accounts
}
]
}
Before you can get the ARNs, you must have the permission to describe organizations and organizational
units. The following policy provides the necessary permission.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"organizations:Describe*"
],
"Resource": "*"
}
]
}
Use the describe-organization command and the --query parameter set to 'Organization.Arn' to
return only the organization ARN.
Example response
"arn:aws:organizations::123456789012:organization/o-123example"
Use the describe-organizational-unit command, specify the OU ID, and set the --query parameter to
'OrganizationalUnit.Arn' to return only the organizational unit ARN.
Example response
"arn:aws:organizations::123456789012:ou/o-123example/ou-1234-5example"
133
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with specific AWS accounts
Considerations
Consider the following when sharing AMIs with specific AWS accounts.
• Ownership – To share an AMI, your AWS account must own the AMI.
• Sharing limits – For the maximum number of entities to which an AMI can be shared within a Region,
see the Amazon EC2 service quotas.
• Tags – You can't share user-defined tags (tags that you attach to an AMI). When you share an AMI, your
user-defined tags are not available to any AWS account that the AMI is shared with.
• Encryption and keys – You can share AMIs that are backed by unencrypted and encrypted snapshots.
• The encrypted snapshots must be encrypted with a KMS key. You can’t share AMIs that are backed
by snapshots that are encrypted with the default AWS managed key. For more information, see
Share an Amazon EBS snapshot (p. 1621).
• If you share an AMI that is backed by encrypted snapshots, you must allow the AWS accounts
to use the KMS keys that were used to encrypt the snapshots. For more information, see Allow
organizations and OUs to use a KMS key (p. 128). To set up the key policy that you need to launch
Auto Scaling instances when you use a customer managed key for encryption, see Required AWS
KMS key policy for use with encrypted volumes in the Amazon EC2 Auto Scaling User Guide.
• Region – AMIs are a Regional resource. When you share an AMI, it is only available in that Region. To
make an AMI available in a different Region, copy the AMI to the Region and then share it. For more
information, see Copy an AMI (p. 158).
• Usage – When you share an AMI, users can only launch instances from the AMI. They can’t delete,
share, or modify it. However, after they have launched an instance using your AMI, they can then
create an AMI from their instance.
• Copying shared AMIs – If users in another account want to copy a shared AMI, you must grant
them read permissions for the storage that backs the AMI. For more information, see Cross-account
copying (p. 163).
• Billing – You are not billed when your AMI is used by other AWS accounts to launch instances. The
accounts that launch instances using the AMI are billed for the instances that they launch.
To share this AMI with multiple accounts, repeat Steps 5 and 6 until you have added all the
required account IDs.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order
to share the AMI. Only the AMI itself needs to be shared; the system automatically
provides the instance access to the referenced Amazon EBS snapshots for the launch.
However, you do need to share any KMS keys used to encrypt snapshots that the AMI
references. For more information, see Share an Amazon EBS snapshot (p. 1621).
134
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share an AMI with specific AWS accounts
Old console
To share this AMI with multiple users, repeat this step until you have added all the required
users.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order
to share the AMI. Only the AMI itself needs to be shared; the system automatically
provides the instance access to the referenced Amazon EBS snapshots for the launch.
However, you do need to share any KMS keys used to encrypt snapshots that the AMI
references. For more information, see Share an Amazon EBS snapshot (p. 1621).
5. Choose Save when you are done.
6. (Optional) To view the AWS account IDs with which you have shared the AMI, select the AMI in
the list, and choose the Permissions tab. To find AMIs that are shared with you, see Find shared
AMIs (p. 121).
The following command grants launch permissions for the specified AMI to the specified AWS account.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order to share
the AMI. Only the AMI itself needs to be shared; the system automatically provides the instance
access to the referenced Amazon EBS snapshots for the launch. However, you do need to share
any KMS keys used to encrypt snapshots that the AMI references. For more information, see
Share an Amazon EBS snapshot (p. 1621).
The following command removes launch permissions for the specified AMI from the specified AWS
account.
135
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Cancel having an AMI shared with your account
The following command removes all public and explicit launch permissions from the specified AMI. Note
that the owner of the AMI always has launch permissions and is therefore unaffected by this command.
The following command grants launch permissions for the specified AMI to the specified AWS account.
Note
You do not need to share the Amazon EBS snapshots that an AMI references in order to share
the AMI. Only the AMI itself needs to be shared; the system automatically provides the instance
access to the referenced Amazon EBS snapshots for the launch. However, you do need to share
any KMS keys used to encrypt snapshots that the AMI references. For more information, see
Share an Amazon EBS snapshot (p. 1621).
The following command removes launch permissions for the specified AMI from the specified AWS
account.
The following command removes all public and explicit launch permissions from the specified AMI. Note
that the owner of the AMI always has launch permissions and is therefore unaffected by this command.
You might cancel having an AMI shared with your account, for example, to reduce the likelihood of
launching an instance with an unused or deprecated AMI that was shared with you. When you cancel
136
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Cancel having an AMI shared with your account
having an AMI shared with your account, it no longer appears in any AMI lists in the EC2 console or in the
output for describe-images.
Topics
• Limitations (p. 137)
• Cancel having an AMI shared with your account (p. 137)
• Find AMIs that are shared with your account (p. 138)
Limitations
• You can remove your account from the launch permissions of an AMI that is shared with your AWS
account only. You can't use cancel-image-launch-permission to remove your account from the
launch permissions of an AMI shared with an organization or organizational unit (OU) (p. 126) or to
remove access to public AMIs.
• You can’t permanently remove your account from the launch permissions of an AMI. An AMI owner can
share an AMI with your account again.
• AMIs are a Regional resource. When running cancel-image-launch-permission, you must
specify the Region in which the AMI is located. Either specify the Region in the command, or use the
AWS_DEFAULT_REGION environment variable.
• Only the AWS CLI and SDKs support removing your account from the launch permissions of an AMI.
The EC2 console does not currently support this action.
AWS CLI
Expected output
{
"Return": true
}
PowerShell
To cancel having an AMI shared with your AWS account using the AWS Tools for PowerShell
Stop-EC2ImageLaunchPermission `
-ImageId ami-0123456789example `
-Region us-east-1
137
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Use bookmarks
Expected output
True
Use bookmarks
If you have created a public AMI, or shared an AMI with another AWS account, you can create a bookmark
that allows a user to access your AMI and launch an instance in their own account immediately. This is an
easy way to share AMI references, so users don't have to spend time finding your AMI in order to use it.
Note that your AMI must be public, or you must have shared it with the user to whom you want to send
the bookmark.
1. Type a URL with the following information, where region is the Region in which your AMI resides:
https://console.aws.amazon.com/ec2/v2/home?
region=region#LaunchInstanceWizard:ami=ami_id
For example, this URL launches an instance from the ami-0abcdef1234567890 AMI in the US East
(N. Virginia) us-east-1 Region:
https://console.aws.amazon.com/ec2/v2/home?region=us-
east-1#LaunchInstanceWizard:ami=ami-0abcdef1234567890
• No list of security guidelines can be exhaustive. Build your shared AMIs carefully and take time to
consider where you might expose sensitive data.
• Develop a repeatable process for building, updating, and republishing AMIs.
• Build AMIs using the most up-to-date operating systems, packages, and software.
• Download and install the latest version of the EC2Config service. For more information about
installing this service, see Install the latest version of EC2Config (p. 713).
• Verify that Ec2SetPassword, Ec2WindowsActivate and Ec2HandleUserData are enabled.
• Verify that no guest accounts or Remote Desktop user accounts are present.
• Disable or remove unnecessary services and programs to reduce the attack surface of your AMI.
• Remove instance credentials, such as your key pair, from the AMI (if you saved them on the AMI). Store
the credentials in a safe location.
138
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Paid AMIs
• Ensure that the administrator password and passwords on any other accounts are set to an appropriate
value for sharing. These passwords are available for anyone who launches your shared AMI.
• Test your AMI before you share it.
Paid AMIs
After you create an AMI, you can keep it private so that only you can use it, or you can share it with a
specified list of AWS accounts. You can also make your custom AMI public so that the community can use
it. Building a safe, secure, usable AMI for public consumption is a fairly straightforward process, if you
follow a few simple guidelines. For information about how to create and use shared AMIs, see Shared
AMIs (p. 121).
You can purchase AMIs from a third party, including AMIs that come with service contracts from
organizations such as Red Hat. You can also create an AMI and sell it to other Amazon EC2 users.
Amazon EC2 integrates with AWS Marketplace, enabling developers to charge other Amazon EC2 users
for the use of their AMIs or to provide support for instances.
The AWS Marketplace is an online store where you can buy software that runs on AWS, including AMIs
that you can use to launch your EC2 instance. The AWS Marketplace AMIs are organized into categories,
such as Developer Tools, to enable you to find products to suit your requirements. For more information
about AWS Marketplace, see the AWS Marketplace website.
Launching an instance from a paid AMI is the same as launching an instance from any other AMI. No
additional parameters are required. The instance is charged according to the rates set by the owner of
the AMI, as well as the standard usage fees for the related web services, for example, the hourly rate for
running an m1.small instance type in Amazon EC2. Additional taxes might also apply. The owner of the
paid AMI can confirm whether a specific instance was launched using that paid AMI.
Important
Amazon DevPay is no longer accepting new sellers or products. AWS Marketplace is now
the single, unified e-commerce platform for selling software and services through AWS. For
information about how to deploy and sell software from AWS Marketplace, see Selling in AWS
Marketplace. AWS Marketplace supports AMIs backed by Amazon EBS.
Contents
• Sell your AMI (p. 139)
• Find a paid AMI (p. 140)
• Purchase a paid AMI (p. 141)
• Get the product code for your instance (p. 141)
• Use paid support (p. 142)
• Bills for paid and supported AMIs (p. 142)
• Manage your AWS Marketplace subscriptions (p. 142)
For information about how to sell your AMI on the AWS Marketplace, see Selling in AWS Marketplace.
139
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find a paid AMI
ProductCodeId ProductCodeType
------------- ---------------
product_code marketplace
If you know the product code, you can filter the results by product code. This example returns the most
recent AMI with the specified product code.
140
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Purchase a paid AMI
--owners aws-marketplace
This command returns numerous details that describe each AMI, including the product code for a paid
AMI. The output from describe-images includes an entry for the product code like the following:
"ProductCodes": [
{
"ProductCodeId": "product_code",
"ProductCodeType": "marketplace"
}
],
If you know the product code, you can filter the results by product code. This example returns the most
recent AMI with the specified product code.
Typically a seller of a paid AMI presents you with information about the AMI, including its price and a
link where you can buy it. When you click the link, you're first asked to log into AWS, and then you can
purchase the AMI.
• AWS Marketplace website: You can launch preconfigured software quickly with the 1-Click
deployment feature.
• Amazon EC2 launch wizard: You can search for an AMI and launch an instance directly from the
wizard. For more information, see Launch an AWS Marketplace instance (p. 578).
141
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Use paid support
To associate a product code with your AMI, use one of the following commands, where ami_id is the ID of
the AMI and product_code is the product code:
After you set the product code attribute, it cannot be changed or removed.
1. Ensure that you have terminated any instances running from the subscription.
142
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI lifecycle
c. Select the instance, and then choose Instance state, Terminate instance.
d. Choose Terminate when prompted for confirmation.
2. Log in to the AWS Marketplace, and choose Your Marketplace Account, then Manage your software
subscriptions.
3. Choose Cancel subscription. You are prompted to confirm your cancellation.
Note
After you've canceled your subscription, you are no longer able to launch any instances
from that AMI. To use that AMI again, you need to resubscribe to it, either on the AWS
Marketplace website, or through the launch wizard in the Amazon EC2 console.
AMI lifecycle
You can create your own AMIs, copy them, back them up, and maintain them until you are ready to
deprecate or deregister them.
Contents
• Create a custom Windows AMI (p. 143)
• Modify an AMI (p. 158)
• Copy an AMI (p. 158)
• Store and restore an AMI using S3 (p. 165)
• Deprecate an AMI (p. 171)
• Deregister your AMI (p. 177)
• Recover AMIs from the Recycle Bin (p. 181)
• Automate the EBS-backed AMI lifecycle (p. 185)
To help categorize and manage your AMIs, you can assign custom tags to them. For more information,
see Tag your Amazon EC2 resources (p. 1894).
To create a custom Linux AMI, use the procedure for the type of volume for the instance. For more
information, see Create an Amazon EBS-backed Linux AMI or Create an instance store-backed Linux AMI
in the Amazon EC2 User Guide for Linux Instances.
Topics
• How the creation of a custom AMI works (p. 143)
• Create a Windows AMI from a running instance (p. 144)
• Create a standardized Amazon Machine Image (AMI) using Sysprep (p. 146)
143
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
by stopping the instance before you create an AMI and then create the image. We automatically register
the AMI for you.
During the AMI-creation process, Amazon EC2 creates snapshots of your instance's root volume and any
other EBS volumes attached to your instance. You're charged for the snapshots until you deregister the
AMI and delete the snapshots. For more information, see Deregister your AMI (p. 177). If any volumes
attached to the instance are encrypted, the new AMI only launches successfully on instance types that
support Amazon EBS encryption. For more information, see Amazon EBS encryption (p. 1732).
Depending on the size of the volumes, it can take several minutes for the AMI-creation process to
complete (sometimes up to 24 hours). You may find it more efficient to create snapshots of your volumes
prior to creating your AMI. This way, only small, incremental snapshots need to be created when the AMI
is created, and the process completes more quickly (the total time for snapshot creation remains the
same). For more information, see Create Amazon EBS snapshots (p. 1574).
After the process completes, you have a new AMI and snapshot created from the root volume of the
instance. When you launch an instance using the new AMI, we create a new EBS volume for its root
volume using the snapshot.
Note
A Windows AMI must be created from an Amazon EC2 instance. Creation of a Windows AMI from
an EBS snapshot is currently not supported as it might cause issues with billing, performance,
and general operation.
If you add instance store volumes or Amazon Elastic Block Store (Amazon EBS) volumes to your instance
in addition to the root device volume, the block device mapping for the new AMI contains information
for these volumes, and the block device mappings for instances that you launch from the new AMI
automatically contain information for these volumes. The instance store volumes specified in the
block device mapping for the new instance are new and don't contain any data from the instance
store volumes of the instance you used to create the AMI. The data on EBS volumes persists. For more
information, see Block device mappings (p. 1834).
Note
When you create a new instance from a custom AMI, you should initialize both its root volume
and any additional EBS storage before putting it into production. For more information, see
Initialize Amazon EBS volumes.
144
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
3. Use the Filter options to scope the list of AMIs to the Windows AMIs that meet your needs. For
example, to view the Windows AMIs provided by AWS, choose Public images from the drop-down
list. Choose the Search bar. Choose Owner from the menu and choose amazon. Choose Source from
the menu and enter one of the following, depending on the version of Windows Server that you
need:
• amazon/Windows_Server-2022
• amazon/Windows_Server-2019
• amazon/Windows_Server-2016
• amazon/Windows_Server-2012
Add any other filters that you need. When you have chosen an AMI, select its check box.
4. Choose Launch instance from AMI (new console) or Launch (old console). Accept the default values
as you step through the wizard. For more information, see Launch an instance using the new launch
instance wizard (p. 539). When the instance is ready, connect to it. For more information, see
Connect to your Windows instance (p. 610).
5. Once you connect to the instance, you can perform any of the following actions to customize it for
your needs:
If you are sharing your AMI, these credentials can be supplied for RDP access without disclosing
your default administrator password.
• [Windows Server 2022 and later] Configure settings using EC2Launch v2. To generate a random
password at launch time, configure the setAdminAccount task. For more information, see
setAdminAccount (p. 685).
• [Windows Server 2016 and 2019] Configure settings using EC2Launch. To generate a random
password at launch time, use the adminPasswordType setting. For more information, see
Configure EC2Launch (p. 705).
• [Windows Server 2012 R2 and earlier] Configure settings using EC2Config. To generate a
random password at launch time, enable the Ec2SetPassword plugin; otherwise, the current
administrator password is used. For more information, see EC2Config settings files (p. 719).
• [Windows Server 2008 R2] If the instance uses RedHat drivers to access Xen virtualized hardware,
upgrade to Citrix drivers before you create an AMI. For more information, see Upgrade Windows
Server 2008 and 2008 R2 instances (Redhat to Citrix PV upgrade) (p. 748).
6. In the navigation pane, choose Instances and select your instance. Choose Actions, Image and
templates, and Create image.
Tip
If this option is disabled, your instance isn't an Amazon EBS-backed instance.
7. Specify a unique name for the image and an optional description (up to 255 characters).
By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can take
snapshots of the attached volumes while data is at rest, in order to ensure a consistent state. For the
No reboot setting, you can select the Enable check box to prevent Amazon EC2 from shutting down
and rebooting the instance.
Warning
If you choose to enable No reboot, we can't guarantee the file system integrity of the
created image.
145
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
(Optional) Modify the root volume, EBS volumes, and instance store volumes as needed. For
example:
• To change the size of the root volume, locate the Root volume in the Type column, and fill in the
Size field.
• To suppress an EBS volume specified by the block device mapping of the AMI used to launch the
instance, locate the EBS volume in the list and choose Delete.
• To add an EBS volume, choose Add New Volume, Type, and EBS, and fill in the fields. When you
then launch an instance from your new AMI, these additional volumes are automatically attached
to the instance. Empty volumes must be formatted and mounted. Volumes based on a snapshot
must be mounted.
• To suppress an instance store volume specified by the block device mapping of the AMI used to
launch the instance, locate the volume in the list and choose Delete.
• To add an instance store volume, choose Add New Volume, Type, and Instance Store, and select
a device name from the Device list. When you launch an instance from your new AMI, these
additional volumes are automatically initialized and mounted. These volumes don't contain data
from the instance store volumes of the running instance from which you based your AMI.
(Optional) Choose Snapshots in the navigation pane to view the snapshot that was created for the
new AMI. When you launch an instance from this AMI, we use this snapshot to create its root device
volume.
9. Launch an instance from your new AMI. For more information, see Launch an instance using the new
launch instance wizard (p. 539). The new running instance contains all of the customizations you
applied in previous steps, and any additional customization you add when launching the instance,
such as user data (scripts that run when the instance starts).
We recommend that you use EC2 Image Builder to automate the creation, management, and deployment
of customized, secure, and up-to-date "golden" server images that are pre-installed and preconfigured
with software and settings.
If you use Sysprep to create a standardized AMI, we recommend that you run Sysprep with EC2Launch
v2 (p. 653). If you are still using the EC2Config (Windows Server 2012 R2 and earlier) or EC2Launch
146
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
(Windows Server 2016 and 2019) agents, see the documentation for using Sysprep with EC2Config and
EC2Launch below.
Important
Do not use Sysprep to create an instance backup. Sysprep removes system-specific information;
removing this information might have unintended consequences for an instance backup.
Contents
• Before you begin (p. 147)
• Use Sysprep with EC2Launch v2 (p. 147)
• Use Sysprep with EC2Launch (p. 150)
• Use Sysprep with EC2Config (p. 154)
Sysprep phases
• Generalize: The tool removes image-specific information and configurations. For example, Sysprep
removes the security identifier (SID), the computer name, the event logs, and specific drivers, to name
a few. After this phase is completed, the operating system (OS) is ready to create an AMI.
Note
When you run Sysprep with the EC2Launch v2 service, the system prevents drivers from being
removed because the PersistAllDeviceInstalls setting is set to true by default.
• Specialize: Plug and Play scans the computer and installs drivers for any detected devices. The tool
generates OS requirements, like the computer name and SID. Optionally, you can run commands in
this phase.
• Out-of-Box Experience (OOBE): The system runs an abbreviated version of Windows Setup and asks
you to enter information such as system language, time zone, and registered organization. When you
run Sysprep with EC2Launch v2, the answer file automates this phase.
147
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
Sysprep actions
Sysprep and EC2Launch v2 perform the following actions when preparing an image.
1. When you choose Shutdown with Sysprep in the EC2Launch settings dialog box, the system runs the
ec2launch sysprep command.
2. EC2Launch v2 edits the content of the unattend.xml file by reading the registry value at
HKEY_USERS\.DEFAULT\Control Panel\International\LocaleName. This file is located in the
following directory: C:\ProgramData\Amazon\EC2Launch\sysprep.
3. The system run the BeforeSysprep.cmd. This command creates a registry key as follows:
The registry key disables RDP connections until they are re-enabled. Disabling RDP connections is
a necessary security measure because, during the first boot session after Sysprep has run, there is a
short period of time where RDP allows connections and the Administrator password is blank.
4. The EC2Launch v2 service calls Sysprep by running the following command:
Generalize phase
• EC2Launch v2 removes image-specific information and configurations, such as the computer name and
the SID. If the instance is a member of a domain, it is removed from the domain. The unattend.xml
answer file includes the following settings that affect this phase:
• PersistAllDeviceInstalls: This setting prevents Windows Setup from removing and reconfiguring
devices, which speeds up the image preparation process because Amazon AMIs require certain
drivers to run and re-detection of those drivers would take time.
• DoNotCleanUpNonPresentDevices: This setting retains Plug and Play information for devices that
are not currently present.
• Sysprep shuts down the OS as it prepares to create the AMI. The system either launches a new instance
or starts the original instance.
Specialize phase
The system generates OS-specific requirements, such as a computer name and an SID. The system also
performs the following actions based on configurations that you specify in the unattend.xml answer
file.
• CopyProfile: Sysprep can be configured to delete all user profiles, including the built-in Administrator
profile. This setting retains the built-in Administrator account so that any customizations you make to
that account are carried over to the new image. The default value is True.
CopyProfile replaces the default profile with the existing local administrator profile. All accounts that
you log in to after running Sysprep receive a copy of that profile and its contents at first login.
If you don’t have specific user-profile customizations that you want to carry over to the new image,
then change this setting to False. Sysprep will remove all user profiles (this saves time and disk
space).
• TimeZone: The time zone is set to Coordinate Universal Time (UTC) by default.
• Synchronous command with order 1: The system runs the following command, which enables the
administrator account and specifies the password requirement:
148
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
C:\Program Files\Amazon\Ec2ConfigService\Scripts\SysprepSpecializePhase.cmd
This command adds the following registry key, which re-enables RDP:
OOBE phase
1. The system specifies the following configurations using the EC2Launch v2 answer file:
• <InputLocale>en-US</InputLocale>
• <SystemLocale>en-US</SystemLocale>
• <UILanguage>en-US</UILanguage>
• <UserLocale>en-US</UserLocale>
• <HideEULAPage>true</HideEULAPage>
• <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
• <ProtectYourPC>3</ProtectYourPC>
• <BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
• <TimeZone>UTC</TimeZone>
• <RegisteredOrganization>Amazon.com</RegisteredOrganization>
• <RegisteredOwner>EC2</RegisteredOwner>
Note
During the generalize and specialize phases, EC2Launch v2 monitors the status of the OS.
If EC2Launch v2 detects that the OS is in a Sysprep phase, then it publishes the following
message to the system log:
Windows is being configured. SysprepState=IMAGE_STATE_UNDEPLOYABLE
2. The system runs EC2Launch v2.
Post Sysprep
After Sysprep completes, EC2Launch v2 sends the following message to the console output:
1. Reads the content of the agent-config.yml file and runs configured tasks.
2. Executes all tasks in the preReady stage.
3. After it is finished, sends a Windows is ready message to the instance system logs.
4. Executes all tasks in the PostReady stage.
149
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
For more information about EC2Launch v2 , see Configure a Windows instance using EC2Launch
v2 (p. 653).
Use the following procedure to create a standardized AMI using Sysprep with EC2Launch v2.
1. In the Amazon EC2 console, locate or create (p. 143) an AMI that you want to duplicate.
2. Launch and connect to your Windows instance.
3. Customize it.
4. From the Windows Start menu, search for and choose Amazon EC2Launch settings. For more
information about the options and settings in the Amazon EC2Launch settings dialog box, see
EC2Launch v2 settings (p. 663).
5. Select Shutdown with Sysprep or Shutdown without Sysprep.
When you are asked to confirm that you want to run Sysprep and shut down the instance, click Yes.
EC2Launch v2 runs Sysprep. Next, you are logged off the instance, and the instance shuts down. If you
check the Instances page in the Amazon EC2 console, the instance state changes from Running to
Stopping to Stopped. At this point, it's safe to create an AMI from this instance.
You can manually invoke the Sysprep tool from the command line using the following command:
The EC2Launch answer file and batch files for Sysprep include the following:
Unattend.xml
This is the default answer file. If you run SysprepInstance.ps1 or choose ShutdownWithSysprep
in the user interface, the system reads the setting from this file.
BeforeSysprep.cmd
Customize this batch file to run commands before EC2Launch runs Sysprep.
SysprepSpecialize.cmd
Customize this batch file to run commands during the Sysprep specialize phase.
150
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
On the full installation of Windows Server 2016 and later (with a desktop experience), you can run
Sysprep with EC2Launch manually or by using the EC2 Launch Settings application.
1. In the Amazon EC2 console, locate or create a Windows Server 2016 or later AMI.
2. Launch a Windows instance from the AMI.
3. Connect to your Windows instance and customize it.
4. Search for and run the EC2LaunchSettings application. It is located in the following directory by
default: C:\ProgramData\Amazon\EC2-Windows\Launch\Settings.
151
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
152
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
5. Select or clear options as needed. These settings are stored in the LaunchConfig.json file.
6. For Administrator Password, do one of the following:
• Choose Random. EC2Launch generates a password and encrypts it using the user's key. The
system disables this setting after the instance is launched so that this password persists if the
instance is rebooted or stopped and started.
• Choose Specify and type a password that meets the system requirements. The password is
stored in LaunchConfig.json as clear text and is deleted after Sysprep sets the administrator
password. If you shut down now, the password is set immediately. EC2Launch encrypts the
password using the user's key.
• Choose DoNothing and specify a password in the unattend.xml file. If you don't specify a
password in unattend.xml, the administrator account is disabled.
7. Choose Shutdown with Sysprep.
1. In the Amazon EC2 console locate or create a Windows Server 2016 or later Datacenter edition AMI
that you want to duplicate.
2. Launch and connect to your Windows instance.
3. Customize the instance.
4. Specify settings in the LaunchConfig.json file. This file is located in the C:\ProgramData
\Amazon\EC2-Windows\Launch\Config directory by default.
Random
EC2Launch generates a password and encrypts it using the user's key. The system disables this
setting after the instance is launched so that this password persists if the instance is rebooted or
stopped and started.
Specify
EC2Launch uses the password you specify in adminPassword. If the password does not meet
the system requirements, EC2Lauch generates a random password instead. The password is
stored in LaunchConfig.json as clear text and is deleted after Sysprep sets the administrator
password. EC2Launch encrypts the password using the user's key.
DoNothing
EC2Launch uses the password you specify in the unattend.xml file. If you don't specify a
password in unattend.xml, the administrator account is disabled.
5. (Optional) Specify settings in unattend.xml and other configuration files. If plan to attend to
the installation, then you don't need to make changes in these files. The files are located in the
following directory by default: C:\ProgramData\Amazon\EC2-Windows\Launch\Sysprep.
6. In Windows PowerShell, run ./InitializeInstance.ps1 -Schedule. The script is located in
the following directory, by default: C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts.
This script schedules the instance to initialize during the next boot. You must run this script before
you run the SysprepInstance.ps1 script in the next step.
7. In Windows PowerShell, run ./SysprepInstance.ps1. The script is located in the following
directory by default: C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts.
You are logged off the instance and the instance shuts down. If you check the Instances page in the
Amazon EC2 console, the instance state changes from Running to Stopping, and then to Stopped. At
this point, it is safe to create an AMI from this instance.
153
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
Update metadata/KMS routes for Server 2016 and later when launching a custom AMI
To update metadata/KMS routes for Server 2016 and later when launching a custom AMI, do one of the
following:
Sysprep phases
Sysprep runs through the following phases:
• Generalize: The tool removes image-specific information and configurations. For example, Sysprep
removes the security identifier (SID), the computer name, the event logs, and specific drivers, to name
a few. After this phase is completed, the operating system (OS) is ready to create an AMI.
Note
When you run Sysprep with the EC2Config service, the system prevents drivers from being
removed because the PersistAllDeviceInstalls setting is set to true by default.
• Specialize: Plug and Play scans the computer and installs drivers for any detected devices. The tool
generates OS requirements like the computer name and SID. Optionally, you can run commands in this
phase.
• Out-of-Box Experience (OOBE): The system runs an abbreviated version of Windows Setup and asks
the user to enter information such as a system language, the time zone, and a registered organization.
When you run Sysprep with EC2Config, the answer file automates this phase.
Sysprep actions
Sysprep and the EC2Config service perform the following actions when preparing an image.
1. When you choose Shutdown with Sysprep in the EC2 Service Properties dialog box, the system runs
the ec2config.exe –sysprep command.
2. The EC2Config service reads the content of the BundleConfig.xml file. This file is located in the
following directory, by default: C:\Program Files\Amazon\Ec2ConfigService\Settings.
154
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
The BundleConfig.xml file includes the following settings. You can change these settings:
• AutoSysprep: Indicates whether to use Sysprep automatically. You do not need to change this value
if you are running Sysprep from the EC2 Service Properties dialog box. The default value is No.
• SetRDPCertificate: Sets a self-signed certificate for the Remote Desktop server. This enables you
to securely use the Remote Desktop Protocol (RDP) to connect to the instance. Change the value
to Yes if new instances should use a certificate. This setting is not used with Windows Server
2008 or Windows Server 2012 instances because these operating systems can generate their own
certificates. The default value is No.
• SetPasswordAfterSysprep: Sets a random password on a newly launched instance, encrypts it with
the user launch key, and outputs the encrypted password to the console. Change the value to No if
new instances should not be set to a random encrypted password. The default value is Yes.
• PreSysprepRunCmd: The location of the command to run. The command is located in the
following directory, by default: C:\Program Files\Amazon\Ec2ConfigService\Scripts
\BeforeSysprep.cmd
3. The system runs BeforeSysprep.cmd. This command creates a registry key as follows:
The registry key disables RDP connections until they are re-enabled. Disabling RDP connections is
a necessary security measure because, during the first boot session after Sysprep has run, there is a
short period of time where RDP allows connections and the Administrator password is blank.
4. The EC2Config service calls Sysprep by running the following command:
Generalize phase
• The tool removes image-specific information and configurations such as the computer name and the
SID. If the instance is a member of a domain, it is removed from the domain. The sysprep2008.xml
answer file includes the following settings that affect this phase:
• PersistAllDeviceInstalls: This setting prevents Windows Setup from removing and reconfiguring
devices, which speeds up the image preparation process because Amazon AMIs require certain
drivers to run and re-detection of those drivers would take time.
• DoNotCleanUpNonPresentDevices: This setting retains Plug and Play information for devices that
are not currently present.
• Sysprep shuts down the OS as it prepares to create the AMI. The system either launches a new instance
or starts the original instance.
Specialize phase
The system generates OS specific requirements such as a computer name and a SID. The system also
performs the following actions based on configurations that you specify in the sysprep2008.xml answer
file.
• CopyProfile: Sysprep can be configured to delete all user profiles, including the built-in Administrator
profile. This setting retains the built-in Administrator account so that any customizations you made to
that account are carried over to the new image. The default value is True.
CopyProfile replaces the default profile with the existing local administrator profile. All accounts
logged into after running Sysprep will receive a copy of that profile and its contents at first login.
155
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
If you don’t have specific user-profile customizations that you want to carry over to the new image
then change this setting to False. Sysprep will remove all user profiles; this saves time and disk space.
• TimeZone: The time zone is set to Coordinate Universal Time (UTC) by default.
• Synchronous command with order 1: The system runs the following command that enables the
administrator account and specifies the password requirement.
C:\Program Files\Amazon\Ec2ConfigService\Scripts\SysprepSpecializePhase.cmd
This command adds the following registry key, which re-enables RDP:
OOBE phase
1. Using the EC2Config service answer file, the system specifies the following configurations:
• <InputLocale>en-US</InputLocale>
• <SystemLocale>en-US</SystemLocale>
• <UILanguage>en-US</UILanguage>
• <UserLocale>en-US</UserLocale>
• <HideEULAPage>true</HideEULAPage>
• <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
• <NetworkLocation>Other</NetworkLocation>
• <ProtectYourPC>3</ProtectYourPC>
• <BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
• <TimeZone>UTC</TimeZone>
• <RegisteredOrganization>Amazon.com</RegisteredOrganization>
• <RegisteredOwner>Amazon</RegisteredOwner>
Note
During the generalize and specialize phases the EC2Config service monitors the status of the
OS. If EC2Config detects that the OS is in a Sysprep phase, then it publishes the following
message to the system log:
EC2ConfigMonitorState: 0 Windows is being configured.
SysprepState=IMAGE_STATE_UNDEPLOYABLE
2. After the OOBE phase completes, the system runs SetupComplete.cmd from the following location:
C:\Windows\Setup\Scripts\SetupComplete.cmd. In Amazon public AMIs before April 2015 this
file was empty and ran nothing on the image. In public AMIs dated after April 2015, the file includes
the following value: call "C:\Program Files\Amazon\Ec2ConfigService\Scripts\PostSysprep.cmd".
3. The system runs PostSysprep.cmd, which performs the following operations:
• Sets the local Administrator password to not expire. If the password expired, Administrators might
not be able to log on.
• Sets the MSSQLServer machine name (if installed) so that the name will be in sync with the AMI.
156
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create a custom Windows AMI
Post Sysprep
After Sysprep completes, the EC2Config services sends the following message to the console output:
1. Reads the content of the config.xml file and lists all enabled plug-ins.
2. Executes all “Before Windows is ready” plug-ins at the same time.
• Ec2SetPassword
• Ec2SetComputerName
• Ec2InitializeDrives
• Ec2EventLog
• Ec2ConfigureRDP
• Ec2OutputRDPCert
• Ec2SetDriveLetter
• Ec2WindowsActivate
• Ec2DynamicBootVolumeSize
3. After it is finished, sends a “Windows is ready” message to the instance system logs.
4. Runs all “After Windows is ready” plug-ins at the same time.
• Amazon CloudWatch Logs
• UserData
• AWS Systems Manager (Systems Manager)
For more information about Windows plug-ins, see Configure a Windows instance using the EC2Config
service (p. 712).
Use the following procedure to create a standardized AMI using Sysprep and the EC2Config service.
1. In the Amazon EC2 console, locate or create (p. 143) an AMI that you want to duplicate.
2. Launch and connect to your Windows instance.
3. Customize it.
4. Specify configuration settings in the EC2Config service answer file:
C:\Program Files\Amazon\Ec2ConfigService\sysprep2008.xml
5. From the Windows Start menu, choose All Programs, and then choose EC2ConfigService Settings.
6. Choose the Image tab in the Ec2 Service Properties dialog box. For more information about the
options and settings in the Ec2 Service Properties dialog box, see Ec2 Service Properties (p. 712).
7. Select an option for the Administrator password, and then select Shutdown with Sysprep or
Shutdown without Sysprep. EC2Config edits the settings files based on the password option that you
selected.
• Random: EC2Config generates a password, encrypts it with user's key, and displays the encrypted
password to the console. We disable this setting after the first launch so that this password persists
if the instance is rebooted or stopped and started.
• Specify: The password is stored in the Sysprep answer file in unencrypted form (clear text). When
Sysprep runs next, it sets the Administrator password. If you shut down now, the password is set
157
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Modify an AMI
immediately. When the service starts again, the Administrator password is removed. It's important
to remember this password, as you can't retrieve it later.
• Keep Existing: The existing password for the Administrator account doesn't change when Sysprep is
run or EC2Config is restarted. It's important to remember this password, as you can't retrieve it later.
8. Choose OK.
When you are asked to confirm that you want to run Sysprep and shut down the instance, click Yes. You'll
notice that EC2Config runs Sysprep. Next, you are logged off the instance, and the instance is shut down.
If you check the Instances page in the Amazon EC2 console, the instance state changes from Running to
Stopping, and then finally to Stopped. At this point, it's safe to create an AMI from this instance.
You can manually invoke the Sysprep tool from the command line using the following command:
"%programfiles%\amazon\ec2configservice\"ec2config.exe -sysprep""
Note
The double quotation marks in the command are not required if your CMD shell is already in the
C:\Program Files\Amazon\EC2ConfigService\ directory.
However, you must be very careful that the XML file options specified in the Ec2ConfigService
\Settings folder are correct; otherwise, you might not be able to connect to the instance. For
more information about the settings files, see EC2Config settings files (p. 719). For an example of
configuring and then running Sysprep from the command line, see Ec2ConfigService\Scripts
\InstallUpdates.ps1.
Modify an AMI
You can modify a limited set of Amazon Machine Image (AMI) attributes, such as the AMI's description
and sharing properties. However, AMI content (volume binary data) can't be modified. To modify the AMI
content, you must create a new AMI (p. 143).
Important
You can't modify the content (volume binary data) of an EBS-backed AMI because the snapshots
that back them are immutable.
For the AMI attributes that can be modified, see ModifyImageAttribute in the Amazon EC2 API Reference.
The following topics provide instructions for using the Amazon EC2 console and AWS CLI to modify the
attributes of an AMI:
Copy an AMI
You can copy an Amazon Machine Image (AMI) within or across AWS Regions. You can copy both Amazon
EBS-backed AMIs and instance-store-backed AMIs. You can copy AMIs with encrypted snapshots and also
change encryption status during the copy process. You can copy AMIs that are shared with you.
Copying a source AMI results in an identical but distinct target AMI with its own unique identifier. You can
change or deregister the source AMI with no effect on the target AMI. The reverse is also true.
158
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
With an Amazon EBS-backed AMI, each of its backing snapshots is copied to an identical but distinct
target snapshot. If you copy an AMI to a new Region, the snapshots are complete (non-incremental)
copies. If you encrypt unencrypted backing snapshots or encrypt them to a new KMS key, the snapshots
are complete (non-incremental) copies. Subsequent copy operations of an AMI result in incremental
copies of the backing snapshots.
Contents
• Considerations (p. 159)
• Costs (p. 159)
• Permissions for copying an instance store-backed AMI (p. 159)
• Copy an AMI (p. 160)
• Stop a pending AMI copy operation (p. 162)
• Cross-Region copying (p. 162)
• Cross-account copying (p. 163)
• Encryption and copying (p. 164)
Considerations
• You can use IAM policies to grant or deny users permissions to copy AMIs. Resource-level permissions
specified for the CopyImage action apply only to the new AMI. You cannot specify resource-level
permissions for the source AMI.
• AWS does not copy launch permissions or Amazon S3 bucket permissions from the source AMI to the
new AMI. After the copy operation is complete, you can apply launch permissions and Amazon S3
bucket permissions to the new AMI.
• You can only copy user-defined AMI tags that you attached to the AMI. System tags (prefixed with
aws:) and user-defined tags that are attached by other AWS accounts will not be copied.
• The CopyImage action is not supported for copying an AWS Marketplace AMI that was shared from
another account. Instead, if you want to copy an AWS Marketplace AMI in another account, you must
do the following: share the AWS Marketplace AMI with the other account and then, in the other
account, launch an EC2 instance using the AWS Marketplace AMI. You can then create an AMI from
the instance using the CreateImage action. The new AMI retains all the AWS Marketplace codes.
Note that this process also applies to any AMIs that were directly or indirectly derived from an AWS
Marketplace AMI. For more information about creating an AMI from an instance, see Create a custom
Windows AMI (p. 143).
Costs
There are no charges for copying an AMI. However, standard storage and data transfer rates apply. If you
copy an EBS-backed AMI, you will incur charges for the storage of any additional EBS snapshots.
The following example policy allows the user to copy the AMI source in the specified bucket to the
specified Region.
159
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::ami-source-bucket/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:CreateBucket",
"s3:GetBucketAcl",
"s3:PutObjectAcl",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::amis-for-123456789012-in-us-east-1*"
]
}
]
}
To find the Amazon Resource Name (ARN) of the AMI source bucket, open the Amazon EC2 console at
https://console.aws.amazon.com/ec2/, in the navigation pane choose AMIs, and locate the bucket name
in the Source column.
Note
The s3:CreateBucket permission is only needed the first time that the user copies an instance
store-backed AMI to an individual Region. After that, the Amazon S3 bucket that is already
created in the Region is used to store all future AMIs that you copy to that Region.
Copy an AMI
You can copy an AMI using the AWS Management Console, the AWS Command Line Interface or SDKs, or
the Amazon EC2 API, all of which support the CopyImage action.
Prerequisite
Create or obtain an AMI backed by an Amazon EBS snapshot. Note that you can use the Amazon EC2
console to search a wide variety of AMIs provided by AWS. For more information, see Create a custom
Windows AMI (p. 143) and Finding an AMI.
New console
160
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
• AMI copy name: A name for the new AMI. You can include operating system information in
the name, as we do not provide this information when displaying details about the AMI.
• AMI copy description: By default, the description includes information about the source
AMI so that you can distinguish a copy from its original. You can change this description as
needed.
• Destination Region: The Region in which to copy the AMI. For more information, see Cross-
Region copying (p. 162).
• Copy tags: Select this check box to include your user-defined AMI tags when copying the
AMI. System tags (prefixed with aws:) and user-defined tags that are attached by other AWS
accounts will not be copied.
• Encrypt EBS snapshots of AMI copy: Select this check box to encrypt the target snapshots, or
to re-encrypt them using a different key. If you have enabled encryption by default (p. 1735),
the Encrypt EBS snapshots of AMI copy check box is selected and cannot be cleared. For
more information, see Encryption and copying (p. 164).
• KMS key: The KMS key to used to encrypt the target snapshots.
6. Choose Copy AMI.
The initial status of the new AMI is Pending. The AMI copy operation is complete when the
status is Available.
Old console
• Destination region: The Region in which to copy the AMI. For more information, see Cross-
Region copying (p. 162).
• Name: A name for the new AMI. You can include operating system information in the name,
as we do not provide this information when displaying details about the AMI.
• Description: By default, the description includes information about the source AMI so that
you can distinguish a copy from its original. You can change this description as needed.
• Encryption: Select this field to encrypt the target snapshots, or to re-encrypt them using a
different key. If you have enabled encryption by default (p. 1735), the Encryption option is
set and cannot be unset. For more information, see Encryption and copying (p. 164).
• KMS Key: The KMS key to used to encrypt the target snapshots.
5. We display a confirmation page to let you know that the copy operation has been initiated and
to provide you with the ID of the new AMI.
To check on the progress of the copy operation immediately, follow the provided link. To check
on the progress later, choose Done, and then when you are ready, use the navigation bar to
switch to the target Region (if applicable) and locate your AMI in the list of AMIs.
The initial status of the target AMI is pending and the operation is complete when the status is
available.
161
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
You can copy an AMI using the copy-image command. You must specify both the source and destination
Regions. You specify the source Region using the --source-region parameter. You can specify
the destination Region using either the --region parameter or an environment variable. For more
information, see Configuring the AWS Command Line Interface.
When you encrypt a target snapshot during copying, you must specify these additional parameters: --
encrypted and --kms-key-id.
For example commands, see the Examples under copy-image in the AWS CLI Command Reference.
You can copy an AMI using the Copy-EC2Image command. You must specify both the source and
destination Regions. You specify the source Region using the -SourceRegion parameter. You can
specify the destination Region using either the -Region parameter or the Set-AWSDefaultRegion
command. For more information, see Specifying AWS Regions.
When you encrypt a target snapshot during copying, you must specify these additional parameters: -
Encrypted and -KmsKeyId.
New console
Old console
Cross-Region copying
Copying an AMI across geographically diverse Regions provides the following benefits:
162
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
• Consistent global deployment: Copying an AMI from one Region to another enables you to launch
consistent instances in different Regions based on the same AMI.
• Scalability: You can more easily design and build global applications that meet the needs of your users,
regardless of their location.
• Performance: You can increase performance by distributing your application, as well as locating critical
components of your application in closer proximity to your users. You can also take advantage of
Region-specific features, such as instance types or other AWS services.
• High availability: You can design and deploy applications across AWS Regions, to increase availability.
The following diagram shows the relations among a source AMI and two copied AMIs in different
Regions, as well as the EC2 instances launched from each. When you launch an instance from an AMI, it
resides in the same Region where the AMI resides. If you make changes to the source AMI and want those
changes to be reflected in the AMIs in the target Regions, you must recopy the source AMI to the target
Regions.
When you first copy an instance store-backed AMI to a Region, we create an Amazon S3 bucket for the
AMIs copied to that Region. All instance store-backed AMIs that you copy to that Region are stored in this
bucket. The bucket names have the following format: amis-for-account-in-region-hash. For example:
amis-for-123456789012-in-us-east-2-yhjmxvp6.
Prerequisite
Prior to copying an AMI, you must ensure that the contents of the source AMI are updated to support
running in a different Region. For example, you should update any database connection strings or similar
application configuration data to point to the appropriate resources. Otherwise, instances launched from
the new AMI in the destination Region may still use the resources from the source Region, which can
impact performance and cost.
Limits
Cross-account copying
You can share an AMI with another AWS account. Sharing an AMI does not affect the ownership of the
AMI. The owning account is charged for the storage in the Region. For more information, see Share an
AMI with specific AWS accounts (p. 133).
163
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Copy an AMI
If you copy an AMI that has been shared with your account, you are the owner of the target AMI in your
account. The owner of the source AMI is charged standard Amazon EBS or Amazon S3 transfer fees, and
you are charged for the storage of the target AMI in the destination Region.
Resource permissions
To copy an AMI that was shared with you from another account, the owner of the source AMI must
grant you read permissions for the storage that backs the AMI. The storage is either the associated EBS
snapshot (for an Amazon EBS-backed AMI) or an associated S3 bucket (for an instance store-backed
AMI). If the shared AMI has encrypted snapshots, the owner must share the key or keys with you as well.
For more information about granting resource permissions, for EBS snapshots, see Share an Amazon
EBS snapshot (p. 1621), and for S3 buckets, see Identity and access management in Amazon S3 in the
Amazon Simple Storage Service User Guide.
Note
To copy an AMI with its tags, you must have launch permissions for the source AMI.
1 Unencrypted-to-unencrypted Yes
2 Encrypted-to-encrypted Yes
3 Unencrypted-to-encrypted Yes
4 Encrypted-to-unencrypted No
Note
Encrypting during the CopyImage action applies only to Amazon EBS-backed AMIs. Because
an instance store-backed AMI does not rely on snapshots, you cannot use copying to change its
encryption status.
By default (i.e., without specifying encryption parameters), the backing snapshot of an AMI is copied with
its original encryption status. Copying an AMI backed by an unencrypted snapshot results in an identical
target snapshot that is also unencrypted. If the source AMI is backed by an encrypted snapshot, copying
it results in an identical target snapshot that is encrypted by the same AWS KMS key. Copying an AMI
backed by multiple snapshots preserves, by default, the source encryption status in each target snapshot.
If you specify encryption parameters while copying an AMI, you can encrypt or re-encrypt its backing
snapshots. The following example shows a non-default case that supplies encryption parameters to the
CopyImage action in order to change the target AMI's encryption state.
In this scenario, an AMI backed by an unencrypted root snapshot is copied to an AMI with an encrypted
root snapshot. The CopyImage action is invoked with two encryption parameters, including a customer
managed key. As a result, the encryption status of the root snapshot changes, so that the target AMI is
backed by a root snapshot containing the same data as the source snapshot, but encrypted using the
specified key. You incur storage costs for the snapshots in both AMIs, as well as charges for any instances
you launch from either AMI.
164
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
Note
Enabling encryption by default (p. 1735) has the same effect as setting the Encrypted
parameter to true for all snapshots in the AMI.
Setting the Encrypted parameter encrypts the single snapshot for this instance. If you do not specify
the KmsKeyId parameter, the default customer managed key is used to encrypt the snapshot copy.
For more information about copying AMIs with encrypted snapshots, see Use encryption with EBS-
backed AMIs (p. 185).
The supported APIs for storing and restoring an AMI using S3 are CreateStoreImageTask,
DescribeStoreImageTasks, and CreateRestoreImageTask.
CopyImage is the recommended API to use for copying AMIs within an AWS partition. However,
CopyImage can’t copy an AMI to another partition.
For information about the AWS partitions, see partition on the Amazon Resource Names (ARNs) page
in the AWS General Reference.
Warning
Ensure that you comply with all applicable laws and business requirements when moving
data between AWS partitions or AWS Regions, including, but not limited to, any applicable
government regulations and data residency requirements.
Topics
• Use cases (p. 166)
• How the AMI store and restore APIs work (p. 167)
• Limitations (p. 168)
• Costs (p. 168)
• Securing your AMIs (p. 168)
• Permissions for storing and restoring AMIs using S3 (p. 169)
165
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
• Work with the AMI store and restore APIs (p. 170)
• Use file paths in S3 (p. 171)
Use cases
Use the store and restore APIs to do the following:
• Copy an AMI from one AWS partition to another AWS partition (p. 166)
• Make archival copies of AMIs (p. 166)
• Store the AMI in an S3 bucket in the current Region by using CreateStoreImageTask. In this
example, the S3 bucket is located in us-east-2. For an example command, see Store an AMI in an S3
bucket (p. 170).
• Monitor the progress of the store task by using DescribeStoreImageTasks. The object becomes
visible in the S3 bucket when the task is completed. For an example command, see Describe the
progress of an AMI store task (p. 170).
• Copy the stored AMI object to an S3 bucket in the target partition using a procedure of your choice. In
this example, the S3 bucket is located in us-gov-east-1.
Note
Because you need different AWS credentials for each partition, you can’t copy an S3 object
directly from one partition to another. The process for copying an S3 object across partitions
is outside the scope of this documentation. We provide the following copy processes as
examples, but you must use the copy process that meets your security requirements.
• To copy one AMI across partitions, the copy process could be as straightforward as the
following: Download the object from the source bucket to an intermediate host (for
example, an EC2 instance or a laptop), and then upload the object from the intermediate
host to the target bucket. For each stage of the process, use the AWS credentials for the
partition.
• For more sustained usage, consider developing an application that manages the copies,
potentially using S3 multipart downloads and uploads.
• Restore the AMI from the S3 bucket in the target partition by using CreateRestoreImageTask. In
this example, the S3 bucket is located in us-gov-east-1. For an example command, see Restore an
AMI from an S3 bucket (p. 170).
• Monitor the progress of the restore task by describing the AMI to check when its state becomes
available. You can also monitor the progress percentages of the snapshots that make up the restored
AMI by describing the snapshots.
The AMI is packed into a single object in S3, and all of the AMI metadata (excluding sharing information)
is preserved as part of the stored AMI. The AMI data is compressed as part of the storage process. AMIs
166
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
that contain data that can easily be compressed will result in smaller objects in S3. To reduce costs,
you can use less expensive S3 storage tiers. For more information, see Amazon S3 Storage Classes and
Amazon S3 pricing
CreateStoreImageTask
The CreateStoreImageTask (p. 170) API stores an AMI as a single object in an S3 bucket.
The API creates a task that reads all of the data from the AMI and its snapshots, and then uses an S3
multipart upload to store the data in an S3 object. The API takes all of the components of the AMI,
including most of the non-Region-specific AMI metadata, and all the EBS snapshots contained in the
AMI, and packs them into a single object in S3. The data is compressed as part of the upload process to
reduce the amount of space used in S3, so the object in S3 might be smaller than the sum of the sizes of
the snapshots in the AMI.
If there are AMI and snapshot tags visible to the account calling this API, they are preserved.
The object in S3 has the same ID as the AMI, but with a .bin extension. The following data is also stored
as S3 metadata tags on the S3 object: AMI name, AMI description, AMI registration date, AMI owner
account, and a timestamp for the store operation.
The time it takes to complete the task depends on the size of the AMI. It also depends on how many
other tasks are in progress because tasks are queued. You can track the progress of the task by calling
the DescribeStoreImageTasks (p. 170) API.
The sum of the sizes of all the AMIs in progress is limited to 600 GB of EBS snapshot data per account.
Further task creation will be rejected until the tasks in progress are less than the limit. For example,
if an AMI with 100 GB of snapshot data and another AMI with 200 GB of snapshot data are currently
being stored, another request will be accepted, because the total in progress is 300 GB, which is less than
the limit. But if a single AMI with 800 GB of snapshot data is currently being stored, further tasks are
rejected until the task is completed.
DescribeStoreImageTasks
The DescribeStoreImageTasks (p. 170) API describes the progress of the AMI store tasks. You can
describe tasks for specified AMIs. If you don't specify AMIs, you get a paginated list of all of the store
image tasks that have been processed in the last 31 days.
For each AMI task, the response indicates if the task is InProgress, Completed, or Failed. For tasks
InProgress, the response shows an estimated progress as a percentage.
167
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
CreateRestoreImageTask
The CreateRestoreImageTask (p. 170) API starts a task that restores an AMI from an S3 object that was
previously created by using a CreateStoreImageTask (p. 170) request.
The restore task can be performed in the same or a different Region in which the store task was
performed.
The S3 bucket from which the AMI object will be restored must be in the same Region in which the
restore task is requested. The AMI will be restored in this Region.
The AMI is restored with its metadata, such as the name, description, and block device mappings
corresponding to the values of the stored AMI. The name must be unique for AMIs in the Region for this
account. If you do not provide a name, the new AMI gets the same name as the original AMI. The AMI
gets a new AMI ID that is generated at the time of the restore process.
The time it takes to complete the AMI restoration task depends on the size of the AMI. It also depends on
how many other tasks are in progress because tasks are queued. You can view the progress of the task by
describing the AMI (describe-images) or its EBS snapshots (describe-snapshots). If the task fails, the AMI
and snapshots are moved to a failed state.
The sum of the sizes of all of the AMIs in progress is limited to 300 GB (based on the size after
restoration) of EBS snapshot data per account. Further task creation will be rejected until the tasks in
progress are less than the limit.
Limitations
• To store an AMI, your AWS account must either own the AMI and its snapshots, or the AMI and its
snapshots must be shared directly with your account (p. 133). You can't store an AMI if it is only
publicly shared (p. 124).
• Only EBS-backed AMIs can be stored using these APIs.
• Paravirtual (PV) AMIs are not supported.
• The size of an AMI (before compression) that can be stored is limited to 5,000 GB.
• Quota on store image (p. 170) requests: 600 GB of storage work (snapshot data) in progress.
• Quota on restore image (p. 170) requests: 300 GB of restore work (snapshot data) in progress.
• For the duration of the store task, the snapshots must not be deleted and the IAM principal doing the
store must have access to the snapshots, otherwise the store process will fail.
• You can’t create multiple copies of an AMI in the same S3 bucket.
• An AMI that is stored in an S3 bucket can’t be restored with its original AMI ID. You can mitigate this by
using AMI aliasing.
• Currently the store and restore APIs are only supported by using the AWS Command Line Interface,
AWS SDKs, and Amazon EC2 API. You can’t store and restore an AMI using the Amazon EC2 console.
Costs
When you store and restore AMIs using S3, you are charged for the services that are used by the store
and restore APIs, and for data transfer. The APIs use S3 and the EBS Direct API (used internally by these
APIs to access the snapshot data). For more information, see Amazon S3 pricing and Amazon EBS pricing.
168
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
that the security is maintained for as long as the AMI objects remain in the bucket. If this can’t be done,
use of these APIs is not recommended. Ensure that public access to the S3 bucket is not allowed. We
recommend enabling Server Side Encryption for the S3 buckets in which you store the AMIs, although it’s
not required.
For information about how to set the appropriate security settings for your S3 buckets, review the
following security topics:
When the AMI snapshots are copied to the S3 object, the data is then copied over TLS connections. You
can store AMIs with encrypted snapshots, but the snapshots are decrypted as part of the store process.
The following example policy includes all of the actions that are required to allow an IAM principal to
carry out the store and restore tasks.
You can also create IAM policies that grant principals access to specific resources only. For more example
policies, see Access management for AWS resources in the IAM User Guide.
Note
If the snapshots that make up the AMI are encrypted, or if your account is enabled for
encryption by default, your IAM principal must have permission to use the KMS key. For more
information, see Permissions to use AWS KMS keys (p. 1643).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",
"s3:AbortMultipartUpload",
"ebs:CompleteSnapshot",
"ebs:GetSnapshotBlock",
"ebs:ListChangedBlocks",
"ebs:ListSnapshotBlocks",
"ebs:PutSnapshotBlock",
"ebs:StartSnapshot",
"ec2:CreateStoreImageTask",
"ec2:DescribeStoreImageTasks",
"ec2:CreateRestoreImageTask",
"ec2:GetEbsEncryptionByDefault",
"ec2:DescribeTags",
"ec2:CreateTags"
],
"Resource": "*"
}
]
}
169
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Store and restore an AMI
Use the create-store-image-task command. Specify the ID of the AMI and the name of the S3 bucket in
which to store the AMI.
Expected output
{
"ObjectKey": "ami-1234567890abcdef0.bin"
}
Expected output
{
"AmiId": "ami-1234567890abcdef0",
"Bucket": "myamibucket",
"ProgressPercentage": 17,
"S3ObjectKey": "ami-1234567890abcdef0.bin",
"StoreTaskState": "InProgress",
"StoreTaskFailureReason": null,
"TaskStartTime": "2021-01-01T01:01:01.001Z"
}
Use the create-restore-image-task command. Using the values for S3ObjectKey and Bucket from the
describe-store-image-tasks output, specify the object key of the AMI and the name of the S3
bucket to which the AMI was copied. Also specify a name for the restored AMI. The name must be unique
for AMIs in the Region for this account.
Note
The restored AMI gets a new AMI ID.
170
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
Expected output
{
"ImageId": "ami-0eab20fe36f83e1a8"
}
• When storing an AMI in S3, the file path can be added to the bucket name. Internally, the system
separates the path from the bucket name, and then adds the path to the object key that is generated
to store the AMI. The full object path is shown in the response from the API call.
• When restoring the AMI, because an object key parameter is available, the path can be added to the
beginning of the object key value.
You can use file paths when using the AWS CLI and SDKs.
Example: Use a file path when storing and restoring an AMI (AWS CLI)
The following example first stores an AMI in S3, with the file path appended to the bucket name. The
example then restores the AMI from S3, with the file path prepended to the object key parameter.
1. Store the AMI. For --bucket, specify the file path after the bucket name, as follows:
Expected output
{
"ObjectKey": "path1/path2/ami-1234567890abcdef0.bin"
}
2. Restore the AMI. For --object-key, specify the value from the output in the previous step, which
includes the file path.
Deprecate an AMI
You can deprecate an AMI to indicate that it is out of date and should not be used. You can also specify a
future deprecation date for an AMI, indicating when the AMI will be out of date. For example, you might
deprecate an AMI that is no longer actively maintained, or you might deprecate an AMI that has been
171
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
superseded by a newer version. By default, deprecated AMIs do not appear in AMI listings, preventing
new users from using out-of-date AMIs. However, existing users and launch services, such as launch
templates and Auto Scaling groups, can continue to use a deprecated AMI by specifying its ID. To delete
the AMI so that users and services cannot use it, you must deregister (p. 177) it.
• For AMI users, the deprecated AMI does not appear in DescribeImages API calls unless you specify
its ID or specify that deprecated AMIs must appear. AMI owners continue to see deprecated AMIs in
DescribeImages API calls.
• For AMI users, the deprecated AMI is not available to select via the EC2 console. For example, a
deprecated AMI does not appear in the AMI catalog in the launch instance wizard. AMI owners
continue to see deprecated AMIs in the EC2 console.
• For AMI users, if you know the ID of a deprecated AMI, you can continue to launch instances using the
deprecated AMI by using the API, CLI, or the SDKs.
• Launch services, such as launch templates and Auto Scaling groups, can continue to reference
deprecated AMIs.
• EC2 instances that were launched using an AMI that is subsequently deprecated are not affected, and
can be stopped, started, and rebooted.
You can also create Amazon Data Lifecycle Manager EBS-backed AMI policies to automate the
deprecation of EBS-backed AMIs. For more information, see Automate AMI lifecycles (p. 1686).
Note
By default, the deprecation date of all public AMIs is set to two years from the AMI creation
date. You can set the deprecation date to earlier than two years. To cancel the deprecation date,
or to move the deprecation to a later date, you must make the AMI private by only sharing it
with specific AWS accounts (p. 133).
Topics
• Costs (p. 172)
• Limitations (p. 168)
• Deprecate an AMI (p. 172)
• Describe deprecated AMIs (p. 174)
• Cancel the deprecation of an AMI (p. 176)
Costs
When you deprecate an AMI, the AMI is not deleted. The AMI owner continues to pay for the
AMI's snapshots. To stop paying for the snapshots, the AMI owner must delete the AMI by
deregistering (p. 177) it.
Limitations
• To deprecate an AMI, you must be the owner of the AMI.
Deprecate an AMI
You can deprecate an AMI on a specific date and time. You must be the AMI owner to perform this
procedure.
172
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
Console
The upper limit for the deprecation date is 10 years from now, except for public AMIs, where the
upper limit is 2 years from the creation date. You can’t specify a date in the past.
6. Choose Save.
AWS CLI
Use the enable-image-deprecation command. Specify the ID of the AMI and the date and time on
which to deprecate the AMI. If you specify a value for seconds, Amazon EC2 rounds the seconds to
the nearest minute.
The upper limit for deprecate-at is 10 years from now, except for public AMIs, where the upper
limit is 2 years from the creation date. You can’t specify a date in the past.
Expected output
{
"Return": "true"
}
• When an AMI is used to launch an instance, there is a 24-hour delay before that usage is
reported.
• lastLaunchedTime data is available starting April 2017.
Console
173
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
4. Select the AMI, and then check the Last launched time field (if you selected the check box next
to the AMI, it's located on the Details tab). The field shows the date and time when the AMI was
last used to launch an instance.
AWS CLI
Example output
{
"LastLaunchedTime": {
"Value": "2022-02-10T02:03:18Z"
},
"ImageId": "ami-1234567890example",
}
Console
AWS CLI
When you describe all AMIs using the describe-images command, the results are different depending
on whether you are an AMI user or the AMI owner.
174
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
By default, when you describe all AMIs using the describe-images command, deprecated AMIs that
are not owned by you, but which are shared with you, do not appear in the results. This is because
the default is --no-include-deprecated. To include deprecated AMIs in the results, you must
specify the --include-deprecated parameter.
• If you are the AMI owner:
When you describe all AMIs using the describe-images command, all the AMIs that you own,
including deprecated AMIs, appear in the results. You do not need to specify the --include-
deprecated parameter. Furthermore, you cannot exclude deprecated AMIs that you own from
the results by using --no-include-deprecated.
Use the describe-images command and specify the --include-deprecated parameter to include
all deprecated AMIs that are not owned by you in the results.
Note that if you specify --no-include-deprecated together with the AMI ID, the deprecated AMI
will be returned in the results.
Expected output
The DeprecationTime field displays the date on which the AMI is set to be deprecated. If the AMI
is not set to be deprecated, the DeprecationTime field does not appear in the output.
{
"Images": [
{
"VirtualizationType": "hvm",
"Description": "Provided by Red Hat, Inc.",
"PlatformDetails": "Red Hat Enterprise Linux",
"EnaSupport": true,
"Hypervisor": "xen",
"State": "available",
"SriovNetSupport": "simple",
"ImageId": "ami-1234567890EXAMPLE",
"DeprecationTime": "2021-05-10T13:17:12.000Z"
175
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deprecate an AMI
"UsageOperation": "RunInstances:0010",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"SnapshotId": "snap-111222333444aaabb",
"DeleteOnTermination": true,
"VolumeType": "gp2",
"VolumeSize": 10,
"Encrypted": false
}
}
],
"Architecture": "x86_64",
"ImageLocation": "123456789012/RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-
GP2",
"RootDeviceType": "ebs",
"OwnerId": "123456789012",
"RootDeviceName": "/dev/sda1",
"CreationDate": "2019-05-10T13:17:12.000Z",
"Public": true,
"ImageType": "machine",
"Name": "RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2"
}
]
}
Console
AWS CLI
Expected output
176
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deregister your AMI
"Return": "true"
}
When you deregister an AMI, it doesn't affect any instances that you've already launched from the AMI
or any snapshots created during the AMI creation process. You'll continue to incur usage costs for these
instances and storage costs for the snapshot. Therefore, you should terminate any instances and delete
any snapshots that you're finished with.
Contents
• Considerations (p. 177)
• Clean up your AMI (p. 177)
• Last launched time (p. 180)
Considerations
The following considerations apply to deregistering AMIs:
The following diagram illustrates the process for cleaning up your AMI.
177
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deregister your AMI
You can use one of the following methods to clean up your AMI.
178
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deregister your AMI
New console
If you are finished with an instance that you launched from the AMI, you can terminate it.
a. In the navigation pane, choose Instances, and then select the instance to terminate.
b. Choose Instance state, Terminate instance. When prompted for confirmation, choose
Terminate.
Old console
If you are finished with an instance that you launched from the AMI, you can terminate it.
a. In the navigation pane, choose Instances, and then select the instance to terminate.
179
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Deregister your AMI
b. Choose Actions, Instance State, Terminate. When prompted for confirmation, choose Yes,
Terminate.
AWS CLI
Delete snapshots that are no longer needed by using the delete-snapshot command:
If you are finished with an instance that you launched from the AMI, you can terminate it by
using the terminate-instances command:
PowerShell
Delete snapshots that are no longer needed by using the Remove-EC2Snapshot cmdlet:
If you are finished with an instance that you launched from the AMI, you can terminate it by
using the Remove-EC2Instance cmdlet:
180
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover AMIs from the Recycle Bin
Note
• When the AMI is used to launch an instance, there is a 24-hour delay before that usage is
reported.
• lastLaunchedTime data is available starting April 2017.
Console
AWS CLI
Example output
{
"LastLaunchedTime": {
"Value": "2022-02-10T02:03:18Z"
},
"ImageId": "ami-1234567890example",
}
You can restore a resource from the Recycle Bin at any time before its retention period expires. After you
restore a resource from the Recycle Bin, the resource is removed from the Recycle Bin and you can use
it in the same way that you use any other resource of that type in your account. If the retention period
expires and the resource is not restored, the resource is permanently deleted from the Recycle Bin and it
is no longer available for recovery.
Topics
181
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover AMIs from the Recycle Bin
• Permissions for working with AMIs in the Recycle Bin (p. 182)
• View AMIs in the Recycle Bin (p. 183)
• Restore AMIs from the Recycle Bin (p. 184)
To view and recover AMIs that are in the Recycle Bin, users must have the following permissions:
• ec2:ListImagesInRecycleBin
• ec2:RestoreImageFromRecycleBin
To manage tags for AMIs in the Recycle Bin, users need the following additional permissions.
• ec2:CreateTags
• ec2:DeleteTags
To use the Recycle Bin console, users need the ec2:DescribeTags permission.
The following is an example IAM policy. It includes the ec2:DescribeTags permission for console
users, and it includes the ec2:CreateTags and ec2:CreateTags permissions for managing tags. If the
permissions are not needed, you can remove them from the policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:ListImagesInRecycleBin",
"ec2:RestoreImageFromRecycleBin"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:DeleteTags",
"ec2:DescribeTags"
],
"Resource": "arn:aws:ec2:Region::image/*"
}
]
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
182
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover AMIs from the Recycle Bin
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
For more information about the permissions needed to use Recycle Bin, see Permissions for working with
Recycle Bin and retention rules (p. 1858).
You can view the AMIs in the Recycle Bin using one of the following methods.
AWS CLI
To view deleted AMIs in the Recycle Bin using the AWS CLI
Use the list-images-in-recycle-bin AWS CLI command. To view specific AMIs, include the --image-
id option and specify the IDs of the AMIs to view. You can specify up to 20 IDs in a single request.
To view all of the AMIs in the Recycle Bin, omit the --image-id option. If you do not specify a value
for --max-items, the command returns 1,000 items per page, by default. For more information,
see Pagination in the Amazon EC2 API Reference.
For example, the following command provides information about AMI ami-01234567890abcdef in
the Recycle Bin.
Example output:
{
"Images": [
183
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover AMIs from the Recycle Bin
{
"ImageId": "ami-0f740206c743d75df",
"Name": "My AL2 AMI",
"Description": "My Amazon Linux 2 AMI",
"RecycleBinEnterTime": "2021-11-26T21:04:50+00:00",
"RecycleBinExitTime": "2022-03-06T21:04:50+00:00"
}
]
}
Important
If you receive the following error, you might need to update your AWS CLI version. For more
information, see Command not found errors .
aws.exe: error: argument operation: Invalid choice, valid choices are: ...
You can restore an AMI from the Recycle Bin using one of the following methods.
AWS CLI
To restore a deleted AMI from the Recycle Bin using the AWS CLI
Use the restore-image-from-recycle-bin AWS CLI command. For --image-id, specify the ID of the
AMI to restore.
For example, the following command restores AMI ami-01234567890abcdef from the Recycle Bin.
aws.exe: error: argument operation: Invalid choice, valid choices are: ...
184
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automate the EBS-backed AMI lifecycle
EC2 instances with encrypted EBS volumes are launched from AMIs in the same way as other instances.
In addition, when you launch an instance from an AMI backed by unencrypted EBS snapshots, you can
encrypt some or all of the volumes during launch.
Like EBS volumes, snapshots in AMIs can be encrypted by either your default AWS KMS key, or to a
customer managed key that you specify. You must in all cases have permission to use the selected KMS
key.
AMIs with encrypted snapshots can be shared across AWS accounts. For more information, see Shared
AMIs (p. 121).
Instance-launching scenarios
Amazon EC2 instances are launched from AMIs using the RunInstances action with parameters
supplied through block device mapping, either by means of the AWS Management Console or directly
using the Amazon EC2 API or CLI. For more information about block device mapping, see Block device
mapping. For examples of controlling block device mapping from the AWS CLI, see Launch, List, and
Terminate EC2 Instances.
By default, without explicit encryption parameters, a RunInstances action maintains the existing
encryption state of an AMI's source snapshots while restoring EBS volumes from them. If Encryption by
default (p. 1735) is enabled, all volumes created from the AMI (whether from encrypted or unencrypted
snapshots) will be encrypted. If encryption by default is not enabled, then the instance maintains the
encryption state of the AMI.
You can also launch an instance and simultaneously apply a new encryption state to the resulting
volumes by supplying encryption parameters. Consequently, the following behaviors are observed:
185
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance-launching scenarios
The default behaviors can be overridden by supplying encryption parameters. The available parameters
are Encrypted and KmsKeyId. Setting only the Encrypted parameter results in the following:
• An unencrypted snapshot is restored to an EBS volume that is encrypted by your AWS account's
default KMS key.
• An encrypted snapshot that you own is restored to an EBS volume encrypted by the same KMS key. (In
other words, the Encrypted parameter has no effect.)
• An encrypted snapshot that you do not own (i.e., the AMI is shared with you) is restored to a volume
that is encrypted by your AWS account's default KMS key. (In other words, the Encrypted parameter
has no effect.)
Setting both the Encrypted and KmsKeyId parameters allows you to specify a non-default KMS key for
an encryption operation. The following behaviors result:
• An unencrypted snapshot is restored to an EBS volume encrypted by the specified KMS key.
• An encrypted snapshot is restored to an EBS volume encrypted not to the original KMS key, but
instead to the specified KMS key.
Submitting a KmsKeyId without also setting the Encrypted parameter results in an error.
The following sections provide examples of launching instances from AMIs using non-default encryption
parameters. In each of these scenarios, parameters supplied to the RunInstances action result in a
change of encryption state during restoration of a volume from a snapshot.
For information about using the console to launch an instance from an AMI, see Launch your
instance (p. 537).
The Encrypted parameter alone results in the volume for this instance being encrypted. Providing a
KmsKeyId parameter is optional. If no KMS key ID is specified, the AWS account's default KMS key is
186
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Image-copying scenarios
used to encrypt the volume. To encrypt the volume to a different KMS key that you own, supply the
KmsKeyId parameter.
If you own the AMI and supply no encryption parameters, the resulting instance has a volume encrypted
by the same KMS key as the snapshot. If the AMI is shared rather than owned by you, and you supply no
encryption parameters, the volume is encrypted by your default KMS key. With encryption parameters
supplied as shown, the volume is encrypted by the specified KMS key.
In this scenario, the RunInstances action is supplied with encryption parameters for each of the source
snapshots. When all possible encryption parameters are specified, the resulting instance is the same
regardless of whether you own the AMI.
Image-copying scenarios
Amazon EC2 AMIs are copied using the CopyImage action, either through the AWS Management Console
or directly using the Amazon EC2 API or CLI.
187
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Image-copying scenarios
By default, without explicit encryption parameters, a CopyImage action maintains the existing
encryption state of an AMI's source snapshots during copy. You can also copy an AMI and simultaneously
apply a new encryption state to its associated EBS snapshots by supplying encryption parameters.
Consequently, the following behaviors are observed:
All of these default behaviors can be overridden by supplying encryption parameters. The available
parameters are Encrypted and KmsKeyId. Setting only the Encrypted parameter results in the
following:
• An unencrypted snapshot is copied to a snapshot encrypted by the AWS account's default KMS key.
• An encrypted snapshot is copied to a snapshot encrypted by the same KMS key. (In other words, the
Encrypted parameter has no effect.)
• An encrypted snapshot that you do not own (i.e., the AMI is shared with you) is copied to a volume that
is encrypted by your AWS account's default KMS key. (In other words, the Encrypted parameter has
no effect.)
Setting both the Encrypted and KmsKeyId parameters allows you to specify a customer managed KMS
key for an encryption operation. The following behaviors result:
Submitting a KmsKeyId without also setting the Encrypted parameter results in an error.
The following section provides an example of copying an AMI using non-default encryption parameters,
resulting in a change of encryption state.
For detailed instructions using the console, see Copy an AMI (p. 158).
188
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor AMI events
Setting the Encrypted parameter encrypts the single snapshot for this instance. If you do not specify
the KmsKeyId parameter, the default customer managed key is used to encrypt the snapshot copy.
Note
You can also copy an image with multiple snapshots and configure the encryption state of each
individually.
Amazon EC2 generates an event when an AMI enters any of the following states:
• available
• failed
• deregistered
An AMI can enter the available or failed state when one of the following AMI operations runs:
• CreateImage
• CopyImage
• RegisterImage
• CreateRestoreImageTask
An AMI can enter the deregistered state when the following AMI operation runs:
• DeregisterImage
189
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI events
Topics
• AMI events (p. 190)
• Create Amazon EventBridge rules (p. 191)
AMI events
There are three EC2 AMI State Change events:
• available (p. 190)
• failed (p. 191)
• deregistered (p. 191)
The events are sent to the default EventBridge event bus in JSON format.
The following fields in the event can be used to create rules that trigger an action:
"source": "aws.ec2“
available
The following is an example of an event that Amazon EC2 generates when the AMI enters
the available state following a successful CreateImage, CopyImage, RegisterImage, or
CreateRestoreImageTask operation.
{
"version": "0",
"id": "example-9f07-51db-246b-d8b8441bcdf0",
"detail-type": "EC2 AMI State Change",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": ["arn:aws:ec2:us-east-1::image/ami-0123456789example"],
"detail": {
"RequestId": "example-9dcc-40a6-aa77-7ce457d5442b",
"ImageId": "ami-0123456789example",
"State": "available",
"ErrorMessage": ""
}
}
190
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create Amazon EventBridge rules
failed
The following is an example of an event that Amazon EC2 generates when the AMI enters the failed
state following a failed CreateImage, CopyImage, RegisterImage, or CreateRestoreImageTask operation.
{
"version": "0",
"id": "example-9f07-51db-246b-d8b8441bcdf0",
"detail-type": "EC2 AMI State Change",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": ["arn:aws:ec2:us-east-1::image/ami-0123456789example"],
"detail": {
"RequestId": "example-9dcc-40a6-aa77-7ce457d5442b",
"ImageId": "ami-0123456789example",
"State": "failed",
"ErrorMessage": "Description of failure"
}
}
deregistered
The following is an example of an event that Amazon EC2 generates when the AMI enters the
deregistered state following a successful DeregisterImage operation. If the operation fails, no event is
generated. Any failure is known immediately because DeregisterImage is a synchronous operation.
{
"version": "0",
"id": "example-9f07-51db-246b-d8b8441bcdf0",
"detail-type": "EC2 AMI State Change",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": ["arn:aws:ec2:us-east-1::image/ami-0123456789example"],
"detail": {
"RequestId": "example-9dcc-40a6-aa77-7ce457d5442b",
"ImageId": "ami-0123456789example",
"State": "deregistered",
"ErrorMessage": ""
}
}
191
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create Amazon EventBridge rules
Event patterns have the same structure as the events they match. An event pattern either matches an
event or it doesn't.
When creating a rule for an AMI state change event, you can include the following fields in the event
pattern:
"source": "aws.ec2“
Before creating the EventBridge rule, you must create the Amazon SNS topic for the email, text message,
or mobile push notification.
To create an EventBridge rule to send a notification when an AMI is created and in the
available state
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
{
"source": ["aws.ec2"],
"detail-type": ["EC2 AMI State Change"],
"detail": {"State": ["available"]}
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
192
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Understand AMI billing
For more information, see the following topics in the Amazon EventBridge User Guide:
For a tutorial on how to create a Lambda function and an EventBridge rule that runs the Lambda
function, see Tutorial: Log the state of an Amazon EC2 instance using EventBridge in the AWS Lambda
Developer Guide.
193
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI billing fields
Here are two examples of how researching your AMI in advance can help you choose the AMI that best
suits your needs:
• For Spot Instances, you can use the AMI Platform details to confirm that the AMI is supported for Spot
Instances.
• When purchasing a Reserved Instance, you can make sure that you select the operating system
platform (Platform) that maps to the AMI Platform details.
For more information about instance pricing, see Amazon EC2 pricing.
Contents
• AMI billing information fields (p. 194)
• Finding AMI billing and usage details (p. 195)
• Verify AMI charges on your bill (p. 197)
Platform details
The platform details associated with the billing code of the AMI. For example, Red Hat
Enterprise Linux.
Usage operation
The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. For
example, RunInstances:0010. Usage operation corresponds to the lineitem/Operation column on
your AWS Cost and Usage Report (CUR) and in the AWS Price List API.
You can view these fields on the Instances or AMIs page in the Amazon EC2 console, or in the response
that is returned by the describe-images or Get-EC2Image command.
Linux/UNIX RunInstances
194
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find AMI billing information
Windows RunInstances:0002
* If two software licenses are associated with an AMI, the Platform details field shows both.
** If you are running Spot Instances, the lineitem/Operation on your AWS Cost and Usage Report
might be different from the Usage operation value that is listed here. For example, if lineitem/
Operation displays RunInstances:0010:SV006, it means that Amazon EC2 is running Red Hat
Enterprise Linux Spot Instance-hour in US East (Virginia) in VPC Zone #6.
The following fields can help you verify AMI charges on your bill:
• Platform details
• Usage operation
• AMI ID
195
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find AMI billing information
If you know the instance ID, you can get the AMI ID for the instance by using the describe-instances
command.
..."Instances": [
{
"AmiLaunchIndex": 0,
"ImageId": "ami-0123456789EXAMPLE",
"InstanceId": "i-123456789abcde123",
...
}]
If you know the AMI ID, you can use the describe-images command to get the AMI platform and usage
operation details.
The following example output shows the PlatformDetails and UsageOperation fields. In this
example, the ami-0123456789EXAMPLE platform is Red Hat Enterprise Linux and the usage
operation and billing code is RunInstances:0010.
{
"Images": [
{
"VirtualizationType": "hvm",
"Description": "Provided by Red Hat, Inc.",
"Hypervisor": "xen",
"EnaSupport": true,
"SriovNetSupport": "simple",
"ImageId": "ami-0123456789EXAMPLE",
"State": "available",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"SnapshotId": "snap-111222333444aaabb",
"DeleteOnTermination": true,
"VolumeType": "gp2",
196
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Verify AMI charges on your bill
"VolumeSize": 10,
"Encrypted": false
}
}
],
"Architecture": "x86_64",
"ImageLocation": "123456789012/RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2",
"RootDeviceType": "ebs",
"OwnerId": "123456789012",
"PlatformDetails": "Red Hat Enterprise Linux",
"UsageOperation": "RunInstances:0010",
"RootDeviceName": "/dev/sda1",
"CreationDate": "2019-05-10T13:17:12.000Z",
"Public": true,
"ImageType": "machine",
"Name": "RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2"
}
]
}
To verify the billing information, find the instance ID in your CUR and check the corresponding value
in the lineitem/Operation column. That value should match the value for Usage operation that's
associated with the AMI.
For example, the AMI ami-0123456789EXAMPLE has the following billing information:
If you launched an instance using this AMI, you can find the instance ID in your CUR, and check the
corresponding value in the lineitem/Operation column. In this example, the value should be
RunInstances:0010.
AMI quotas
The following quotas apply to creating and sharing AMIs. The quotas apply per AWS Region.
197
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Request a quota increase for AMIs
If you exceed your quotas and you want to create or share more AMIs, you can do the following:
• If you exceed your total AMIs or public AMIs quota, consider deregistering unused images.
• If you exceed your public AMIs quota, consider making one or more public AMIs private.
• If you exceed your AMI sharing quota, consider sharing your AMIs with an organization or OU instead
of separate accounts.
• Request a quota increase for AMIs.
• AMIs
• Public AMIs
• AMI sharing
5. Choose Request quota increase.
6. For Change quota value, enter the new quota value, and then choose Request.
To view any pending or recently resolved requests, choose Dashboard from the navigation pane. For
pending requests, choose the status of the request to open the request receipt. The initial status of a
request is Pending. After the status changes to Quota requested, you'll see the case number under
Support Center case number. Choose the case number to open the ticket for your request.
After the request is resolved, the Applied quota value for the quota is set to the new value.
198
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows instances
Before you launch a production environment, you need to answer the following questions.
Amazon EC2 provides different instance types to enable you to choose the CPU, memory, storage,
and networking capacity that you need to run your applications. For more information, see Instance
types (p. 202).
Q. What purchasing option best meets my needs?
Amazon EC2 supports On-Demand Instances (the default), Spot Instances, and Reserved Instances.
For more information, see Instance purchasing options (p. 336).
Q. Can I remotely manage a fleet of EC2 instances and machines in my hybrid environment?
AWS Systems Manager enables you to remotely and securely manage the configuration of your
Amazon EC2 instances, and your on-premises instances and virtual machines (VMs) in hybrid
environments, including VMs from other cloud providers. For more information, see the AWS
Systems Manager User Guide.
Amazon publishes many AMIs that contain common software configurations for public use. In addition,
members of the AWS developer community have published their own custom AMIs. You can also
create your own custom AMIs. Doing so enables you to quickly and easily start new instances that
have everything you need. For example, if your application is a website or web service, your AMI could
include a web server, the associated static content, and the code for the dynamic pages. As a result, after
you launch an instance from this AMI, your web server starts, and your application is ready to accept
requests.
To improve launch time for Windows instances, you can optimize your AMI for faster launching, which
creates a set of pre-provisioned snapshots to launch instances up to 65% faster. To learn more, see
Configure your Windows AMI for faster launching (p. 36)
You can launch different types of instances from a single AMI. An instance type determines the
infrastructure that is used for your instance. Some instance types are intended for general purpose use,
199
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Differences between Windows
Server and Windows instances
while others support optimizations for specific uses such as high performance processors for computing,
enhanced memory for processing large data sets, and fast I/O for storage. Select an instance type that
delivers the performance and size that you need for the applications or software that you plan to run on
the instance. For more information, see Amazon EC2 Instance Types.
Your Windows instances keep running until you stop or terminate them, or until they fail. If an instance
fails, you can launch a new one from the AMI.
Your AWS account has a limit on the number of instances that you can have running. For more
information about this limit, and how to request an increase, see How many instances can I run in
Amazon EC2 in the Amazon EC2 General FAQ.
Before you begin launching Amazon EC2 Windows instances, you should be aware that the architecture
of applications running on cloud servers can differ significantly from the architecture for traditional
application models running on your hardware. Implementing applications on cloud servers requires a
shift in your design process.
The following table describes some key differences between Windows Server and an Amazon EC2
Windows instance.
Resources and capacity are physically limited. Resources and capacity are scalable.
You pay for the infrastructure, even if you don't You pay for the usage of the infrastructure. We
use it. stop charging you for the instance as soon as you
stop or terminate it.
Occupies physical space and must be maintained Doesn't occupy physical space and does not
on a regular basis. require regular maintenance.
Starts with push of the power button (known as Starts with the launch of the instance.
cold booting).
You can keep the server running until it is time to You can keep the server running, or stop and
shut it down, or put it in a sleep or hibernation restart it (during which the instance is moved to a
state (during which the server is powered down). new host computer).
When you shut down the server, all resources When you terminate the instance, its
remain intact and in the state they were in when infrastructure is no longer available to you. You
you switched it off. Information you stored on the can't connect to or restart an instance after you've
hard drives persists and can be accessed whenever terminated it. However, you can create an image
it's needed. You can restore the server to the from your instance while it's running, and launch
running state by powering it on. new instances from the image at any time.
A traditional server running Windows Server goes through the states shown in the following diagram.
200
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Design your applications to run on Windows instances
An Amazon EC2 Windows instance is similar to the traditional Windows Server, as you can see by
comparing the following diagram with the previous diagram for Windows Server. After you launch
an instance, it briefly goes into the pending state while registration takes place, then it goes into the
running state. The instance remains active until you stop or terminate it. You can't restart an instance
after you terminate it. You can create a backup image of your instance while it's running, and launch a
new instance from that backup image.
Applications built for Amazon EC2 use the underlying computing infrastructure on an as-needed basis.
They draw on necessary resources (such as storage and computing) on demand in order to perform a job,
and relinquish the resources when done. In addition, they often dispose of themselves after the job is
done. While in operation, the application scales up and down elastically based on resource requirements.
An application running on an Amazon EC2 instance can terminate and recreate the various components
at will in case of infrastructure failures.
201
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance types
When designing your Windows applications to run on Amazon EC2, you can plan for rapid deployment
and rapid reduction of compute and storage resources, based on your changing needs.
When you run an Amazon EC2 Windows instance, you don't need to provision the exact system package
of hardware, software, and storage, the way you do with Windows Server. Instead, you can focus on
using a variety of cloud resources to improve the scalability and overall performance of your Windows
application.
With Amazon EC2, designing for failure and outages is an integral and crucial part of the architecture.
As with any scalable and redundant system, architecture of your system should account for computing,
network, and storage failures. You have to build mechanisms in your applications that can handle
different kinds of failures. The key is to build a modular system with individual components that
are not tightly coupled, can interact asynchronously, and treat one another as black boxes that are
independently scalable. Thus, if one of your components fails or is busy, you can launch more instances
of that component without breaking your current system.
Another key element to designing for failure is to distribute your application geographically. Replicating
your application across geographically distributed Regions improves high availability in your system.
Amazon EC2 infrastructure is programmable and you can use scripts to automate the deployment
process, to install and configure software and applications, and to bootstrap your virtual servers.
You should implement security in every layer of your application architecture running on an Amazon
EC2 Windows instance. If you are concerned about storing sensitive and confidential data within your
Amazon EC2 environment, you should encrypt the data before uploading it.
Instance types
When you launch an instance, the instance type that you specify determines the hardware of the host
computer used for your instance. Each instance type offers different compute, memory, and storage
capabilities, and is grouped in an instance family based on these capabilities. Select an instance type
based on the requirements of the application or software that you plan to run on your instance.
Amazon EC2 dedicates some resources of the host computer, such as CPU, memory, and instance
storage, to a particular instance. Amazon EC2 shares other resources of the host computer, such as the
network and the disk subsystem, among instances. If each instance on a host computer tries to use
as much of one of these shared resources as possible, each receives an equal share of that resource.
However, when a resource is underused, an instance can consume a higher share of that resource while
it's available.
Each instance type provides higher or lower minimum performance from a shared resource. For example,
instance types with high I/O performance have a larger allocation of shared resources. Allocating a larger
share of shared resources also reduces the variance of I/O performance. For most applications, moderate
I/O performance is more than enough. However, for applications that require greater or more consistent
I/O performance, consider an instance type with higher I/O performance.
Contents
• Instance type naming convention (p. 203)
• Available instance types (p. 204)
• Hardware specifications (p. 209)
• Instances built on the Nitro System (p. 210)
• Networking and storage features (p. 211)
• Instance limits (p. 216)
202
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance type naming convention
Instance families
• C – Compute
• D – Dense storage
• F – FPGA
• G – GPU
• Hpc – High performance computing
• I – I/O
• Inf – AWS Inferentia
• M – Most scenarios
• P – GPU
• R – Random access memory
• T – Turbo
• Trn – AWS Tranium
• U – Ultra-high memory
• VT – Video transcoding
• X – Extra-large memory
Additional capabilities
• a – AMD processors
203
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance types
To determine which instance types meet your requirements, such as supported Regions, compute
resources, or storage resources, see Find an Amazon EC2 instance type (p. 327).
Topics
• Current generation instances (p. 204)
• Previous generation instances (p. 209)
• General purpose: M6a, M6g, M6gd, M6i, M6id, M6idn, M6in, M7g, T4g
• Compute optimized: C6a, C6g, C6gd, C6gn, C6i, C6id, C6in, C7g, Hpc6a
• Memory optimized: Hpc6id, R6a, R6g, R6gd, R6i, R6id, R6idn, R6in, R7g, X2gd, X2idn, X2iedn
• Storage optimized: I4i, Im4gn, Is4gen
• Accelerated computing: G5g, Trn1
Instances
• General purpose (p. 205)
• Compute optimized (p. 206)
• Memory optimized (p. 206)
• Storage optimized (p. 208)
• Accelerated computing (p. 208)
204
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance types
General purpose
Type Sizes
205
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance types
Compute optimized
Type Sizes
CC2 cc2.8xlarge
Memory optimized
Type Sizes
CR1 cr1.8xlarge
Hpc6id hpc6id.32xlarge
206
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance types
Type Sizes
U-3tb1 u-3tb1.56xlarge
U-18tb1 u-18tb1.metal
U-24tb1 u-24tb1.metal
X1 x1.16xlarge | x1.32xlarge
207
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance types
Type Sizes
Storage optimized
Type Sizes
HS1 hs1.8xlarge
Accelerated computing
Type Sizes
P3dn p3dn.24xlarge
208
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hardware specifications
Type Sizes
C1 c1.medium | c1.xlarge
G2 g2.2xlarge | g2.8xlarge
T1 t1.micro
Hardware specifications
For more information, see Amazon EC2 Instance Types.
To determine which instance type best meets your needs, we recommend that you launch an instance
and use your own benchmark application. Because you pay by the instance second, it's convenient and
inexpensive to test multiple instance types before making a decision. If your needs change, even after
you make a decision, you can change the instance type later. For more information, see Change the
instance type (p. 331).
Processor features
Intel processor features
Amazon EC2 instances that run on Intel processors may include the following features. Not all of the
following processor features are supported by all instance types. For detailed information about which
features are available for each instance type, see Amazon EC2 Instance Types.
• Intel AES New Instructions (AES-NI) — Intel AES-NI encryption instruction set improves upon the
original Advanced Encryption Standard (AES) algorithm to provide faster data protection and greater
security. All current generation EC2 instances support this processor feature.
• Intel Advanced Vector Extensions (Intel AVX, Intel AVX2, and Intel AVX-512) — Intel AVX and Intel
AVX2 are 256-bit, and Intel AVX-512 is a 512-bit instruction set extension designed for applications
that are Floating Point (FP) intensive. Intel AVX instructions improve performance for applications like
image and audio/video processing, scientific simulations, financial analytics, and 3D modeling and
analysis. These features are only available on instances launched with HVM AMIs.
• Intel Turbo Boost Technology — Intel Turbo Boost Technology processors automatically run cores
faster than the base operating frequency.
209
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instances built on the Nitro System
• Intel Deep Learning Boost (Intel DL Boost) — Accelerates AI deep learning use cases. The 2nd Gen
Intel Xeon Scalable processors extend Intel AVX-512 with a new Vector Neural Network Instruction
(VNNI/INT8) that significantly increases deep learning inference performance over previous generation
Intel Xeon Scalable processors (with FP32) for image recognition/segmentation, object detection,
speech recognition, language translation, recommendation systems, reinforcement learning, and more.
VNNI may not be compatible with all Linux distributions.
The following instances support VNNI: M5n, R5n, M5dn, M5zn, R5b, R5dn, D3, D3en, and C6i. C5 and
C5d instances support VNNI for only 12xlarge, 24xlarge, and metal instances.
Confusion may result from industry naming conventions for 64-bit CPUs. Chip manufacturer Advanced
Micro Devices (AMD) introduced the first commercially successful 64-bit architecture based on the Intel
x86 instruction set. Consequently, the architecture is widely referred to as AMD64 regardless of the
chip manufacturer. Windows and several Linux distributions follow this practice. This explains why the
internal system information on an instance running Ubuntu or Windows displays the CPU architecture as
AMD64 even though the instances are running on Intel hardware.
The Nitro System provides bare metal capabilities that eliminate virtualization overhead and support
workloads that require full access to host hardware. Bare metal instances are well suited for the
following:
• Workloads that require access to low-level hardware features (for example, Intel VT) that are not
available or fully supported in virtualized environments
• Applications that require a non-virtualized environment for licensing or support
Nitro components
• Nitro card
• Local NVMe storage volumes
• Networking hardware support
• Management
• Monitoring
• Security
• Nitro security chip, integrated into the motherboard
• Nitro hypervisor - A lightweight hypervisor that manages memory and CPU allocation and delivers
performance that is indistinguishable from bare metal for most workloads.
Virtualized instances
The following virtualized instances are built on the Nitro System:
• General purpose: M5, M5a, M5ad, M5d, M5dn, M5n, M5zn, M6a, M6i, M6id, M6idn, M6in, T3, and T3a
• Compute optimized: C5, C5a, C5ad, C5d, C5n, C6a, C6i, C6id, and C6in
• Memory optimized: Hpc6id, R5, R5a, R5ad, R5b, R5d, R5dn, R5n, R6a, R6i, R6idn, R6in, R6id, U-3tb1,
U-6tb1, U-9tb1, U-12tb1, X2idn, X2iedn, X2iezn, and z1d
210
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Networking and storage features
Learn more
Networking features
• IPv6 is supported on all current generation instance types and the C3, R3, and I2 previous generation
instance types.
• To maximize the networking and bandwidth performance of your instance type, you can do the
following:
• Launch supported instance types into a cluster placement group to optimize your instances for
high performance computing (HPC) applications. Instances in a common cluster placement group
can benefit from high-bandwidth, low-latency networking. For more information, see Placement
groups (p. 1302).
• Enable enhanced networking for supported current generation instance types to get significantly
higher packet per second (PPS) performance, lower network jitter, and lower latencies. For more
information, see Enhanced networking on Windows (p. 1278).
• Current generation instance types that are enabled for enhanced networking have the following
networking performance attributes:
• Traffic within the same Region over private IPv4 or IPv6 can support 5 Gbps for single-flow traffic
and up to 25 Gbps for multi-flow traffic (depending on the instance type).
211
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Networking and storage features
• Traffic to and from Amazon S3 buckets within the same Region over the public IP address space or
through a VPC endpoint can use all available instance aggregate bandwidth.
• The maximum transmission unit (MTU) supported varies across instance types. All Amazon EC2
instance types support standard Ethernet V2 1500 MTU frames. All current generation instances
support 9001 MTU, or jumbo frames, and some previous generation instances support them as well.
For more information, see Network maximum transmission unit (MTU) for your EC2 instance (p. 1319).
Storage features
• Some instance types support EBS volumes and instance store volumes, while other instance types
support only EBS volumes. Some instance types that support instance store volumes use solid state
drives (SSD) to deliver very high random I/O performance. Some instance types support NVMe
instance store volumes. Some instance types support NVMe EBS volumes. For more information, see
Amazon EBS and NVMe on Windows instances (p. 1750) and NVMe SSD volumes (p. 1821).
• To obtain additional, dedicated capacity for Amazon EBS I/O, you can launch some instance types as
EBS–optimized instances. Some instance types are EBS–optimized by default. For more information,
see Amazon EBS–optimized instances (p. 1752).
Instances
• General purpose (p. 212)
• Compute optimized (p. 213)
• Memory optimized (p. 213)
• Storage optimized (p. 214)
• Accelerated computing (p. 215)
• Previous generation instance types (p. 215)
General purpose
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
212
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Networking and storage features
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
Compute optimized
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
Memory optimized
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
213
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Networking and storage features
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
Storage optimized
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
214
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Networking and storage features
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
Accelerated computing
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
Instance type EBS only NVME EBS Instance store Placement Enhanced
group networking
215
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance limits
Instance limits
There is a limit on the total number of instances that you can launch in a Region, and there are additional
limits on some instance types.
For more information about the default limits, see How many instances can I run in Amazon EC2?
For more information about viewing your current limits or requesting an increase in your current limits,
see Amazon EC2 service quotas (p. 1909).
Bare metal instances, such as m5.metal, m5n.metal, and m5zn.metal provide your applications with
direct access to physical resources of the host server, such as processors and memory.
M5zn
These instances are ideal for applications that benefit from extremely high single-thread performance,
high throughput, and low latency networking. They are well-suited for the following:
• Gaming
• High performance computing
• Simulation modeling
Bare metal instances such as m6i.metal provide your applications with direct access to physical
resources of the host server, such as processors and memory.
216
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
These instances are well suited for network-intensive workloads such as the following:
These instances provide a baseline level of CPU performance with the ability to burst to a higher level
when required by your workload. An Unlimited instance can sustain high CPU performance for any
period of time whenever required. For more information, see Burstable performance instances (p. 234).
They are well-suited for the following:
For more information, see Amazon EC2 T2 Instances and Amazon EC2 T3 Instances.
Contents
• Hardware specifications (p. 217)
• Instance performance (p. 223)
• Network performance (p. 223)
• Amazon EBS I/O performance (p. 231)
• SSD-based instance store volume I/O performance (p. 231)
• Release notes (p. 233)
• Burstable performance instances (p. 234)
Hardware specifications
The following is a summary of the hardware specifications for general purpose instances. A virtual
central processing unit (vCPU) represents a portion of the physical CPU assigned to a virtual machine
(VM). For x86 instances, there are two vCPUs per core. For Graviton instances, there is one vCPU per core.
m1.small 1 1.70
m1.medium 1 3.70
m1.large 2 7.50
m1.xlarge 4 15.00
217
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
m2.xlarge 2 17.10
m2.2xlarge 4 34.20
m2.4xlarge 8 68.40
m3.medium 1 3.75
m3.large 2 7.50
m3.xlarge 4 15.00
m3.2xlarge 8 30.00
m4.large 2 8.00
m4.xlarge 4 16.00
m4.2xlarge 8 32.00
m4.4xlarge 16 64.00
m4.10xlarge 40 160.00
m4.16xlarge 64 256.00
m5.large 2 8.00
m5.xlarge 4 16.00
m5.2xlarge 8 32.00
m5.4xlarge 16 64.00
m5.8xlarge 32 128.00
m5.12xlarge 48 192.00
m5.16xlarge 64 256.00
m5.24xlarge 96 384.00
m5.metal 96 384.00
m5a.large 2 8.00
m5a.xlarge 4 16.00
m5a.2xlarge 8 32.00
m5a.4xlarge 16 64.00
m5a.8xlarge 32 128.00
m5a.12xlarge 48 192.00
m5a.16xlarge 64 256.00
m5a.24xlarge 96 384.00
m5ad.large 2 8.00
218
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
m5ad.xlarge 4 16.00
m5ad.2xlarge 8 32.00
m5ad.4xlarge 16 64.00
m5ad.8xlarge 32 128.00
m5ad.12xlarge 48 192.00
m5ad.16xlarge 64 256.00
m5ad.24xlarge 96 384.00
m5d.large 2 8.00
m5d.xlarge 4 16.00
m5d.2xlarge 8 32.00
m5d.4xlarge 16 64.00
m5d.8xlarge 32 128.00
m5d.12xlarge 48 192.00
m5d.16xlarge 64 256.00
m5d.24xlarge 96 384.00
m5d.metal 96 384.00
m5dn.large 2 8.00
m5dn.xlarge 4 16.00
m5dn.2xlarge 8 32.00
m5dn.4xlarge 16 64.00
m5dn.8xlarge 32 128.00
m5dn.12xlarge 48 192.00
m5dn.16xlarge 64 256.00
m5dn.24xlarge 96 384.00
m5dn.metal 96 384.00
m5n.large 2 8.00
m5n.xlarge 4 16.00
m5n.2xlarge 8 32.00
m5n.4xlarge 16 64.00
m5n.8xlarge 32 128.00
m5n.12xlarge 48 192.00
219
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
m5n.16xlarge 64 256.00
m5n.24xlarge 96 384.00
m5n.metal 96 384.00
m5zn.large 2 8.00
m5zn.xlarge 4 16.00
m5zn.2xlarge 8 32.00
m5zn.3xlarge 12 48.00
m5zn.6xlarge 24 96.00
m5zn.12xlarge 48 192.00
m5zn.metal 48 192.00
m6a.large 2 8.00
m6a.xlarge 4 16.00
m6a.2xlarge 8 32.00
m6a.4xlarge 16 64.00
m6a.8xlarge 32 128.00
m6a.12xlarge 48 192.00
m6a.16xlarge 64 256.00
m6a.24xlarge 96 384.00
m6i.large 2 8.00
m6i.xlarge 4 16.00
m6i.2xlarge 8 32.00
m6i.4xlarge 16 64.00
m6i.8xlarge 32 128.00
m6i.12xlarge 48 192.00
m6i.16xlarge 64 256.00
m6i.24xlarge 96 384.00
220
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
m6id.large 2 8.00
m6id.xlarge 4 16.00
m6id.2xlarge 8 32.00
m6id.4xlarge 16 64.00
m6id.8xlarge 32 128.00
m6id.12xlarge 48 192.00
m6id.16xlarge 64 256.00
m6id.24xlarge 96 384.00
m6idn.large 2 8.00
m6idn.xlarge 4 16.00
m6idn.2xlarge 8 32.00
m6idn.4xlarge 16 64.00
m6idn.8xlarge 32 128.00
m6idn.12xlarge 48 192.00
m6idn.16xlarge 64 256.00
m6idn.24xlarge 96 384.00
m6in.large 2 8.00
m6in.xlarge 4 16.00
m6in.2xlarge 8 32.00
m6in.4xlarge 16 64.00
m6in.8xlarge 32 128.00
m6in.12xlarge 48 192.00
m6in.16xlarge 64 256.00
m6in.24xlarge 96 384.00
t1.micro 1 0.61
221
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
t2.nano 1 0.50
t2.micro 1 1.00
t2.small 1 2.00
t2.medium 2 4.00
t2.large 2 8.00
t2.xlarge 4 16.00
t2.2xlarge 8 32.00
t3.nano 2 0.50
t3.micro 2 1.00
t3.small 2 2.00
t3.medium 2 4.00
t3.large 2 8.00
t3.xlarge 4 16.00
t3.2xlarge 8 32.00
t3a.nano 2 0.50
t3a.micro 2 1.00
t3a.small 2 2.00
t3a.medium 2 4.00
t3a.large 2 8.00
t3a.xlarge 4 16.00
t3a.2xlarge 8 32.00
AMD processors
• AMD EPYC 7000 series processors (AMD EPYC 7571): M5a, M5ad, T3a
• 3rd generation AMD EPYC processors (AMD EPYC 7R13): M6a
Intel processors
• Intel Xeon Scalable processors (Haswell E5-2676 v3 or Broadwell E5-2686 v4): M4, T2
• Intel Xeon Scalable processors (Skylake 8175M or Cascade Lake 8259CL): M5, M5d, T3
• 2nd generation Intel Xeon Scalable processors (Cascade Lake 8259CL): M5n
• 2nd generation Intel Xeon Scalable processors (Cascade Lake 8252C): M5zn
• 3rd generation Intel Xeon Scalable processors (Ice Lake 8375C): M6i, M6id
222
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Instance performance
EBS-optimized instances enable you to get consistently high performance for your EBS volumes by
eliminating contention between Amazon EBS I/O and other network traffic from your instance. Some
general purpose instances are EBS-optimized by default at no additional cost. For more information, see
Amazon EBS–optimized instances (p. 1752).
Network performance
You can enable enhanced networking on supported instance types to provide lower latencies, lower
network jitter, and higher packet-per-second (PPS) performance. Most applications do not consistently
need a high level of network performance, but can benefit from access to increased bandwidth when
they send or receive data. For more information, see Enhanced networking on Windows (p. 1278).
The following is a summary of network performance for general purpose instances that support
enhanced networking.
Note
Instance types indicated with a † have a baseline bandwidth and can use a network I/O
credit mechanism to burst beyond their baseline bandwidth on a best effort basis. For more
information, see instance network bandwidth (p. 1276).
223
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
224
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
225
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
226
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
227
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
For 32xlarge and metal instance types that support 200 Gbps, at least 2 ENIs, each attached to a
different network card, are required on the instance to achieve 200 Gbps throughput. Each ENI attached
to a network card can achieve a max of 170 Gbps.
The following table shows the baseline and burst bandwidth for instance types that use the network I/O
credit mechanism to burst beyond their baseline bandwidth.
228
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
229
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
230
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
231
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
232
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
As you fill the SSD-based instance store volumes for your instance, the number of write IOPS that
you can achieve decreases. This is due to the extra work the SSD controller must do to find available
space, rewrite existing data, and erase unused space so that it can be rewritten. This process of
garbage collection results in internal write amplification to the SSD, expressed as the ratio of SSD write
operations to user write operations. This decrease in performance is even larger if the write operations
are not in multiples of 4,096 bytes or not aligned to a 4,096-byte boundary. If you write a smaller
amount of bytes or bytes that are not aligned, the SSD controller must read the surrounding data and
store the result in a new location. This pattern results in significantly increased write amplification,
increased latency, and dramatically reduced I/O performance.
SSD controllers can use several strategies to reduce the impact of write amplification. One such strategy
is to reserve space in the SSD instance storage so that the controller can more efficiently manage the
space available for write operations. This is called over-provisioning. The SSD-based instance store
volumes provided to an instance don't have any space reserved for over-provisioning. To reduce write
amplification, we recommend that you leave 10% of the volume unpartitioned so that the SSD controller
can use it for over-provisioning. This decreases the storage that you can use, but increases performance
even if the disk is close to full capacity.
For instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller whenever you no longer need data that you've written. This provides the controller with more
free space, which can reduce write amplification and increase performance. For more information, see
Instance store volume TRIM support (p. 1822).
Release notes
• Instances built on the Nitro System (p. 210), M4, t2.large and larger, t3.large and larger, and
t3a.large and larger instance types require 64-bit HVM AMIs. They have high-memory, and require
a 64-bit operating system to take advantage of that capacity. HVM AMIs provide superior performance
in comparison to paravirtual (PV) AMIs on high-memory instance types. In addition, you must use an
HVM AMI to take advantage of enhanced networking.
• Instances built on the Nitro System (p. 210) have the following requirements:
• NVMe drivers (p. 1750) must be installed
• Elastic Network Adapter (ENA) drivers (p. 1279) must be installed
The current AWS Windows AMIs (p. 34) meet these requirements.
• To get the best performance from your M6i instances, ensure that they have ENA driver version 2.2.3
or later. Using an ENA driver earlier than version 2.0.0 with these instances causes network interface
attachment failures. The following AMIs have a compatible ENA driver.
• AWS Windows AMI from May 2021 or later
• Instances built on the Nitro System support a maximum of 28 attachments, including network
interfaces, EBS volumes, and NVMe instance store volumes. For more information, see Nitro System
volume limits (p. 1828).
• Launching a bare metal instance boots the underlying server, which includes verifying all hardware and
firmware components. This means that it can take 20 minutes from the time the instance enters the
running state until it becomes available over the network.
• To attach or detach EBS volumes or secondary network interfaces from a bare metal instance requires
PCIe native hotplug support.
233
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
• Bare metal instances use a PCI-based serial device rather than an I/O port-based serial device. The
upstream Linux kernel and the latest Amazon Linux AMIs support this device. Bare metal instances also
provide an ACPI SPCR table to enable the system to automatically use the PCI-based serial device. The
latest Windows AMIs automatically use the PCI-based serial device.
• There is a limit on the total number of instances that you can launch in a Region, and there are
additional limits on some instance types. For more information, see How many instances can I run in
Amazon EC2? in the Amazon EC2 FAQ.
These low-to-moderate CPU utilization workloads lead to wastage of CPU cycles and, as a result, you
pay for more than you use. To overcome this, you can leverage the low-cost burstable general purpose
instances, which are the T instances.
The T instance family provides a baseline CPU performance with the ability to burst above the baseline
at any time for as long as required. The baseline CPU is defined to meet the needs of the majority
of general purpose workloads, including large-scale micro-services, web servers, small and medium
databases, data logging, code repositories, virtual desktops, development and test environments,
and business-critical applications. The T instances offer a balance of compute, memory, and network
resources, and provide you with the most cost-effective way to run a broad spectrum of general purpose
applications that have a low-to-moderate CPU usage. They can save you up to 15% in costs when
compared to M instances, and can lead to even more cost savings with smaller, more economical instance
sizes, offering as low as 2 vCPUs and 0.5 GiB of memory. The smaller T instance sizes, such as nano,
micro, small, and medium, are well suited for workloads that need a small amount of memory and do
not expect high CPU usage.
Note
This topic describes burstable CPU. For information about burstable network performance, see
Amazon EC2 instance network bandwidth (p. 1276).
234
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The T4g instance types are the latest generation of burstable instances. They provide the best price for
performance, and provide you with the lowest cost of all the EC2 instance types. The T4g instance types
are powered by Arm-based AWS Graviton2 processors with extensive ecosystem support from operating
systems vendors, independent software vendors, and popular AWS services and applications.
The following table summarizes the key differences between the burstable instance types.
Latest generation
T4g Lowest cost EC2 instance type AWS Graviton2 processors with
with up to 40% higher price/ Arm Neoverse N1 cores
performance and 20% lower
costs vs T3
T3a Lowest cost x86-based instances AMD 1st gen EPYC processors
with 10% lower costs vs T3
instances
Previous generation
For information about instance pricing and additional specifications, see Amazon EC2 Pricing and
Amazon EC2 Instance Types. For information about burstable network performance, see Amazon EC2
instance network bandwidth (p. 1276).
If your account is less than 12 months old, you can use a t2.micro instance for free (or a t3.micro
instance in Regions where t2.micro is unavailable) within certain usage limits. For more information,
see AWS Free Tier.
• On-Demand Instances
• Reserved Instances
• Dedicated Instances (T3 only)
• Dedicated Hosts (T3 only, in standard mode only)
• Spot Instances
Contents
• Best practices (p. 236)
235
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
• Key concepts and definitions for burstable performance instances (p. 236)
• Unlimited mode for burstable performance instances (p. 242)
• Standard mode for burstable performance instances (p. 249)
• Work with burstable performance instances (p. 259)
• Monitor your CPU credits for burstable performance instances (p. 264)
Best practices
Follow these best practices to get the maximum benefit from burstable performance instances.
• Ensure that the instance size you choose passes the minimum memory requirements of your operating
system and applications. Operating systems with graphical user interfaces that consume significant
memory and CPU resources (for example, Windows) might require a t3.micro or larger instance size
for many use cases. As the memory and CPU requirements of your workload grow over time, you have
the flexibility with the T instances to scale to larger instance sizes of the same instance type, or to
select another instance type.
• Enable AWS Compute Optimizer for your account and review the Compute Optimizer
recommendations for your workload. Compute Optimizer can help assess whether instances should
be upsized to improve performance or downsized for cost savings. Compute Optimizer may also
recommend a different instance type based on your scenario. For more information, see Viewing EC2
instance recommendations in the AWS Compute Optimizer User Guide.
• For additional requirements, see Release notes (p. 233).
Each burstable performance instance continuously earns credits when it stays below the CPU baseline,
and continuously spends credits when it bursts above the baseline. The amount of credits earned or
spent depends on the CPU utilization of the instance:
• If the CPU utilization is below baseline, then credits earned are greater than credits spent.
• If the CPU utilization is equal to baseline, then credits earned are equal to credits spent.
• If the CPU utilization is higher than baseline, then credits spent are higher than credits earned.
When the credits earned are greater than credits spent, then the difference is called accrued credits,
which can be used later to burst above baseline CPU utilization. Similarly, when the credits spent are
more than credits earned, then the instance behavior depends on the credit configuration mode—
Standard mode or Unlimited mode.
In Standard mode, when credits spent are more than credits earned, the instance uses the accrued credits
to burst above baseline CPU utilization. If there are no accrued credits remaining, then the instance
gradually comes down to baseline CPU utilization and cannot burst above baseline until it accrues more
credits.
In Unlimited mode, if the instance bursts above baseline CPU utilization, then the instance first uses
the accrued credits to burst. If there are no accrued credits remaining, then the instance spends surplus
credits to burst. When its CPU utilization falls below the baseline, it uses the CPU credits that it earns
to pay down the surplus credits that it spent earlier. The ability to earn CPU credits to pay down surplus
credits enables Amazon EC2 to average the CPU utilization of an instance over a 24-hour period. If the
236
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
average CPU usage over a 24-hour period exceeds the baseline, the instance is billed for the additional
usage at a flat additional rate per vCPU-hour.
Contents
• Key concepts and definitions (p. 237)
• Earn CPU credits (p. 239)
• CPU credit earn rate (p. 240)
• CPU credit accrual limit (p. 241)
• Accrued CPU credits life span (p. 241)
• Baseline utilization (p. 241)
CPU utilization
CPU utilization is the percentage of allocated EC2 compute units that are currently in use on the
instance. This metric measures the percentage of allocated CPU cycles that are being utilized on an
instance. The CPU Utilization CloudWatch metric shows CPU usage per instance and not CPU usage
per core. The baseline CPU specification of an instance is also based on the CPU usage per instance.
To measure CPU utilization using the AWS Management Console or the AWS CLI, see Get statistics
for a specific instance (p. 1153).
CPU credit
A unit of vCPU-time.
Examples:
The baseline utilization is the level at which the CPU can be utilized for a net credit balance of zero,
when the number of CPU credits being earned matches the number of CPU credits being used.
Baseline utilization is also known as the baseline. Baseline utilization is expressed as a percentage of
vCPU utilization, which is calculated as follows: Baseline utilization % = (number of credits earned/
number of vCPUs)/60 minutes.
For the baseline utilization of each burstable performance instance type, see the credit
table (p. 239).
Earned credits
Number of credits earned per hour = % baseline utilization * number of vCPUs * 60 minutes
Example:
A t3.nano with 2 vCPUs and a baseline utilization of 5% earns 6 credits per hour, calculated as
follows:
237
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
CPU credits spent per minute = Number of vCPUs * CPU utilization * 1 minute
Accrued credits
Unspent CPU credits when an instance uses fewer credits than is required for baseline utilization. In
other words, accrued credits = (Earned credits – Used credits) below baseline.
Example:
If a t3.nano is running at 2% CPU utilization, which is below its baseline of 5% for an hour, the
accrued credits is calculated as follows:
Accrued CPU credits = (Earned credits per hour – Used credits per hour) = 6 – 2 vCPUs * 2% CPU
utilization * 60 minutes = 6 – 2.4 = 3.6 accrued credits per hour
Credit accrual limit
Depends on the instance size but in general is equal to the number of maximum credits earned in 24
hours.
Example:
Only applicable for T2 instances configured for Standard mode. Launch credits are a limited number
of CPU credits that are allocated to a new T2 instance so that, when launched in Standard mode, it
can burst above the baseline.
Surplus credits
Credits that are spent by an instance after it depletes its accrued credit balance. The surplus credits
are designed for burstable instances to sustain high performance for an extended period of time,
and are only used in Unlimited mode. The surplus credits balance is used to determine how many
credits were used by the instance for bursting in Unlimited mode.
Standard mode
Credit configuration mode, which allows an instance to burst above the baseline by spending credits
it has accrued in its credit balance.
Unlimited mode
Credit configuration mode, which allows an instance to burst above the baseline by sustaining high
CPU utilization for any period of time whenever required. The hourly instance price automatically
covers all CPU usage spikes if the average CPU utilization of the instance is at or below the baseline
over a rolling 24-hour period or the instance lifetime, whichever is shorter. If the instance runs at
higher CPU utilization for a prolonged period, it can do so for a flat additional rate per vCPU-hour.
The following table summarizes the key credit differences between the burstable instance types.
Latest generation
238
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Previous generation
Note
Unlimited mode is not supported for T3 instances that are launched on a Dedicated Host.
If a burstable performance instance uses fewer CPU resources than is required for baseline utilization
(such as when it is idle), the unspent CPU credits are accrued in the CPU credit balance. If a burstable
performance instance needs to burst above the baseline utilization level, it spends the accrued credits.
The more credits that a burstable performance instance has accrued, the more time it can burst beyond
its baseline when more CPU utilization is needed.
The following table lists the burstable performance instance types, the rate at which CPU credits are
earned per hour, the maximum number of earned CPU credits that an instance can accrue, the number of
vCPUs per instance, and the baseline utilization as a percentage of a full core (using a single vCPU).
T2
t2.nano 3 72 1 5%
239
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
T3
T3a
* The number of credits that can be accrued is equivalent to the number of credits that can be earned
in a 24-hour period.
** The percentage baseline utilization in the table is per vCPU. In CloudWatch, CPU utilization is shown
per vCPU. For example, the CPU utilization for a t3.large instance operating at the baseline level
is shown as 30% in CloudWatch CPU metrics. For information about how to calculate the baseline
utilization, see Baseline utilization (p. 241).
*** Each vCPU is a thread of either an Intel Xeon core or an AMD EPYC core, except for T2 instances.
The number of CPU credits earned per hour is determined by the instance size. For example, a t3.nano
earns six credits per hour, while a t3.small earns 24 credits per hour. The preceding table lists the
credit earn rate for all instances.
240
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The CPU credit balance limit differs for each instance size. For example, a t3.micro instance can accrue
a maximum of 288 earned CPU credits in the CPU credit balance. The preceding table lists the maximum
number of earned credits that each instance can accrue.
T2 Standard instances also earn launch credits. Launch credits do not count towards the CPU credit
balance limit. If a T2 instance has not spent its launch credits, and remains idle over a 24-hour period
while accruing earned credits, its CPU credit balance appears as over the limit. For more information, see
Launch credits (p. 250).
T3a and T3 instances do not earn launch credits. These instances launch as unlimited by default, and
therefore can burst immediately upon start without any launch credits. T3 instances launched on a
Dedicated Host launch as standard by default; unlimited mode is not supported for T3 instances on a
Dedicated Host.
For T2, the CPU credit balance does not persist between instance stops and starts. If you stop a T2
instance, the instance loses all its accrued credits.
For T3a and T3, the CPU credit balance persists for seven days after an instance stops and the credits are
lost thereafter. If you start the instance within seven days, no credits are lost.
For more information, see CPUCreditBalance in the CloudWatch metrics table (p. 265).
Baseline utilization
The baseline utilization is the level at which the CPU can be utilized for a net credit balance of zero,
when the number of CPU credits being earned matches the number of CPU credits being used. Baseline
utilization is also known as the baseline.
241
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
For example, a t3.nano instance, with 2 vCPUs, earns 6 credits per hour, resulting in a baseline
utilization of 5% , which is calculated as follows:
A t3.xlarge instance, with 4 vCPUs, earns 96 credits per hour, resulting in a baseline utilization of 40%
((96/4)/60).
The following graph provides an example of a t3.large with an average CPU utilization below the
baseline.
For the vast majority of general-purpose workloads, instances configured as unlimited provide
ample performance without any additional charges. If the instance runs at higher CPU utilization for a
prolonged period, it can do so for a flat additional rate per vCPU-hour. For information about pricing, see
Amazon EC2 pricing and T2/T3/T4 Unlimited Mode Pricing.
If you use a t2.micro or t3.micro instance under the AWS Free Tier offer and use it in unlimited
mode, charges might apply if your average utilization over a rolling 24-hour period exceeds the baseline
utilization (p. 241) of the instance.
T3a and T3 instances launch as unlimited by default (unless you change the default (p. 263)).
If the average CPU usage over a 24-hour period exceeds the baseline, you incur charges for surplus
credits. If you launch Spot Instances as unlimited and plan to use them immediately and for a
short duration, with no idle time for accruing CPU credits, you incur charges for surplus credits. We
recommend that you launch your Spot Instances in standard (p. 249) mode to avoid paying higher
costs. For more information, see Surplus credits can incur charges (p. 245) and Burstable performance
instances (p. 446).
242
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Note
T3 instances launched on a Dedicated Host launch as standard by default; unlimited mode is
not supported for T3 instances on a Dedicated Host.
Contents
• Unlimited mode concepts (p. 243)
• How Unlimited burstable performance instances work (p. 243)
• When to use unlimited mode versus fixed CPU (p. 244)
• Surplus credits can incur charges (p. 245)
• No launch credits for T2 Unlimited instances (p. 246)
• Enable unlimited mode (p. 246)
• What happens to credits when switching between Unlimited and Standard (p. 246)
• Monitor credit usage (p. 246)
• Unlimited mode examples (p. 247)
• Example 1: Explain credit use with T3 Unlimited (p. 247)
• Example 2: Explain credit use with T2 Unlimited (p. 248)
The unlimited mode is a credit configuration option for burstable performance instances. It can be
enabled or disabled at any time for a running or stopped instance. You can set unlimited as the default
credit option (p. 263) at the account level per AWS Region, per burstable performance instance family,
so that all new burstable performance instances in the account launch using the default credit option.
If a burstable performance instance configured as unlimited depletes its CPU credit balance, it can
spend surplus credits to burst beyond the baseline (p. 241). When its CPU utilization falls below
the baseline, it uses the CPU credits that it earns to pay down the surplus credits that it spent earlier.
The ability to earn CPU credits to pay down surplus credits enables Amazon EC2 to average the CPU
utilization of an instance over a 24-hour period. If the average CPU usage over a 24-hour period exceeds
the baseline, the instance is billed for the additional usage at a flat additional rate per vCPU-hour.
The following graph shows the CPU usage of a t3.large. The baseline CPU utilization for a t3.large
is 30%. If the instance runs at 30% CPU utilization or less on average over a 24-hour period, there is
no additional charge because the cost is already covered by the instance hourly price. However, if the
instance runs at 40% CPU utilization on average over a 24-hour period, as shown in the graph, the
instance is billed for the additional 10% CPU usage at a flat additional rate per vCPU-hour.
243
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
For more information about the baseline utilization per vCPU for each instance type and how many
credits each instance type earns, see the credit table (p. 239).
When determining whether you should use a burstable performance instance in unlimited mode,
such as T3, or a fixed performance instance, such as M5, you need to determine the breakeven CPU
usage. The breakeven CPU usage for a burstable performance instance is the point at which a burstable
performance instance costs the same as a fixed performance instance. The breakeven CPU usage helps
you determine the following:
• If the average CPU usage over a 24-hour period is at or below the breakeven CPU usage, use a
burstable performance instance in unlimited mode so that you can benefit from the lower price of a
burstable performance instance while getting the same performance as a fixed performance instance.
• If the average CPU usage over a 24-hour period is above the breakeven CPU usage, the burstable
performance instance will cost more than the equivalently-sized fixed performance instance. If a T3
instance continuously bursts at 100% CPU, you end up paying approximately 1.5 times the price of an
equivalently-sized M5 instance.
The following graph shows the breakeven CPU usage point where a t3.large costs the same as an
m5.large. The breakeven CPU usage point for a t3.large is 42.5%. If the average CPU usage is at
42.5%, the cost of running the t3.large is the same as an m5.large, and is more expensive if the
average CPU usage is above 42.5%. If the workload needs less than 42.5% average CPU usage, you can
benefit from the lower price of the t3.large while getting the same performance as an m5.large.
The following table shows how to calculate the breakeven CPU usage threshold so that you can
determine when it's less expensive to use a burstable performance instance in unlimited mode or a
fixed performance instance. The columns in the table are labeled A through K.
A B C D E= F G H= I= J = (I / K=
D-C G / 60 E/H 60) / B F+J
244
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The following table shows the breakeven CPU usage (in %) for T3 instance types compared to the
similarly-sized M5 instance types.
t3.large 42.5%
t3.xlarge 52.5%
t3.2xlarge 52.5%
However, if CPU utilization stays above the baseline, the instance cannot earn enough credits to pay
down the surplus credits that it has spent. The surplus credits that are not paid down are charged at
a flat additional rate per vCPU-hour. For information about the rate, see T2/T3/T4g Unlimited Mode
Pricing.
Surplus credits that were spent earlier are charged when any of the following occurs:
• The spent surplus credits exceed the maximum number of credits (p. 239) the instance can earn in a
24-hour period. Spent surplus credits above the maximum are charged at the end of the hour.
• The instance is stopped or terminated.
• The instance is switched from unlimited to standard.
245
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Spent surplus credits are tracked by the CloudWatch metric CPUSurplusCreditBalance. Surplus
credits that are charged are tracked by the CloudWatch metric CPUSurplusCreditsCharged. For more
information, see Additional CloudWatch metrics for burstable performance instances (p. 264).
T2 Standard instances receive launch credits (p. 250), but T2 Unlimited instances do not. A T2
Unlimited instance can burst beyond the baseline at any time with no additional charge, as long as
its average CPU utilization is at or below the baseline over a rolling 24-hour window or its lifetime,
whichever is shorter. As such, T2 Unlimited instances do not require launch credits to achieve high
performance immediately after launch.
If a T2 instance is switched from standard to unlimited, any accrued launch credits are removed from
the CPUCreditBalance before the remaining CPUCreditBalance is carried over.
T3a and T3 instances never receive launch credits because they support Unlimited mode. The Unlimited
mode credit configuration enables T4g, T3a and T3 instances to use as much CPU as needed to burst
beyond baseline and for as long as needed.
You can switch from unlimited to standard, and from standard to unlimited, at any time on
a running or stopped instance. For more information, see Launch a burstable performance instance
as Unlimited or Standard (p. 259) and Modify the credit specification of a burstable performance
instance (p. 262).
You can set unlimited as the default credit option at the account level per AWS Region, per burstable
performance instance family, so that all new burstable performance instances in the account launch
using the default credit option. For more information, see Set the default credit specification for the
account (p. 263).
You can check whether your burstable performance instance is configured as unlimited or standard
using the Amazon EC2 console or the AWS CLI. For more information, see View the credit specification of
a burstable performance instance (p. 262) and View the default credit specification (p. 264).
CPUCreditBalance is a CloudWatch metric that tracks the number of credits accrued by an instance.
CPUSurplusCreditBalance is a CloudWatch metric that tracks the number of surplus credits spent by
an instance.
When you change an instance configured as unlimited to standard, the following occurs:
To see if your instance is spending more credits than the baseline provides, you can use CloudWatch
metrics to track usage, and you can set up hourly alarms to be notified of credit usage. For more
information, see Monitor your CPU credits for burstable performance instances (p. 264).
246
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The following examples explain credit use for instances that are configured as unlimited.
Examples
• Example 1: Explain credit use with T3 Unlimited (p. 247)
• Example 2: Explain credit use with T2 Unlimited (p. 248)
In this example, you see the CPU utilization of a t3.nano instance launched as unlimited, and how it
spends earned and surplus credits to sustain CPU utilization.
A t3.nano instance earns 144 CPU credits over a rolling 24-hour period, which it can redeem for 144
minutes of vCPU use. When it depletes its CPU credit balance (represented by the CloudWatch metric
CPUCreditBalance), it can spend surplus CPU credits—that it has not yet earned—to burst for as long
as it needs. Because a t3.nano instance earns a maximum of 144 credits in a 24-hour period, it can
spend surplus credits up to that maximum without being charged immediately. If it spends more than
144 CPU credits, it is charged for the difference at the end of the hour.
The intent of the example, illustrated by the following graph, is to show how an instance can burst using
surplus credits even after it depletes its CPUCreditBalance. The following workflow references the
numbered points on the graph:
P1 – At 0 hours on the graph, the instance is launched as unlimited and immediately begins to earn
credits. The instance remains idle from the time it is launched—CPU utilization is 0%—and no credits are
spent. All unspent credits are accrued in the credit balance. For the first 24 hours, CPUCreditUsage is at
0, and the CPUCreditBalance value reaches its maximum of 144.
P2 – For the next 12 hours, CPU utilization is at 2.5%, which is below the 5% baseline. The instance
earns more credits than it spends, but the CPUCreditBalance value cannot exceed its maximum of 144
credits.
P3 – For the next 24 hours, CPU utilization is at 7% (above the baseline), which requires a spend of 57.6
credits. The instance spends more credits than it earns, and the CPUCreditBalance value reduces to
86.4 credits.
P4 – For the next 12 hours, CPU utilization decreases to 2.5% (below the baseline), which requires a
spend of 36 credits. In the same time, the instance earns 72 credits. The instance earns more credits than
it spends, and the CPUCreditBalance value increases to 122 credits.
P5 – For the next 5 hours, the instance bursts at 100% CPU utilization, and spends a total of 570 credits
to sustain the burst. About an hour into this period, the instance depletes its entire CPUCreditBalance
of 122 credits, and starts to spend surplus credits to sustain the high CPU utilization, totaling 448
surplus credits in this period (570-122=448). When the CPUSurplusCreditBalance value reaches
144 CPU credits (the maximum a t3.nano instance can earn in a 24-hour period), any surplus credits
spent thereafter cannot be offset by earned credits. The surplus credits spent thereafter amounts to 304
credits (448-144=304), which results in a small additional charge at the end of the hour for 304 credits.
P6 – For the next 13 hours, CPU utilization is at 5% (the baseline). The instance earns as
many credits as it spends, with no excess to pay down the CPUSurplusCreditBalance. The
CPUSurplusCreditBalance value remains at 144 credits.
P7 – For the last 24 hours in this example, the instance is idle and CPU utilization is 0%. During this time,
the instance earns 144 credits, which it uses to pay down the CPUSurplusCreditBalance.
247
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
In this example, you see the CPU utilization of a t2.nano instance launched as unlimited, and how it
spends earned and surplus credits to sustain CPU utilization.
A t2.nano instance earns 72 CPU credits over a rolling 24-hour period, which it can redeem for 72
minutes of vCPU use. When it depletes its CPU credit balance (represented by the CloudWatch metric
CPUCreditBalance), it can spend surplus CPU credits—that it has not yet earned—to burst for as long
as it needs. Because a t2.nano instance earns a maximum of 72 credits in a 24-hour period, it can spend
surplus credits up to that maximum without being charged immediately. If it spends more than 72 CPU
credits, it is charged for the difference at the end of the hour.
The intent of the example, illustrated by the following graph, is to show how an instance can burst using
surplus credits even after it depletes its CPUCreditBalance. You can assume that, at the start of the
time line in the graph, the instance has an accrued credit balance equal to the maximum number of
credits it can earn in 24 hours. The following workflow references the numbered points on the graph:
1 – In the first 10 minutes, CPUCreditUsage is at 0, and the CPUCreditBalance value remains at its
maximum of 72.
2 – At 23:40, as CPU utilization increases, the instance spends CPU credits and the CPUCreditBalance
value decreases.
3 – At around 00:47, the instance depletes its entire CPUCreditBalance, and starts to spend surplus
credits to sustain high CPU utilization.
4 – Surplus credits are spent until 01:55, when the CPUSurplusCreditBalance value reaches 72 CPU
credits. This is equal to the maximum a t2.nano instance can earn in a 24-hour period. Any surplus
credits spent thereafter cannot be offset by earned credits within the 24-hour period, which results in a
small additional charge at the end of the hour.
5 – The instance continues to spend surplus credits until around 02:20. At this time, CPU utilization
falls below the baseline, and the instance starts to earn credits at 3 credits per hour (or 0.25
credits every 5 minutes), which it uses to pay down the CPUSurplusCreditBalance. After the
CPUSurplusCreditBalance value reduces to 0, the instance starts to accrue earned credits in its
CPUCreditBalance at 0.25 credits every 5 minutes.
248
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Surplus credits cost $0.096 per vCPU-hour. The instance spent approximately 25 surplus credits between
01:55 and 02:20, which is equivalent to 0.42 vCPU-hours.
Additional charges for this instance are 0.42 vCPU-hours x $0.096/vCPU-hour = $0.04032, rounded to
$0.04.
You can set billing alerts to be notified every hour of any accruing charges, and take action if required.
Contents
• Standard mode concepts (p. 250)
• How standard burstable performance instances work (p. 250)
• Launch credits (p. 250)
• Launch credit limits (p. 251)
249
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The standard mode is a configuration option for burstable performance instances. It can be enabled
or disabled at any time for a running or stopped instance. You can set standard as the default credit
option (p. 263) at the account level per AWS Region, per burstable performance instance family, so that
all new burstable performance instances in the account launch using the default credit option.
T2 Standard instances receive two types of CPU credits (p. 237): earned credits and launch credits. When
a T2 Standard instance is in a running state, it continuously earns (at a millisecond-level resolution) a
set rate of earned credits per hour. At start, it has not yet earned credits for a good startup experience;
therefore, to provide a good startup experience, it receives launch credits at start, which it spends first
while it accrues earned credits.
T3a and T3 instances do not receive launch credits because they support Unlimited mode. The Unlimited
mode credit configuration enables T4g, T3a and T3 instances to use as much CPU as needed to burst
beyond baseline and for as long as needed.
Launch credits
T2 Standard instances get 30 launch credits per vCPU at launch or start, and T1 Standard instances get
15 launch credits. For example, a t2.micro instance has one vCPU and gets 30 launch credits, while a
t2.xlarge instance has four vCPUs and gets 120 launch credits. Launch credits are designed to provide
a good startup experience to allow instances to burst immediately after launch before they have accrued
earned credits.
Launch credits are spent first, before earned credits. Unspent launch credits are accrued in the CPU
credit balance, but do not count towards the CPU credit balance limit. For example, a t2.micro instance
has a CPU credit balance limit of 144 earned credits. If it is launched and remains idle for 24 hours,
its CPU credit balance reaches 174 (30 launch credits + 144 earned credits), which is over the limit.
However, after the instance spends the 30 launch credits, the credit balance cannot exceed 144. For more
information about the CPU credit balance limit for each instance size, see the credit table (p. 239).
The following table lists the initial CPU credit allocation received at launch or start, and the number of
vCPUs.
250
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
t1.micro 15 1
t2.nano 30 1
t2.micro 30 1
t2.small 30 1
t2.medium 60 2
t2.large 60 2
t2.xlarge 120 4
t2.2xlarge 240 8
There is a limit to the number of times T2 Standard instances can receive launch credits. The default limit
is 100 launches or starts of all T2 Standard instances combined per account, per Region, per rolling 24-
hour period. For example, the limit is reached when one instance is stopped and started 100 times within
a 24-hour period, or when 100 instances are launched within a 24-hour period, or other combinations
that equate to 100 starts. New accounts may have a lower limit, which increases over time based on your
usage.
Tip
To ensure that your workloads always get the performance they need, switch to Unlimited mode
for burstable performance instances (p. 242) or consider using a larger instance size.
The following table lists the differences between launch credits and earned credits.
Credit earn T2 Standard instances get 30 launch Each T2 instance continuously earns (at
rate credits per vCPU at launch or start. a millisecond-level resolution) a set rate
of CPU credits per hour, depending on
If a T2 instance is switched from the instance size. For more information
unlimited to standard, it does not get about the number of CPU credits
launch credits at the time of switching. earned per instance size, see the credit
table (p. 239).
Credit earn The limit for receiving launch credits is A T2 instance cannot accrue more credits
limit 100 launches or starts of all T2 Standard than the CPU credit balance limit. If the
instances combined per account, per CPU credit balance has reached its limit,
Region, per rolling 24-hour period. New any credits that are earned after the limit
accounts may have a lower limit, which is reached are discarded. Launch credits
increases over time based on your usage. do not count towards the limit. For more
information about the CPU credit balance
limit for each T2 instance size, see the
credit table (p. 239).
Credit use Launch credits are spent first, before Earned credits are spent only after all
earned credits. launch credits are spent.
251
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
The number of accrued launch credits and accrued earned credits is tracked by the CloudWatch metric
CPUCreditBalance. For more information, see CPUCreditBalance in the CloudWatch metrics
table (p. 265).
The following examples explain credit use when instances are configured as standard.
Examples
• Example 1: Explain credit use with T3 Standard (p. 252)
• Example 2: Explain credit use with T2 Standard (p. 253)
In this example, you see how a t3.nano instance launched as standard earns, accrues, and spends
earned credits. You see how the credit balance reflects the accrued earned credits.
A running t3.nano instance earns 144 credits every 24 hours. Its credit balance limit is 144 earned
credits. After the limit is reached, new credits that are earned are discarded. For more information about
the number of credits that can be earned and accrued, see the credit table (p. 239).
You might launch a T3 Standard instance and use it immediately. Or, you might launch a T3 Standard
instance and leave it idle for a few days before running applications on it. Whether an instance is used or
remains idle determines if credits are spent or accrued. If an instance remains idle for 24 hours from the
time it is launched, the credit balance reaches it limit, which is the maximum number of earned credits
that can be accrued.
This example describes an instance that remains idle for 24 hours from the time it is launched, and walks
you through seven periods of time over a 96-hour period, showing the rate at which credits are earned,
accrued, spent, and discarded, and the value of the credit balance at the end of each period.
P1 – At 0 hours on the graph, the instance is launched as standard and immediately begins to earn
credits. The instance remains idle from the time it is launched—CPU utilization is 0%—and no credits are
spent. All unspent credits are accrued in the credit balance. For the first 24 hours, CPUCreditUsage is at
0, and the CPUCreditBalance value reaches its maximum of 144.
P2 – For the next 12 hours, CPU utilization is at 2.5%, which is below the 5% baseline. The instance
earns more credits than it spends, but the CPUCreditBalance value cannot exceed its maximum of 144
credits. Any credits that are earned in excess of the limit are discarded.
P3 – For the next 24 hours, CPU utilization is at 7% (above the baseline), which requires a spend of 57.6
credits. The instance spends more credits than it earns, and the CPUCreditBalance value reduces to
86.4 credits.
P4 – For the next 12 hours, CPU utilization decreases to 2.5% (below the baseline), which requires a
spend of 36 credits. In the same time, the instance earns 72 credits. The instance earns more credits than
it spends, and the CPUCreditBalance value increases to 122 credits.
252
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
P5 – For the next two hours, the instance bursts at 60% CPU utilization, and depletes its entire
CPUCreditBalance value of 122 credits. At the end of this period, with the CPUCreditBalance at
zero, CPU utilization is forced to drop to the baseline utilization level of 5%. At the baseline, the instance
earns as many credits as it spends.
P6 – For the next 14 hours, CPU utilization is at 5% (the baseline). The instance earns as many credits as
it spends. The CPUCreditBalance value remains at 0.
P7 – For the last 24 hours in this example, the instance is idle and CPU utilization is 0%. During this time,
the instance earns 144 credits, which it accrues in its CPUCreditBalance.
A t2.nano instance gets 30 launch credits when it is launched, and earns 72 credits every 24 hours. Its
credit balance limit is 72 earned credits; launch credits do not count towards the limit. After the limit is
reached, new credits that are earned are discarded. For more information about the number of credits
that can be earned and accrued, see the credit table (p. 239). For more information about limits, see
Launch credit limits (p. 251).
You might launch a T2 Standard instance and use it immediately. Or, you might launch a T2 Standard
instance and leave it idle for a few days before running applications on it. Whether an instance is used
or remains idle determines if credits are spent or accrued. If an instance remains idle for 24 hours from
the time it is launched, the credit balance appears to exceed its limit because the balance reflects both
accrued earned credits and accrued launch credits. However, after CPU is used, the launch credits are
spent first. Thereafter, the limit always reflects the maximum number of earned credits that can be
accrued.
This example describes an instance that remains idle for 24 hours from the time it is launched, and walks
you through seven periods of time over a 96-hour period, showing the rate at which credits are earned,
accrued, spent, and discarded, and the value of the credit balance at the end of each period.
Period 1: 1 – 24 hours
At 0 hours on the graph, the T2 instance is launched as standard and immediately gets 30 launch
credits. It earns credits while in the running state. The instance remains idle from the time it is launched
—CPU utilization is 0%—and no credits are spent. All unspent credits are accrued in the credit balance.
At approximately 14 hours after launch, the credit balance is 72 (30 launch credits + 42 earned credits),
which is equivalent to what the instance can earn in 24 hours. At 24 hours after launch, the credit
balance exceeds 72 credits because the unspent launch credits are accrued in the credit balance—the
credit balance is 102 credits: 30 launch credits + 72 earned credits.
253
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Conclusion
If there is no CPU utilization after launch, the instance accrues more credits than what it can earn in 24
hours (30 launch credits + 72 earned credits = 102 credits).
In a real-world scenario, an EC2 instance consumes a small number of credits while launching and
running, which prevents the balance from reaching the maximum theoretical value in this example.
Period 2: 25 – 36 hours
For the next 12 hours, the instance continues to remain idle and earn credits, but the credit balance does
not increase. It plateaus at 102 credits (30 launch credits + 72 earned credits). The credit balance has
reached its limit of 72 accrued earned credits, so newly earned credits are discarded.
254
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Credit Discard Rate 72 credits per 24 hours (100% of credit earn rate)
Conclusion
An instance constantly earns credits, but it cannot accrue more earned credits if the credit balance
has reached its limit. After the limit is reached, newly earned credits are discarded. Launch credits do
not count towards the credit balance limit. If the balance includes accrued launch credits, the balance
appears to be over the limit.
Period 3: 37 – 61 hours
For the next 25 hours, the instance uses 2% CPU, which requires 30 credits. In the same period, it earns
75 credits, but the credit balance decreases. The balance decreases because the accrued launch credits
are spent first, while newly earned credits are discarded because the credit balance is already at its limit
of 72 earned credits.
Credit Spend Rate 28.8 credits per 24 hours (1.2 credits per hour,
2% CPU utilization, 40% of credit earn rate)—30
credits over 25 hours
Credit Discard Rate 72 credits per 24 hours (100% of credit earn rate)
Conclusion
An instance spends launch credits first, before spending earned credits. Launch credits do not count
towards the credit limit. After the launch credits are spent, the balance can never go higher than what
can be earned in 24 hours. Furthermore, while an instance is running, it cannot get more launch credits.
255
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Period 4: 62 – 72 hours
For the next 11 hours, the instance uses 2% CPU, which requires 13.2 credits. This is the same CPU
utilization as in the previous period, but the balance does not decrease. It stays at 72 credits.
The balance does not decrease because the credit earn rate is higher than the credit spend rate. In the
time that the instance spends 13.2 credits, it also earns 33 credits. However, the balance limit is 72
credits, so any earned credits that exceed the limit are discarded. The balance plateaus at 72 credits,
which is different from the plateau of 102 credits during Period 2, because there are no accrued launch
credits.
Credit Spend Rate 28.8 credits per 24 hours (1.2 credits per hour, 2%
CPU utilization, 40% of credit earn rate)—13.2
credits over 11 hours
Credit Discard Rate 43.2 credits per 24 hours (60% of credit earn rate)
Conclusion
After launch credits are spent, the credit balance limit is determined by the number of credits that an
instance can earn in 24 hours. If the instance earns more credits than it spends, newly earned credits over
the limit are discarded.
Period 5: 73 – 75 hours
For the next three hours, the instance bursts at 20% CPU utilization, which requires 36 credits. The
instance earns nine credits in the same three hours, which results in a net balance decrease of 27 credits.
At the end of three hours, the credit balance is 45 accrued earned credits.
256
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Credit Spend Rate 288 credits per 24 hours (12 credits per hour, 20%
CPU utilization, 400% of credit earn rate)—36
credits over 3 hours
Conclusion
If an instance spends more credits than it earns, its credit balance decreases.
Period 6: 76 – 90 hours
For the next 15 hours, the instance uses 2% CPU, which requires 18 credits. This is the same CPU
utilization as in Periods 3 and 4. However, the balance increases in this period, whereas it decreased in
Period 3 and plateaued in Period 4.
In Period 3, the accrued launch credits were spent, and any earned credits that exceeded the credit limit
were discarded, resulting in a decrease in the credit balance. In Period 4, the instance spent fewer credits
than it earned. Any earned credits that exceeded the limit were discarded, so the balance plateaued at its
maximum of 72 credits.
In this period, there are no accrued launch credits, and the number of accrued earned credits in the
balance is below the limit. No earned credits are discarded. Furthermore, the instance earns more credits
than it spends, resulting in an increase in the credit balance.
257
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Credit Spend Rate 28.8 credits per 24 hours (1.2 credits per hour,
2% CPU utilization, 40% of credit earn rate)—18
credits over 15 hours
Credit Earn Rate 72 credits per 24 hours (45 credits over 15 hours)
Conclusion
If an instance spends fewer credits than it earns, its credit balance increases.
Period 7: 91 – 96 hours
For the next six hours, the instance remains idle—CPU utilization is 0%—and no credits are spent. This is
the same CPU utilization as in Period 2, but the balance does not plateau at 102 credits—it plateaus at
72 credits, which is the credit balance limit for the instance.
In Period 2, the credit balance included 30 accrued launch credits. The launch credits were spent in
Period 3. A running instance cannot get more launch credits. After its credit balance limit is reached, any
earned credits that exceed the limit are discarded.
258
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Credit Discard Rate 72 credits per 24 hours (100% of credit earn rate)
Conclusion
An instance constantly earns credits, but cannot accrue more earned credits if the credit balance limit has
been reached. After the limit is reached, newly earned credits are discarded. The credit balance limit is
determined by the number of credits that an instance can earn in 24 hours. For more information about
credit balance limits, see the credit table (p. 239).
Each burstable performance instance family comes with the following default credit specification:
You can change the default credit specification (p. 263) for the account.
Contents
• Launch a burstable performance instance as Unlimited or Standard (p. 259)
• Use an Auto Scaling group to launch a burstable performance instance as Unlimited (p. 260)
• View the credit specification of a burstable performance instance (p. 262)
• Modify the credit specification of a burstable performance instance (p. 262)
• Set the default credit specification for the account (p. 263)
• View the default credit specification (p. 264)
You can launch your instances as unlimited or standard using the Amazon EC2 console, an AWS SDK,
a command line tool, or with an Auto Scaling group. For more information, see Use an Auto Scaling
group to launch a burstable performance instance as Unlimited (p. 260).
Console
259
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
AWS CLI
Use the run-instances command to launch your instances. Specify the credit specification using the
--credit-specification CpuCredits= parameter. Valid credit specifications are unlimited
and standard.
• For T3a and T3, if you do not include the --credit-specification parameter, the instance
launches as unlimited by default.
• For T2, if you do not include the --credit-specification parameter, the instance launches as
standard by default.
When burstable performance instances are launched or started, they require CPU credits for a good
bootstrapping experience. If you use an Auto Scaling group to launch your instances, we recommend
that you configure your instances as unlimited. If you do, the instances use surplus credits when
they are automatically launched or restarted by the Auto Scaling group. Using surplus credits prevents
performance restrictions.
You must use a launch template for launching instances as unlimited in an Auto Scaling group. A
launch configuration does not support launching instances as unlimited.
Note
unlimited mode is not supported for T3 instances that are launched on a Dedicated Host.
Console
1. Follow the Creating a Launch Template for an Auto Scaling Group procedure.
2. In Launch template contents, for Instance type, choose an instance size.
3. To launch instances as unlimited in an Auto Scaling group, under Advanced details, for Credit
specification, choose Unlimited.
4. When you've finished defining the launch template parameters, choose Create launch
template. For more information, see Creating a Launch Template for an Auto Scaling Group in
the Amazon EC2 Auto Scaling User Guide.
AWS CLI
Use the create-launch-template command and specify unlimited as the credit specification.
260
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
To associate the launch template with an Auto Scaling group, create the Auto Scaling group using the
launch template, or add the launch template to an existing Auto Scaling group.
Console
AWS CLI
Use the create-auto-scaling-group AWS CLI command and specify the --launch-template
parameter.
Console
AWS CLI
Use the update-auto-scaling-group AWS CLI command and specify the --launch-template
parameter.
261
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
You can view the credit specification (unlimited or standard) of a running or stopped instance.
Console
AWS CLI
Use the describe-instance-credit-specifications command. If you do not specify one or more instance
IDs, all instances with the credit specification of unlimited are returned, as well as instances that
were previously configured with the unlimited credit specification. For example, if you resize a
T3 instance to an M4 instance, while it is configured as unlimited, Amazon EC2 returns the M4
instance.
{
"InstanceCreditSpecifications": [
{
"InstanceId": "i-1234567890abcdef0",
"CpuCredits": "unlimited"
}
]
}
You can switch the credit specification of a running or stopped instance at any time between unlimited
and standard.
Note that in unlimited mode, an instance can spend surplus credits, which might incur an additional
charge. For more information, see Surplus credits can incur charges (p. 245).
Console
262
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
5. To change the credit specification to unlimited, select the check box next to the instance ID.
To change the credit specification to standard, clear the check box next to the instance ID.
AWS CLI
Use the modify-instance-credit-specification command. Specify the instance and its credit
specification using the --instance-credit-specification parameter. Valid credit
specifications are unlimited and standard.
{
"SuccessfulInstanceCreditSpecifications": [
{
"InstanceId": "i- 1234567890abcdef0"
}
],
"UnsuccessfulInstanceCreditSpecifications": []
}
If you use the launch instance wizard in the EC2 console to launch instances, the value you select for
the credit specification overrides the account-level default credit specification. If you use the AWS CLI to
launch instances, all new burstable performance instances in the account launch using the default credit
specification. The credit specification for existing running or stopped instances is not affected.
Consideration
The default credit specification for an instance family can be modified only once in a rolling 5-minute
period, and up to four times in a rolling 24-hour period.
Console
To set the default credit specification at the account level per Region
AWS CLI
To set the default credit specification at the account level (AWS CLI)
263
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Use the modify-default-credit-specification command. Specify the AWS Region, instance family,
and the default credit specification using the --cpu-credits parameter. Valid default credit
specifications are unlimited and standard.
You can view the default credit specification of a burstable performance instance family at the account
level per AWS Region.
Console
AWS CLI
To view the default credit specification at the account level (AWS CLI)
Use the get-default-credit-specification command. Specify the AWS Region and instance family.
Contents
• Additional CloudWatch metrics for burstable performance instances (p. 264)
• Calculate CPU credit usage (p. 266)
Burstable performance instances have these additional CloudWatch metrics, which are updated every
five minutes:
• CPUCreditUsage – The number of CPU credits spent during the measurement period.
• CPUCreditBalance – The number of CPU credits that an instance has accrued. This balance is
depleted when the CPU bursts and CPU credits are spent more quickly than they are earned.
• CPUSurplusCreditBalance – The number of surplus CPU credits spent to sustain CPU utilization
when the CPUCreditBalance value is zero.
264
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
• CPUSurplusCreditsCharged – The number of surplus CPU credits exceeding the maximum number
of CPU credits (p. 239) that can be earned in a 24-hour period, and thus attracting an additional
charge.
The following table describes the CloudWatch metrics for burstable performance instances. For more
information, see List the available CloudWatch metrics for your instances (p. 1139).
Metric Description
CPUCreditUsage The number of CPU credits spent by the instance for CPU
utilization. One CPU credit equals one vCPU running at 100%
utilization for one minute or an equivalent combination of vCPUs,
utilization, and time (for example, one vCPU running at 50%
utilization for two minutes or two vCPUs running at 25% utilization
for two minutes).
Credits are accrued in the credit balance after they are earned,
and removed from the credit balance when they are spent. The
credit balance has a maximum limit, determined by the instance
size. After the limit is reached, any new credits that are earned are
discarded. For T2 Standard, launch credits do not count towards the
limit.
265
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
Metric Description
Units: Credits (vCPU-minutes)
CPUSurplusCreditsCharged The number of spent surplus credits that are not paid down by
earned CPU credits, and which thus incur an additional charge.
Spent surplus credits are charged when any of the following occurs:
The CPU credit usage of instances is calculated using the instance CloudWatch metrics described in the
preceding table.
Amazon EC2 sends the metrics to CloudWatch every five minutes. A reference to the prior value of a
metric at any point in time implies the previous value of the metric, sent five minutes ago.
• The CPU credit balance increases if CPU utilization is below the baseline, when the credits spent are
less than the credits earned in the prior five-minute interval.
• The CPU credit balance decreases if CPU utilization is above the baseline, when the credits spent are
more than the credits earned in the prior five-minute interval.
Example
The size of the instance determines the number of credits that the instance can earn per hour and the
number of earned credits that it can accrue in the credit balance. For information about the number of
credits earned per hour, and the credit balance limit for each instance size, see the credit table (p. 239).
Example
This example uses a t3.nano instance. To calculate the CPUCreditBalance value of the instance, use
the preceding equation as follows:
266
Amazon Elastic Compute Cloud
User Guide for Windows Instances
General purpose
• CPUCreditUsage – How many credits the instance spent in the past five minutes. In this example, the
instance spent one credit in the past five minutes.
Example
We use the term Adjusted balance in the following equations to reflect the activity that occurs in
this five-minute interval. We use this value to arrive at the values for the CPUCreditBalance and
CPUSurplusCreditBalance CloudWatch metrics.
Example
A value of 0 for Adjusted balance indicates that the instance spent all its earned credits
for bursting, and no surplus credits were spent. As a result, both CPUCreditBalance and
CPUSurplusCreditBalance are set to 0.
A positive Adjusted balance value indicates that the instance accrued earned credits, and previous
surplus credits, if any, were paid down. As a result, the Adjusted balance value is assigned to
CPUCreditBalance, and the CPUSurplusCreditBalance is set to 0. The instance size determines the
maximum number of credits (p. 239) that it can accrue.
Example
A negative Adjusted balance value indicates that the instance spent all its earned credits that it
accrued and, in addition, also spent surplus credits for bursting. As a result, the Adjusted balance
value is assigned to CPUSurplusCreditBalance and CPUCreditBalance is set to 0. Again, the
instance size determines the maximum number of credits (p. 239) that it can accrue.
Example
If the surplus credits spent exceed the maximum credits that the instance can accrue, the surplus credit
balance is set to the maximum, as shown in the preceding equation. The remaining surplus credits are
charged as represented by the CPUSurplusCreditsCharged metric.
Example
267
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
Finally, when the instance terminates, any surplus credits tracked by the CPUSurplusCreditBalance
are charged. If the instance is switched from unlimited to standard, any remaining
CPUSurplusCreditBalance is also charged.
Bare metal instances, such as c5.metal, provide your applications with direct access to physical
resources of the host server, such as processors and memory.
These instances are ideal for running advanced, compute-intensive workloads, such as the following:
C6in instances
These instances are well suited for compute-intensive workloads such as the following:
Contents
• Hardware specifications (p. 269)
• Instance performance (p. 272)
268
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
Hardware specifications
The following is a summary of the hardware specifications for compute optimized instances. A virtual
central processing unit (vCPU) represents a portion of the physical CPU assigned to a virtual machine
(VM). For x86 instances, there are two vCPUs per core. For Graviton instances, there is one vCPU per core.
c1.medium 2 1.70
c1.xlarge 8 7.00
c3.large 2 3.75
c3.xlarge 4 7.50
c3.2xlarge 8 15.00
c3.4xlarge 16 30.00
c3.8xlarge 32 60.00
c4.large 2 3.75
c4.xlarge 4 7.50
c4.2xlarge 8 15.00
c4.4xlarge 16 30.00
c4.8xlarge 36 60.00
c5.large 2 4.00
c5.xlarge 4 8.00
c5.2xlarge 8 16.00
c5.4xlarge 16 32.00
c5.9xlarge 36 72.00
c5.12xlarge 48 96.00
c5.18xlarge 72 144.00
c5.24xlarge 96 192.00
c5.metal 96 192.00
c5a.large 2 4.00
c5a.xlarge 4 8.00
c5a.2xlarge 8 16.00
269
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
c5a.4xlarge 16 32.00
c5a.8xlarge 32 64.00
c5a.12xlarge 48 96.00
c5a.16xlarge 64 128.00
c5a.24xlarge 96 192.00
c5ad.large 2 4.00
c5ad.xlarge 4 8.00
c5ad.2xlarge 8 16.00
c5ad.4xlarge 16 32.00
c5ad.8xlarge 32 64.00
c5ad.12xlarge 48 96.00
c5ad.16xlarge 64 128.00
c5ad.24xlarge 96 192.00
c5d.large 2 4.00
c5d.xlarge 4 8.00
c5d.2xlarge 8 16.00
c5d.4xlarge 16 32.00
c5d.9xlarge 36 72.00
c5d.12xlarge 48 96.00
c5d.18xlarge 72 144.00
c5d.24xlarge 96 192.00
c5d.metal 96 192.00
c5n.large 2 5.25
c5n.xlarge 4 10.50
c5n.2xlarge 8 21.00
c5n.4xlarge 16 42.00
c5n.9xlarge 36 96.00
c5n.18xlarge 72 192.00
c5n.metal 72 192.00
c6a.large 2 4.00
c6a.xlarge 4 8.00
270
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
c6a.2xlarge 8 16.00
c6a.4xlarge 16 32.00
c6a.8xlarge 32 64.00
c6a.12xlarge 48 96.00
c6a.16xlarge 64 128.00
c6a.24xlarge 96 192.00
c6i.large 2 4.00
c6i.xlarge 4 8.00
c6i.2xlarge 8 16.00
c6i.4xlarge 16 32.00
c6i.8xlarge 32 64.00
c6i.12xlarge 48 96.00
c6i.16xlarge 64 128.00
c6i.24xlarge 96 192.00
c6id.large 2 4.00
c6id.xlarge 4 8.00
c6id.2xlarge 8 16.00
c6id.4xlarge 16 32.00
c6id.8xlarge 32 64.00
c6id.12xlarge 48 96.00
c6id.16xlarge 64 128.00
c6id.24xlarge 96 192.00
c6in.large 2 4.00
c6in.xlarge 4 8.00
271
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
c6in.2xlarge 8 16.00
c6in.4xlarge 16 32.00
c6in.8xlarge 32 64.00
c6in.12xlarge 48 96.00
c6in.16xlarge 64 128.00
c6in.24xlarge 96 192.00
cc2.8xlarge 32 60.50
AMD processors
• 2nd generation AMD EPYC processors (AMD EPYC 7R32): C5a, C5ad
• 3rd generation AMD EPYC processors (AMD EPYC 7R13): C6a
Intel processors
Instance performance
EBS-optimized instances enable you to get consistently high performance for your EBS volumes by
eliminating contention between Amazon EBS I/O and other network traffic from your instance. Some
compute optimized instances are EBS-optimized by default at no additional cost. For more information,
see Amazon EBS–optimized instances (p. 1752).
Network performance
You can enable enhanced networking on supported instance types to provide lower latencies, lower
network jitter, and higher packet-per-second (PPS) performance. Most applications do not consistently
need a high level of network performance, but can benefit from access to increased bandwidth when
they send or receive data. For more information, see Enhanced networking on Windows (p. 1278).
The following is a summary of network performance for compute optimized instances that support
enhanced networking.
272
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
Note
Instance types indicated with a † have a baseline bandwidth and can use a network I/O
credit mechanism to burst beyond their baseline bandwidth on a best effort basis. For more
information, see instance network bandwidth (p. 1276).
273
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
274
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
275
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
For 32xlarge and metal instance types that support 200 Gbps, at least 2 ENIs, each attached to a
different network card, are required on the instance to achieve 200 Gbps throughput. Each ENI attached
to a network card can achieve a max of 170 Gbps.
The following table shows the baseline and burst bandwidth for instance types that use the network I/O
credit mechanism to burst beyond their baseline bandwidth.
276
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
277
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
278
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Compute optimized
As you fill the SSD-based instance store volumes for your instance, the number of write IOPS that
you can achieve decreases. This is due to the extra work the SSD controller must do to find available
space, rewrite existing data, and erase unused space so that it can be rewritten. This process of
garbage collection results in internal write amplification to the SSD, expressed as the ratio of SSD write
operations to user write operations. This decrease in performance is even larger if the write operations
are not in multiples of 4,096 bytes or not aligned to a 4,096-byte boundary. If you write a smaller
amount of bytes or bytes that are not aligned, the SSD controller must read the surrounding data and
store the result in a new location. This pattern results in significantly increased write amplification,
increased latency, and dramatically reduced I/O performance.
SSD controllers can use several strategies to reduce the impact of write amplification. One such strategy
is to reserve space in the SSD instance storage so that the controller can more efficiently manage the
space available for write operations. This is called over-provisioning. The SSD-based instance store
volumes provided to an instance don't have any space reserved for over-provisioning. To reduce write
amplification, we recommend that you leave 10% of the volume unpartitioned so that the SSD controller
can use it for over-provisioning. This decreases the storage that you can use, but increases performance
even if the disk is close to full capacity.
For instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller whenever you no longer need data that you've written. This provides the controller with more
free space, which can reduce write amplification and increase performance. For more information, see
Instance store volume TRIM support (p. 1822).
Release notes
• C4 instances and instances built on the Nitro System (p. 210) require 64-bit EBS-backed HVM AMIs.
They have high-memory and require a 64-bit operating system to take advantage of that capacity.
HVM AMIs provide superior performance in comparison to paravirtual (PV) AMIs on high-memory
instance types. In addition, you must use an HVM AMI to take advantage of enhanced networking.
• Instances built on the Nitro System have the following requirements:
• NVMe drivers (p. 1750) must be installed
• Elastic Network Adapter (ENA) drivers (p. 1279) must be installed
The current AWS Windows AMIs (p. 34) meet these requirements.
• To get the best performance from your C6i instances, ensure that they have ENA driver version 2.2.3
or later. Using an ENA driver earlier than version 2.0.0 with these instances causes network interface
attachment failures. The following AMIs have a compatible ENA driver.
• AWS Windows AMI from May 2021 or later
• Instances built on the Nitro System instances support a maximum of 28 attachments, including
network interfaces, EBS volumes, and NVMe instance store volumes. For more information, see Nitro
System volume limits (p. 1828).
• Launching a bare metal instance boots the underlying server, which includes verifying all hardware and
firmware components. This means that it can take 20 minutes from the time the instance enters the
running state until it becomes available over the network.
• To attach or detach EBS volumes or secondary network interfaces from a bare metal instance requires
PCIe native hotplug support.
• Bare metal instances use a PCI-based serial device rather than an I/O port-based serial device. The
upstream Linux kernel and the latest Amazon Linux AMIs support this device. Bare metal instances also
provide an ACPI SPCR table to enable the system to automatically use the PCI-based serial device. The
latest Windows AMIs automatically use the PCI-based serial device.
279
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
• There is a limit on the total number of instances that you can launch in a Region, and there are
additional limits on some instance types. For more information, see How many instances can I run in
Amazon EC2? in the Amazon EC2 FAQ.
• High-performance, including relational MySQL and NoSQL, for example MongoDB and Cassandra
databases.
• Distributed web scale cache stores that provide in-memory caching of key-value type data, for
example Memcached and Redis
• In-memory databases using optimized data storage formats and analytics for business intelligence; for
example, SAP HANA
• Applications performing real-time processing of big unstructured data, using Hadoop and Spark
clusters
• High-performance computing (HPC) and Electronic Design Automation (EDA) applications.
Bare metal instances, such as r5.metal, provide your applications with direct access to physical
resources of the host server, such as processors and memory.
R6a instances
These instances are ideal for running memory-intensive workloads, such as the following:
Hpc6id instances
These instances are ideal for running high performance computing (HPC) workloads, such as the
following:
280
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
These instances are well suited for network-intensive workloads such as the following:
• High-performance relational, MySQL and NoSQL. For example, MongoDB and Cassandra databases
• Distributed web scale cache stores that provide in-memory caching of key-value type data, including
Memcached and Redis
• In-memory databases using optimized data storage formats and analytics for business intelligence, for
example SAP HANA
• Real-time big data analytics for financial services, for example Hadoop and Spark clusters
These instances offer 3 TiB, 6 TiB, 9 TiB, 12 TiB, 18 TiB, and 24 TiB of memory per instance. They are
designed to run large in-memory databases, including production deployments of the SAP HANA in-
memory database.
For more information, see Amazon EC2 High Memory Instances and Storage Configuration for SAP
HANA. For information about supported operating systems, see Migrating SAP HANA on AWS to an EC2
High Memory Instance.
X1 instances
• In-memory databases such as SAP HANA, including SAP-certified support for Business Suite S/4HANA,
Business Suite on HANA (SoH), Business Warehouse on HANA (BW), and Data Mart Solutions on HANA.
For more information, see SAP HANA on the AWS Cloud.
• Big-data processing engines such as Apache Spark or Presto.
• High-performance computing (HPC) applications.
X1e instances
• High-performance databases.
• In-memory databases such as SAP HANA. For more information, see SAP HANA on the AWS Cloud.
• Memory-intensive enterprise applications.
281
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
X2idn and X2iedn instances support io2 Block Express volumes. All io2 volumes attached to X2idn and
X2iedn instances, during or after launch, automatically run on EBS Block Express. For more information,
see io2 Block Express volumes.
z1d instances
These instances deliver both high compute and high memory and are well-suited for the following:
z1d.metal instances provide your applications with direct access to physical resources of the host
server, such as processors and memory.
Contents
• Hardware specifications (p. 282)
• Memory performance (p. 288)
• Instance performance (p. 288)
• Network performance (p. 288)
• Amazon EBS I/O performance (p. 297)
• SSD-based instance store volume I/O performance (p. 297)
• High availability and reliability (X1) (p. 300)
• Support for vCPUs (p. 300)
• Release notes (p. 300)
Hardware specifications
The following is a summary of the hardware specifications for memory optimized instances. A virtual
central processing unit (vCPU) represents a portion of the physical CPU assigned to a virtual machine
(VM). For x86 instances, there are two vCPUs per core. For Graviton instances, there is one vCPU per core.
cr1.8xlarge 32 243.76
hpc6id.32xlarge 64 1024.00
r3.large 2 15.00
r3.xlarge 4 30.50
r3.2xlarge 8 61.00
r3.4xlarge 16 122.00
r3.8xlarge 32 244.00
r4.large 2 15.25
r4.xlarge 4 30.50
r4.2xlarge 8 61.00
282
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
r4.4xlarge 16 122.00
r4.8xlarge 32 244.00
r4.16xlarge 64 488.00
r5.large 2 16.00
r5.xlarge 4 32.00
r5.2xlarge 8 64.00
r5.4xlarge 16 128.00
r5.8xlarge 32 256.00
r5.12xlarge 48 384.00
r5.16xlarge 64 512.00
r5.24xlarge 96 768.00
r5.metal 96 768.00
r5a.large 2 16.00
r5a.xlarge 4 32.00
r5a.2xlarge 8 64.00
r5a.4xlarge 16 128.00
r5a.8xlarge 32 256.00
r5a.12xlarge 48 384.00
r5a.16xlarge 64 512.00
r5a.24xlarge 96 768.00
r5ad.large 2 16.00
r5ad.xlarge 4 32.00
r5ad.2xlarge 8 64.00
r5ad.4xlarge 16 128.00
r5ad.8xlarge 32 256.00
r5ad.12xlarge 48 384.00
r5ad.16xlarge 64 512.00
r5ad.24xlarge 96 768.00
r5b.large 2 16.00
r5b.xlarge 4 32.00
r5b.2xlarge 8 64.00
283
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
r5b.4xlarge 16 128.00
r5b.8xlarge 32 256.00
r5b.12xlarge 48 384.00
r5b.16xlarge 64 512.00
r5b.24xlarge 96 768.00
r5b.metal 96 768.00
r5d.large 2 16.00
r5d.xlarge 4 32.00
r5d.2xlarge 8 64.00
r5d.4xlarge 16 128.00
r5d.8xlarge 32 256.00
r5d.12xlarge 48 384.00
r5d.16xlarge 64 512.00
r5d.24xlarge 96 768.00
r5d.metal 96 768.00
r5dn.large 2 16.00
r5dn.xlarge 4 32.00
r5dn.2xlarge 8 64.00
r5dn.4xlarge 16 128.00
r5dn.8xlarge 32 256.00
r5dn.12xlarge 48 384.00
r5dn.16xlarge 64 512.00
r5dn.24xlarge 96 768.00
r5dn.metal 96 768.00
r5n.large 2 16.00
r5n.xlarge 4 32.00
r5n.2xlarge 8 64.00
r5n.4xlarge 16 128.00
r5n.8xlarge 32 256.00
r5n.12xlarge 48 384.00
r5n.16xlarge 64 512.00
284
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
r5n.24xlarge 96 768.00
r5n.metal 96 768.00
r6a.large 2 16.00
r6a.xlarge 4 32.00
r6a.2xlarge 8 64.00
r6a.4xlarge 16 128.00
r6a.8xlarge 32 256.00
r6a.12xlarge 48 384.00
r6a.16xlarge 64 512.00
r6a.24xlarge 96 768.00
r6i.large 2 16.00
r6i.xlarge 4 32.00
r6i.2xlarge 8 64.00
r6i.4xlarge 16 128.00
r6i.8xlarge 32 256.00
r6i.12xlarge 48 384.00
r6i.16xlarge 64 512.00
r6i.24xlarge 96 768.00
r6idn.large 2 16.00
r6idn.xlarge 4 32.00
r6idn.2xlarge 8 64.00
r6idn.4xlarge 16 128.00
r6idn.8xlarge 32 256.00
r6idn.12xlarge 48 384.00
r6idn.16xlarge 64 512.00
r6idn.24xlarge 96 768.00
285
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
r6in.large 2 16.00
r6in.xlarge 4 32.00
r6in.2xlarge 8 64.00
r6in.4xlarge 16 128.00
r6in.8xlarge 32 256.00
r6in.12xlarge 48 384.00
r6in.16xlarge 64 512.00
r6in.24xlarge 96 768.00
r6id.large 2 16.00
r6id.xlarge 4 32.00
r6id.2xlarge 8 64.00
r6id.4xlarge 16 128.00
r6id.8xlarge 32 256.00
r6id.12xlarge 48 384.00
r6id.16xlarge 64 512.00
r6id.24xlarge 96 768.00
286
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
x1.16xlarge 64 976.00
x2idn.16xlarge 64 1024.00
x2idn.24xlarge 96 1536.00
x2iedn.xlarge 4 128.00
x2iedn.2xlarge 8 256.00
x2iedn.4xlarge 16 512.00
x2iedn.8xlarge 32 1024.00
x2iedn.16xlarge 64 2048.00
x2iedn.24xlarge 96 3072.00
x2iezn.2xlarge 8 256.00
x2iezn.4xlarge 16 512.00
x2iezn.6xlarge 24 768.00
x2iezn.8xlarge 32 1024.00
x2iezn.12xlarge 48 1536.00
x2iezn.metal 48 1536.00
x1e.xlarge 4 122.00
x1e.2xlarge 8 244.00
x1e.4xlarge 16 488.00
x1e.8xlarge 32 976.00
x1e.16xlarge 64 1952.00
z1d.large 2 16.00
z1d.xlarge 4 32.00
z1d.2xlarge 8 64.00
z1d.3xlarge 12 96.00
287
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
z1d.6xlarge 24 192.00
z1d.12xlarge 48 384.00
z1d.metal 48 384.00
AMD processors
• AMD EPYC 7000 series processors (AMD EPYC 7571): R5a, R5ad
• 3rd generation AMD EPYC processors (AMD EPYC 7R13): R6a
Intel processors
Memory performance
X1 instances include Intel Scalable Memory Buffers, providing 300 GiB/s of sustainable memory-read
bandwidth and 140 GiB/s of sustainable memory-write bandwidth.
For more information about how much RAM can be enabled for memory optimized instances, see
Hardware specifications (p. 282).
Memory optimized instances have high memory and require 64-bit HVM AMIs to take advantage of that
capacity. HVM AMIs provide superior performance in comparison to paravirtual (PV) AMIs on memory
optimized instances. .
Instance performance
Memory optimized instances enable increased cryptographic performance through the latest Intel AES-
NI feature and support Advanced Vector Extensions 2 (Intel AVX2) processor instructions to expand most
integer commands to 256 bits.
Network performance
You can enable enhanced networking on supported instance types to provide lower latencies, lower
network jitter, and higher packet-per-second (PPS) performance. Most applications do not consistently
need a high level of network performance, but can benefit from access to increased bandwidth when
they send or receive data. For more information, see Enhanced networking on Windows (p. 1278).
288
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
The following is a summary of network performance for memory optimized instances that support
enhanced networking.
Note
Instance types indicated with a † have a baseline bandwidth and can use a network I/O
credit mechanism to burst beyond their baseline bandwidth on a best effort basis. For more
information, see instance network bandwidth (p. 1276).
289
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
290
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
291
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
292
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
293
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
For 32xlarge and metal instance types that support 200 Gbps, at least 2 ENIs, each attached to a
different network card, are required on the instance to achieve 200 Gbps throughput. Each ENI attached
to a network card can achieve a max of 170 Gbps.
u-6tb1.metal, u-9tb1.metal, and u-12tb1.metal instances launched after March 12, 2020 provide
network performance of 100 Gbps. u-6tb1.metal, u-9tb1.metal, and u-12tb1.metal instances
launched before March 12, 2020 mightonly provide network performance of 25 Gbps. To ensure that
instances launched before March 12, 2020 have a network performance of 100 Gbps, contact your
account team to upgrade your instance at no additional cost.
The following table shows the baseline and burst bandwidth for instance types that use the network I/O
credit mechanism to burst beyond their baseline bandwidth.
294
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
295
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
296
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
297
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
298
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
As you fill the SSD-based instance store volumes for your instance, the number of write IOPS that
you can achieve decreases. This is due to the extra work the SSD controller must do to find available
space, rewrite existing data, and erase unused space so that it can be rewritten. This process of
garbage collection results in internal write amplification to the SSD, expressed as the ratio of SSD write
operations to user write operations. This decrease in performance is even larger if the write operations
are not in multiples of 4,096 bytes or not aligned to a 4,096-byte boundary. If you write a smaller
amount of bytes or bytes that are not aligned, the SSD controller must read the surrounding data and
store the result in a new location. This pattern results in significantly increased write amplification,
increased latency, and dramatically reduced I/O performance.
SSD controllers can use several strategies to reduce the impact of write amplification. One such strategy
is to reserve space in the SSD instance storage so that the controller can more efficiently manage the
space available for write operations. This is called over-provisioning. The SSD-based instance store
volumes provided to an instance don't have any space reserved for over-provisioning. To reduce write
amplification, we recommend that you leave 10% of the volume unpartitioned so that the SSD controller
can use it for over-provisioning. This decreases the storage that you can use, but increases performance
even if the disk is close to full capacity.
For instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller whenever you no longer need data that you've written. This provides the controller with more
299
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Memory optimized
free space, which can reduce write amplification and increase performance. For more information, see
Instance store volume TRIM support (p. 1822).
In addition, you can implement high availability (HA) and disaster recovery (DR) solutions to meet
recovery point objective (RPO), recovery time objective (RTO), and cost requirements by leveraging
Amazon CloudFormation and Recover your instance (p. 606).
If you run an SAP HANA production environment, you also have the option of using HANA System
Replication (HSR) on X1 instances. For more information about architecting HA and DR solutions on X1
instances, see SAP HANA on the Amazon Web Services Cloud: Quick Start Reference Deployment.
Release notes
• Instances built on the Nitro System have the following requirements:
• NVMe drivers (p. 1750) must be installed
• Elastic Network Adapter (ENA) drivers (p. 1279) must be installed
The current AWS Windows AMIs (p. 34) meet these requirements.
• To get the best performance from your R6i instances, ensure that they have ENA driver version 2.2.3
or later. Using an ENA driver earlier than version 2.0.0 with these instances causes network interface
attachment failures. The following AMIs have a compatible ENA driver.
• AWS Windows AMI from May 2021 or later
• Instances built on the Nitro System instances support a maximum of 28 attachments, including
network interfaces, EBS volumes, and NVMe instance store volumes. For more information, see Nitro
System volume limits (p. 1828).
300
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
• All io2 volumes attached to C6a, C6in, C7g, Inf2, M6a, M6in, M6idn, M7g, R5b, R6in, R6idn, R7g, Trn1,
Trn1n, X2idn, and X2iedn instances, during or after launch, automatically run on EBS Block Express. For
more information, see io2 Block Express volumes.
• Launching a bare metal instance boots the underlying server, which includes verifying all hardware and
firmware components. This means that it can take 20 minutes from the time the instance enters the
running state until it becomes available over the network.
• To attach or detach EBS volumes or secondary network interfaces from a bare metal instance requires
PCIe native hotplug support.
• Bare metal instances use a PCI-based serial device rather than an I/O port-based serial device. The
upstream Linux kernel and the latest Amazon Linux AMIs support this device. Bare metal instances also
provide an ACPI SPCR table to enable the system to automatically use the PCI-based serial device. The
latest Windows AMIs automatically use the PCI-based serial device.
• You can't launch X1 instances using a Windows Server 2008 SP2 64-bit AMI, except for x1.16xlarge
instances.
• You can't launch X1e instances using a Windows Server 2008 SP2 64-bit AMI.
• With earlier versions of the Windows Server 2008 R2 64-bit AMI, you can't launch r4.large and
r4.4xlarge instances. If you experience this issue, update to the latest version of this AMI.
• There is a limit on the total number of instances that you can launch in a Region, and there are
additional limits on some instance types. For more information, see How many instances can I run in
Amazon EC2? in the Amazon EC2 FAQ.
D2 instances
These instances offer scale out of instance storage and are well suited for the following:
H1 instances
301
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
Bare metal instances provide your applications with direct access to physical resources of the host server,
such as processors and memory.
I4i instances
These instances are well suited for I/O intensive workloads that require small to medium sized data sets
on local storage, such as transactional databases and NoSQL databases.
Contents
• Hardware specifications (p. 302)
• Instance performance (p. 304)
• Network performance (p. 304)
• Amazon EBS I/O performance (p. 307)
• SSD-based instance store volume I/O performance (p. 307)
• Release notes (p. 309)
Hardware specifications
The following is a summary of the hardware specifications for storage optimized instances. A virtual
central processing unit (vCPU) represents a portion of the physical CPU assigned to a virtual machine
(VM). For x86 instances, there are two vCPUs per core. For Graviton instances, there is one vCPU per core.
d2.xlarge 4 30.50
d2.2xlarge 8 61.00
d2.4xlarge 16 122.00
d2.8xlarge 36 244.00
d3.xlarge 4 32.00
d3.2xlarge 8 64.00
d3.4xlarge 16 128.00
d3.8xlarge 32 256.00
d3en.xlarge 4 16.00
302
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
d3en.2xlarge 8 32.00
d3en.4xlarge 16 64.00
d3en.6xlarge 24 96.00
d3en.8xlarge 32 128.00
d3en.12xlarge 48 192.00
h1.2xlarge 8 32.00
h1.4xlarge 16 64.00
h1.8xlarge 32 128.00
h1.16xlarge 64 256.00
hs1.8xlarge 16 117.00
i2.xlarge 4 30.50
i2.2xlarge 8 61.00
i2.4xlarge 16 122.00
i2.8xlarge 32 244.00
i3.large 2 15.25
i3.xlarge 4 30.50
i3.2xlarge 8 61.00
i3.4xlarge 16 122.00
i3.8xlarge 32 244.00
i3.16xlarge 64 488.00
i3.metal 72 512.00
i3en.large 2 16.00
i3en.xlarge 4 32.00
i3en.2xlarge 8 64.00
i3en.3xlarge 12 96.00
i3en.6xlarge 24 192.00
i3en.12xlarge 48 384.00
i3en.24xlarge 96 768.00
i3en.metal 96 768.00
i4i.large 2 16.00
i4i.xlarge 4 32.00
303
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
i4i.2xlarge 8 64.00
i4i.4xlarge 16 128.00
i4i.8xlarge 32 256.00
i4i.16xlarge 64 512.00
Intel processors
Instance performance
For instances with NVMe instance store volumes, be sure to use the AWS NVMe driver. For more
information, see AWS NVMe drivers for Windows instances (p. 758).
EBS-optimized instances enable you to get consistently high performance for your EBS volumes by
eliminating contention between Amazon EBS I/O and other network traffic from your instance. Some
storage optimized instances are EBS-optimized by default at no additional cost. For more information,
see Amazon EBS–optimized instances (p. 1752).
Network performance
You can enable enhanced networking on supported instance types to provide lower latencies, lower
network jitter, and higher packet-per-second (PPS) performance. Most applications do not consistently
need a high level of network performance, but can benefit from access to increased bandwidth when
they send or receive data. For more information, see Enhanced networking on Windows (p. 1278).
The following is a summary of network performance for storage optimized instances that support
enhanced networking.
Note
Instance types indicated with a † have a baseline bandwidth and can use a network I/O
credit mechanism to burst beyond their baseline bandwidth on a best effort basis. For more
information, see instance network bandwidth (p. 1276).
304
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
305
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
The following table shows the baseline and burst bandwidth for instance types that use the network I/O
credit mechanism to burst beyond their baseline bandwidth.
306
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
Instance store volumes persist only for the life of the instance. When you stop, hibernate, or terminate
an instance, the applications and data in its instance store volumes are erased. We recommend that you
regularly back up or replicate important data in your instance store volumes. For more information, see
Amazon EC2 instance store (p. 1805) and SSD instance store volumes (p. 1821).
If you use all the SSD-based instance store volumes available to your instance, you can get up to the
IOPS (4,096 byte block size) performance listed in the following table (at queue depth saturation).
Otherwise, you get lower IOPS performance.
307
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage optimized
As you fill your SSD-based instance store volumes, the I/O performance that you get decreases. This is
due to the extra work that the SSD controller must do to find available space, rewrite existing data, and
erase unused space so that it can be rewritten. This process of garbage collection results in internal write
amplification to the SSD, expressed as the ratio of SSD write operations to user write operations. This
decrease in performance is even larger if the write operations are not in multiples of 4,096 bytes or not
aligned to a 4,096-byte boundary. If you write a smaller amount of bytes or bytes that are not aligned,
the SSD controller must read the surrounding data and store the result in a new location. This pattern
results in significantly increased write amplification, increased latency, and dramatically reduced I/O
performance.
SSD controllers can use several strategies to reduce the impact of write amplification. One such strategy
is to reserve space in the SSD instance storage so that the controller can more efficiently manage the
space available for write operations. This is called over-provisioning. The SSD-based instance store
volumes provided to an instance don't have any space reserved for over-provisioning. To reduce write
amplification, we recommend that you leave 10% of the volume unpartitioned so that the SSD controller
can use it for over-provisioning. This decreases the storage that you can use, but increases performance
even if the disk is close to full capacity.
For instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller whenever you no longer need data that you've written. This provides the controller with more
308
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
free space, which can reduce write amplification and increase performance. For more information, see
Instance store volume TRIM support (p. 1822).
For a comparison of the volume size across all instance types that support instance store volumes, see
the Available instance store volumes (p. 1808) table.
Release notes
• Instances built on the Nitro System (p. 210) have the following requirements:
• NVMe drivers (p. 1750) must be installed
• Elastic Network Adapter (ENA) drivers (p. 1279) must be installed
The current AWS Windows AMIs (p. 34) meet these requirements.
• Launching a bare metal instance boots the underlying server, which includes verifying all hardware and
firmware components. This means that it can take 20 minutes from the time the instance enters the
running state until it becomes available over the network.
• To attach or detach EBS volumes or secondary network interfaces from a bare metal instance requires
PCIe native hotplug support.
• Bare metal instances use a PCI-based serial device rather than an I/O port-based serial device. The
upstream Linux kernel and the latest Amazon Linux AMIs support this device. Bare metal instances also
provide an ACPI SPCR table to enable the system to automatically use the PCI-based serial device. The
latest Windows AMIs automatically use the PCI-based serial device.
• The d3.8xlarge and d3en.12xlarge instances support a maximum of three attachments, including
the root volume. If you exceed the attachment limit when you add a network interface or EBS volume,
this causes attachment issues on your instance.
• There is a limit on the total number of instances that you can launch in a Region, and there are
additional limits on some instance types. For more information, see How many instances can I run in
Amazon EC2? in the Amazon EC2 FAQ.
If you require high processing capability, you'll benefit from using accelerated computing instances,
which provide access to hardware-based compute accelerators such as Graphics Processing Units (GPUs).
Contents
• GPU instances (p. 310)
• Instances with AWS Trainium (p. 311)
• Hardware specifications (p. 311)
• Instance performance (p. 313)
• Network performance (p. 313)
• Amazon EBS I/O performance (p. 315)
• SSD-based instance store volume I/O performance (p. 315)
• Release notes (p. 316)
• Install NVIDIA drivers on Windows instances (p. 317)
• Install AMD drivers on Windows instances (p. 324)
• Activate NVIDIA GRID Virtual Applications (p. 326)
• Optimize GPU settings (p. 326)
309
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
GPU instances
GPU-based instances provide access to NVIDIA GPUs with thousands of compute cores. You can use
these instances to accelerate scientific, engineering, and rendering applications by leveraging the
CUDA or Open Computing Language (OpenCL) parallel computing frameworks. You can also use them
for graphics applications, including game streaming, 3-D application streaming, and other graphics
workloads.
If your application needs a small amount of additional graphics acceleration, but is better suited for
an instance type with different compute, memory, or storage specifications, use an Elastic Graphics
accelerator instead. For more information, see Amazon Elastic Graphics (p. 1089).
G5 instances
G5 instances use NVIDIA A10G GPUs and provide high performance for graphics-intensive applications
such as remote workstations, video rendering, and cloud gaming, and deep learning models for
applications such as natural language processing, computer vision, and recommendation engines. These
instances feature up to 8 NVIDIA A10G GPUs, second generation AMD EPYC processors, up to 100 Gbps
of network bandwidth, and up to 7.6 TB of local NVMe SSD storage.
G4ad instances use AMD Radeon Pro V520 GPUs and 2nd generation AMD EPYC processors, and are well-
suited for graphics applications such as remote graphics workstations, game streaming, and rendering
that leverage industry-standard APIs such as OpenGL, DirectX, and Vulkan. They provide up to 4 AMD
Radeon Pro V520 GPUs, 64 vCPUs, 25 Gbps networking, and 2.4 TB local NVMe-based SSD storage.
G4dn instances use NVIDIA Tesla GPUs and provide a cost-effective, high-performance platform for
general purpose GPU computing using the CUDA or machine learning frameworks along with graphics
applications using DirectX or OpenGL. These instances provide high- bandwidth networking, powerful
half and single-precision floating-point capabilities, along with INT8 and INT4 precisions. Each GPU has
16 GiB of GDDR6 memory, making G4dn instances well-suited for machine learning inference, video
transcoding, and graphics applications like remote graphics workstations and game streaming in the
cloud.
G4dn instances support NVIDIA GRID Virtual Workstation. For more information, see NVIDIA Marketplace
offerings.
G3 instances
These instances use NVIDIA Tesla M60 GPUs and provide a cost-effective, high-performance platform
for graphics applications using DirectX or OpenGL. G3 instances also provide NVIDIA GRID Virtual
Workstation features, such as support for four monitors with resolutions up to 4096x2160, and NVIDIA
GRID Virtual Applications. G3 instances are well-suited for applications such as 3D visualizations,
graphics-intensive remote workstations, 3D rendering, video encoding, virtual reality, and other server-
side graphics workloads requiring massively parallel processing power.
G3 instances support NVIDIA GRID Virtual Workstation and NVIDIA GRID Virtual Applications. To activate
either of these features, see Activate NVIDIA GRID Virtual Applications (p. 326).
G2 instances
These instances use NVIDIA GRID K520 GPUs and provide a cost-effective, high-performance platform
for graphics applications using DirectX or OpenGL. NVIDIA GRID GPUs also support NVIDIA’s fast capture
and encode API operations. Example applications include video creation services, 3D visualizations,
streaming graphics-intensive applications, and other server-side graphics workloads.
310
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
P3 instances
These instances use NVIDIA Tesla V100 GPUs and are designed for general purpose GPU computing
using the CUDA or OpenCL programming models or through a machine learning framework. P3
instances provide high-bandwidth networking, powerful half, single, and double-precision floating-
point capabilities, and up to 32 GiB of memory per GPU, which makes them ideal for deep learning,
computational fluid dynamics, computational finance, seismic analysis, molecular modeling, genomics,
rendering, and other server-side GPU compute workloads. Tesla V100 GPUs do not support graphics
mode.
P3 instances support NVIDIA NVLink peer to peer transfers. For more information, see NVIDIA NVLink.
P2 instances
P2 instances use NVIDIA Tesla K80 GPUs and are designed for general purpose GPU computing using
the CUDA or OpenCL programming models. P2 instances provide high-bandwidth networking, powerful
single and double precision floating-point capabilities, and 12 GiB of memory per GPU, which makes
them ideal for deep learning, graph databases, high-performance databases, computational fluid
dynamics, computational finance, seismic analysis, molecular modeling, genomics, rendering, and other
server-side GPU compute workloads.
P2 instances support NVIDIA GPUDirect peer to peer transfers. For more information, see NVIDIA
GPUDirect.
Hardware specifications
The following is a summary of the hardware specifications for accelerated computing instances. A virtual
central processing unit (vCPU) represents a portion of the physical CPU assigned to a virtual machine
(VM). For x86 instances, there are two vCPUs per core. For Graviton instances, there is one vCPU per core.
311
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
Note
Trn1n instances feature the following number of Trainium Accelerators.
312
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
• trn1n.32xlarge — 16
• trn1.2xlarge — 1
• trn1.32xlarge — 16
• vt1.3xlarge — 1
• vt1.6xlarge — 2
• vt1.24xlarge — 16
AMD processors
Intel processors
Instance performance
EBS-optimized instances enable you to get consistently high performance for your EBS volumes
by eliminating contention between Amazon EBS I/O and other network traffic from your instance.
Some accelerated computing instances are EBS-optimized by default at no additional cost. For more
information, see Amazon EBS–optimized instances (p. 1752).
Network performance
You can enable enhanced networking on supported instance types to provide lower latencies, lower
network jitter, and higher packet-per-second (PPS) performance. Most applications do not consistently
need a high level of network performance, but can benefit from access to increased bandwidth when
they send or receive data. For more information, see Enhanced networking on Windows (p. 1278).
The following is a summary of network performance for accelerated computing instances that support
enhanced networking.
Note
Instance types indicated with a † have a baseline bandwidth and can use a network I/O
credit mechanism to burst beyond their baseline bandwidth on a best effort basis. For more
information, see instance network bandwidth (p. 1276).
313
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
The following table shows the baseline and burst bandwidth for instance types that use the network I/O
credit mechanism to burst beyond their baseline bandwidth.
314
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
315
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
As you fill the SSD-based instance store volumes for your instance, the number of write IOPS that
you can achieve decreases. This is due to the extra work the SSD controller must do to find available
space, rewrite existing data, and erase unused space so that it can be rewritten. This process of
garbage collection results in internal write amplification to the SSD, expressed as the ratio of SSD write
operations to user write operations. This decrease in performance is even larger if the write operations
are not in multiples of 4,096 bytes or not aligned to a 4,096-byte boundary. If you write a smaller
amount of bytes or bytes that are not aligned, the SSD controller must read the surrounding data and
store the result in a new location. This pattern results in significantly increased write amplification,
increased latency, and dramatically reduced I/O performance.
SSD controllers can use several strategies to reduce the impact of write amplification. One such strategy
is to reserve space in the SSD instance storage so that the controller can more efficiently manage the
space available for write operations. This is called over-provisioning. The SSD-based instance store
volumes provided to an instance don't have any space reserved for over-provisioning. To reduce write
amplification, we recommend that you leave 10% of the volume unpartitioned so that the SSD controller
can use it for over-provisioning. This decreases the storage that you can use, but increases performance
even if the disk is close to full capacity.
For instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller whenever you no longer need data that you've written. This provides the controller with more
free space, which can reduce write amplification and increase performance. For more information, see
Instance store volume TRIM support (p. 1822).
Release notes
• You must launch the instance using an HVM AMI.
• Instances built on the Nitro System (p. 210) have the following requirements:
• NVMe drivers (p. 1750) must be installed
• Elastic Network Adapter (ENA) drivers (p. 1279) must be installed
The current AWS Windows AMIs (p. 34) meet these requirements.
• GPU-based instances can't access the GPU unless the NVIDIA drivers are installed. For more
information, see Install NVIDIA drivers on Windows instances (p. 317).
• Launching a bare metal instance boots the underlying server, which includes verifying all hardware and
firmware components. This means that it can take 20 minutes from the time the instance enters the
running state until it becomes available over the network.
• To attach or detach EBS volumes or secondary network interfaces from a bare metal instance requires
PCIe native hotplug support.
• Bare metal instances use a PCI-based serial device rather than an I/O port-based serial device. The
upstream Linux kernel and the latest Amazon Linux AMIs support this device. Bare metal instances also
provide an ACPI SPCR table to enable the system to automatically use the PCI-based serial device. The
latest Windows AMIs automatically use the PCI-based serial device.
• There is a limit of 100 AFIs per Region.
• There is a limit on the total number of instances that you can launch in a Region, and there are
additional limits on some instance types. For more information, see How many instances can I run in
Amazon EC2? in the Amazon EC2 FAQ.
• If you launch a multi-GPU instance with a Windows AMI that was created on a single-GPU instance,
Windows does not automatically install the NVIDIA driver for all GPUs. You must authorize the driver
316
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
installation for the new GPU hardware. You can correct this manually in the Device Manager by
opening the Other device category (the inactive GPUs do not appear under Display Adapters). For
each inactive GPU, open the context (right-click) menu, choose Update Driver Software, and then
choose the default Automatic Update option.
• When using Microsoft Remote Desktop Protocol (RDP), GPUs that use the WDDM driver model are
replaced with a non-accelerated Remote Desktop display driver. We recommend that you use a
different remote access tool to access your GPU, such as Teradici Cloud Access Software, NICE Desktop
Cloud Visualization (DCV), or VNC. You can also use one of the GPU AMIs from the AWS Marketplace
because they provide remote access tools that support 3D acceleration.
To install AMD drivers on a Linux instance with an attached AMD GPU, such as a G4ad instance, see
Install AMD drivers (p. 324) instead. To install NVIDIA drivers on a Linux instance, see Install NVIDIA
drivers on a Linux instance.
Contents
• Types of NVIDIA drivers (p. 317)
• Available drivers by instance type (p. 318)
• Installation options (p. 318)
• Install an additional version of CUDA (p. 323)
Tesla drivers
These drivers are intended primarily for compute workloads, which use GPUs for computational
tasks such as parallelized floating-point calculations for machine learning and fast Fourier
transforms for high performance computing applications.
GRID drivers
These drivers are certified to provide optimal performance for professional visualization applications
that render content such as 3D models or high-resolution videos. You can configure GRID drivers to
support two modes. Quadro Virtual Workstations provide access to four 4K displays per GPU. GRID
vApps provide RDSH App hosting capabilities.
Gaming drivers
These drivers contain optimizations for gaming and are updated frequently to provide performance
enhancements. They support a single 4K display per GPU.
Configured mode
317
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
On Windows, the Tesla drivers are configured to run in Tesla Compute Cluster (TCC) mode. The GRID and
gaming drivers are configured to run in Windows Display Driver Model (WDDM) mode. In TCC mode, the
card is dedicated to compute workloads. In WDDM mode, the card supports both compute and graphics
workloads.
The NVIDIA control panel is supported with GRID and Gaming drivers. It is not supported with Tesla
drivers.
• OpenCL
• NVIDIA CUDA and related libraries (for example, cuDNN, TensorRT, nvJPEG, and cuBLAS)
• NVENC for video encoding and NVDEC for video decoding
G2 Yes No No
G3 Yes Yes No
P2 Yes No No
P3 Yes Yes ² No
¹ This Tesla driver also supports optimized graphics applications specific to the ARM64 platform
Installation options
Use one of the following options to get the NVIDIA drivers required for your GPU instance.
AWS and NVIDIA offer different Amazon Machine Images (AMI) that come with the NVIDIA drivers
installed.
318
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
If you create a custom Windows AMI using one of the AWS Marketplace offerings, the AMI must be a
standardized image created using Sysprep (p. 146) to ensure that the GRID driver works.
The options offered by AWS come with the necessary license for the driver. Alternatively, you can install
the public drivers and bring your own license. To install a public driver, download it from the NVIDIA site
as described here.
Alternatively, you can use the options offered by AWS instead of the public drivers. To use a GRID driver
on a P3 instance, use the AWS Marketplace AMIs as described in Option 1 (p. 318). To use a GRID driver
on a G5, G4dn, or G3 instance, use the AWS Marketplace AMIs, as described in Option 1 or install the
NVIDIA drivers provided by AWS as described in Option 3 (p. 319).
Log on to your Windows instance and download the 64-bit NVIDIA driver appropriate for the instance
type from http://www.nvidia.com/Download/Find.aspx. For Product Type, Product Series, and Product,
use the options in the following table.
1. Open the folder where you downloaded the driver and launch the installation file. Follow the
instructions to install the driver and reboot your instance as required.
2. Disable the display adapter named Microsoft Basic Display Adapter that is marked with a warning
icon using Device Manager. Install these Windows features: Media Foundation and Quality
Windows Audio Video Experience.
Important
Don't disable the display adapter named Microsoft Remote Display Adapter. If Microsoft
Remote Display Adapter is disabled your connection might be interrupted and attempts to
connect to the instance after it has rebooted might fail.
3. Check Device Manager to verify that the GPU is working correctly.
4. To achieve the best performance from your GPU, complete the optimization steps in Optimize GPU
settings (p. 326).
These downloads are available to AWS customers only. By downloading, you agree to use the
downloaded software only to develop AMIs for use with the NVIDIA A10G, NVIDIA Tesla T4, or NVIDIA
319
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
Tesla M60 hardware. Upon installation of the software, you are bound by the terms of the NVIDIA GRID
Cloud End User License Agreement.
Prerequisites
• If you launch your Windows instance using a custom Windows AMI, the AMI must be a standardized
image created using Sysprep (p. 146) to ensure that the GRID driver works.
• Configure default credentials for the AWS Tools for Windows PowerShell on your Windows instance.
For more information, see Getting Started with the AWS Tools for Windows PowerShell in the AWS
Tools for Windows PowerShell User Guide.
• Your user or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess
policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon
Simple Storage Service User Guide.
• G3 instances require AWS provided DNS resolution for GRID licensing to work.
• IMDSv2 (p. 818) is only supported with NVIDIA driver version 14.0 or greater.
$Bucket = "ec2-windows-nvidia-drivers"
$KeyPrefix = "latest"
$LocalPath = "$home\Desktop\NVIDIA"
$Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1
foreach ($Object in $Objects) {
$LocalFileName = $Object.Key
if ($LocalFileName -ne '' -and $Object.Size -ne 0) {
$LocalFilePath = Join-Path $LocalPath $LocalFileName
Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -
Region us-east-1
}
}
Multiple versions of the NVIDIA GRID driver are stored in this bucket. You can download all of the
available Windows versions in the bucket by removing the -KeyPrefix $KeyPrefix option. For
information about the version of the NVIDIA GRID driver for your operating system, see the NVIDIA®
Virtual GPU (vGPU) Software Documentation on the NVIDIA website.
Starting with GRID version 11.0, you can use the drivers under latest for both G3 and G4dn
instances. We will not add versions later than 11.0 to g4/latest, but will keep version 11.0 and the
earlier versions specific to G4dn under g4/latest.
PowerShell
Run the following PowerShell commands to create the registry value to disable the licensing page
in the control panel. The AWS Tools for PowerShell in AWS Windows AMIs defaults to the 32-bit
320
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
version and this command fails. Instead, use the 64-bit version of PowerShell included with the
operating system.
Command Prompt
Run the following registry command to create the registry value to disable the licensing page in the
control panel. You can run it using the Command Prompt window or a 64-bit version of PowerShell.
5. (Optional) Depending on your use case, you might complete the following optional steps. If you do
not require this functionality, do not complete these steps.
a. To help take advantage of the four displays of up to 4K resolution, set up the high-performance
display protocol, NICE DCV.
b. NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual
Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application
activation steps in Activate NVIDIA GRID Virtual Applications (p. 326).
These drivers are available to AWS customers only. By downloading them, you agree to use the
downloaded software only to develop AMIs for use with the NVIDIA A10G and NVIDIA Tesla T4 hardware.
Upon installation of the software, you are bound by the terms of the NVIDIA GRID Cloud End User
License Agreement.
Prerequisites
• If you launch your Windows instance using a custom Windows AMI, the AMI must be a standardized
image created using Sysprep (p. 146) to ensure that the gaming driver works.
• Configure default credentials for the AWS Tools for Windows PowerShell on your Windows instance.
For more information, see Getting Started with the AWS Tools for Windows PowerShell in the AWS
Tools for Windows PowerShell User Guide.
• Your users or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess
policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon
Simple Storage Service User Guide.
• G3 instances require AWS provided DNS resolution for GRID licensing to work.
• IMDSv2 (p. 818) is only supported with NVIDIA driver version 495.x or greater.
$Bucket = "nvidia-gaming"
$KeyPrefix = "windows/latest"
$LocalPath = "$home\Desktop\NVIDIA"
$Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1
foreach ($Object in $Objects) {
$LocalFileName = $Object.Key
321
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
Multiple versions of the NVIDIA GRID driver are stored in this S3 bucket. You can download all of the
available versions in the bucket if you change the value of the $KeyPrefix variable from "windows/
latest" to "windows".
3. Navigate to the desktop and double-click the installation file to launch it (choose the driver version
that corresponds to your instance OS version). Follow the instructions to install the driver and reboot
your instance as required. To verify that the GPU is working properly, check Device Manager.
4. Use one of the following methods to register the driver.
Create the following registry key with the 64-bit version of PowerShell, or the Command
Prompt window.
key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\Global
name: vGamingMarketplace
type: DWord
value: 2
PowerShell
Run the following PowerShell command to create this registry value. The AWS Tools for
PowerShell in AWS Windows AMIs defaults to the 32-bit version and this command fails.
Instead, use the 64-bit version of PowerShell included with the operating system.
Command Prompt
Run the following registry command to create this registry value. You can run it using the
Command Prompt window or a 64-bit version of PowerShell.
Earlier versions
Create the following registry key with the 64-bit version of PowerShell, or the Command
Prompt window.
name: vGamingMarketplace
type: DWord
value: 2
322
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
PowerShell
Run the following PowerShell command to create this registry value. The AWS Tools for
PowerShell in AWS Windows AMIs defaults to the 32-bit version and this command fails.
Instead, use the 64-bit version of PowerShell included with the operating system.
Command Prompt
Run the following registry command to create this registry key with the Command Prompt
window. You can also use this command in the 64-bit version of PowerShell.
5. Run the following command in PowerShell. This downloads the certification file, renames the
file GridSwCert.txt, and moves the file to the Public Documents folder on your system drive.
Typically, the folder path is C:\Users\Public\Documents.
• For version 461.40 or later:
"C:\Windows\System32\DriverStore\FileRepository\nvgrid*\\nvidia-smi.exe" -q
8. (Optional) To help take advantage of the single display of up to 4K resolution, set up the high-
performance display protocol NICE DCV. If you do not require this functionality, do not complete this
step.
323
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
To install NVIDIA drivers on an instance with an attached NVIDIA GPU, such as a G4dn instance, see
Install NVIDIA drivers (p. 317) instead. To install AMD drivers on a Linux instance, see Install AMD
drivers on a Linux instance.
Contents
• AMD Radeon Pro Software for Enterprise Driver (p. 324)
• AMIs with the AMD driver installed (p. 324)
• AMD driver download (p. 324)
Supported APIs
• OpenGL, OpenCL
• Vulkan
• DirectX 9 and later
• AMD Advanced Media Framework
• Microsoft Hardware Media Foundation Transform
324
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
These downloads are available to AWS customers only. By downloading, you agree to use the
downloaded software only to develop AMIs for use with the AMD Radeon Pro V520 hardware. Upon
installation of the software, you are bound by the terms of the AMD Software End User License
Agreement.
Prerequisites
• Configure default credentials for the AWS Tools for Windows PowerShell on your Windows instance.
For more information, see Getting Started with the AWS Tools for Windows PowerShell in the AWS
Tools for Windows PowerShell User Guide.
• Your user or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess
policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon
Simple Storage Service User Guide.
$Bucket = "ec2-amd-windows-drivers"
$KeyPrefix = "latest" # use "archives" for Windows Server 2016
$LocalPath = "$home\Desktop\AMD"
$Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1
foreach ($Object in $Objects) {
$LocalFileName = $Object.Key
if ($LocalFileName -ne '' -and $Object.Size -ne 0) {
$LocalFilePath = Join-Path $LocalPath $LocalFileName
Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -
Region us-east-1
}
}
3. Unzip the downloaded driver file and run the installer using the following PowerShell commands.
Now, check the content of the new directory. The directory name can be retrieved using the Get-
ChildItem PowerShell command.
Get-ChildItem "$home\Desktop\AMD\$KeyPrefix"
Directory: C:\Users\Administrator\Desktop\AMD\latest
4. Follow the instructions to install the driver and reboot your instance as required.
5. To verify that the GPU is working properly, check Device Manager. You should see "AMD Radeon Pro
V520 MxGPU" listed as a display adapter.
325
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Accelerated computing
6. To help take advantage of the four displays of up to 4K resolution, set up the high-performance
display protocol, NICE DCV.
cd "C:\Windows\System32\DriverStore\FileRepository\nvgrid*\"
2. [G2, G3, and P2 instances only] Disable the autoboost feature for all GPUs on the instance.
.\nvidia-smi --auto-boost-default=0
3. Set all GPU clock speeds to their maximum frequency. Use the memory and graphics clock speeds
specified in the following commands.
Some versions of the NVIDIA driver do not support setting the application clock speed, and display
the error "Setting applications clocks is not supported for GPU...", which you can
ignore.
• G3 instances:
326
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Find an instance type
• G4dn instances:
• G5 instances:
• P2 instances:
If you already have running EC2 instances, you can use AWS Compute Optimizer to get recommendations
about the instance types that you should use to improve performance, save money, or both. For more
information, see the section called “Get recommendations” (p. 328).
Tasks
• Find an instance type using the console (p. 327)
• Find an instance type using the AWS CLI (p. 328)
• Availability zones – The name of the Availability Zone, Local Zone, or Wavelength Zone. For more
information, see the section called “Regions and Zones” (p. 1175).
• vCPUs or Cores – The number of vCPUs or cores.
327
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get recommendations
1. If you have not done so already, install the AWS CLI For more information, see the AWS Command
Line Interface User Guide.
2. Use the describe-instance-types command to filter instance types based on instance attributes. For
example, you can use the following command to display only current generation instance types with
64 GiB (65536 MiB) of memory.
4. After locating the instance types that meet your needs, save the list so that you can use these
instance types when you launch instances. For more information, see Launching your instance in the
AWS Command Line Interface User Guide.
To make recommendations, Compute Optimizer analyzes your existing instance specifications and
utilization metrics. The compiled data is then used to recommend which Amazon EC2 instance types are
best able to handle the existing workload. Recommendations are returned along with per-hour instance
pricing.
This topic outlines how to view recommendations through the Amazon EC2 console. For more
information, see the AWS Compute Optimizer User Guide.
328
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get recommendations
Note
To get recommendations from Compute Optimizer, you must first opt in to Compute Optimizer.
For more information, see Getting Started with AWS Compute Optimizer in the AWS Compute
Optimizer User Guide.
Contents
• Limitations (p. 329)
• Findings (p. 329)
• View recommendations (p. 329)
• Considerations for evaluating recommendations (p. 330)
• Additional resources (p. 331)
Limitations
Compute Optimizer currently generates recommendations for C, D, H, I, M, R, T, X, and z instance types.
Other instance types are not considered by Compute Optimizer. If you're using other instance types, they
will not be listed in the Compute Optimizer recommendations view. For more information about the
supported and unsupported instance types, see Amazon EC2 instance requirements in the AWS Compute
Optimizer User Guide.
Findings
Compute Optimizer classifies its findings for EC2 instances as follows:
View recommendations
After you opt in to Compute Optimizer, you can view the findings that Compute Optimizer generates for
your EC2 instances in the EC2 console. You can then access the Compute Optimizer console to view the
recommendations. If you recently opted in, findings might not be reflected in the EC2 console for up to
12 hours.
329
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get recommendations
3. On the instance summary page, in the AWS Compute Optimizer banner near the bottom of the
page, choose View detail.
The instance opens in Compute Optimizer, where it is labeled as the Current instance. Up to three
different instance type recommendations, labeled Option 1, Option 2, and Option 3, are provided.
The bottom half of the window shows recent CloudWatch metric data for the current instance: CPU
utilization, Memory utilization, Network in, and Network out.
4.
(Optional) In the Compute Optimizer console, choose the settings icon ( ) to change the visible
columns in the table, or to view the public pricing information for a different purchasing option for
the current and recommended instance types.
Note
If you’ve purchased a Reserved Instance, your On-Demand Instance might be billed as a
Reserved Instance. Before you change your current instance type, first evaluate the impact
on Reserved Instance utilization and coverage.
Determine whether you want to use one of the recommendations. Decide whether to optimize for
performance improvement, for cost reduction, or for a combination of the two. For more information,
see Viewing Resource Recommendations in the AWS Compute Optimizer User Guide.
To view recommendations for all EC2 instances across all Regions through the Compute
Optimizer console
a. To filter recommendations to one or more AWS Regions, enter the name of the Region in the
Filter by one or more Regions text box, or choose one or more Regions in the drop-down list
that appears.
b. To view recommendations for resources in another account, choose Account, and then select a
different account ID.
This option is available only if you are signed in to a management account of an organization,
and you opted in all member accounts within the organization.
c. To clear the selected filters, choose Clear filters.
d. To change the purchasing option that is displayed for the current and recommended instance
types, choose the settings icon ( ) , and then choose On-Demand Instances, Reserved
Instances, standard 1-year no upfront, or Reserved Instances, standard 3-year no upfront.
e. To view details, such as additional recommendations and a comparison of utilization metrics,
choose the finding (Under-provisioned, Over-provisioned, or Optimized) listed next to the
desired instance. For more information, see Viewing Resource Details in the AWS Compute
Optimizer User Guide.
• The recommendations don’t forecast your usage. Recommendations are based on your historical usage
over the most recent 14-day time period. Be sure to choose an instance type that is expected to meet
your future resource needs.
• Focus on the graphed metrics to determine whether actual usage is lower than instance capacity.
You can also view metric data (average, peak, percentile) in CloudWatch to further evaluate your EC2
330
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the instance type
instance recommendations. For example, notice how CPU percentage metrics change during the day
and whether there are peaks that need to be accommodated. For more information, see Viewing
Available Metrics in the Amazon CloudWatch User Guide.
• Compute Optimizer might supply recommendations for burstable performance instances, which are
T3, T3a, and T2 instances. If you periodically burst above the baseline, make sure that you can continue
to do so based on the vCPUs of the new instance type. For more information, see Key concepts and
definitions for burstable performance instances (p. 236).
• If you’ve purchased a Reserved Instance, your On-Demand Instance might be billed as a Reserved
Instance. Before you change your current instance type, first evaluate the impact on Reserved Instance
utilization and coverage.
• Consider conversions to newer generation instances, where possible.
• When migrating to a different instance family, make sure the current instance type and the new
instance type are compatible, for example, in terms of virtualization, architecture, or network type. For
more information, see Compatibility for changing the instance type (p. 334).
• Finally, consider the performance risk rating that's provided for each recommendation. Performance
risk indicates the amount of effort you might need to spend in order to validate whether the
recommended instance type meets the performance requirements of your workload. We also
recommend rigorous load and performance testing before and after making any changes.
There are other considerations when resizing an EC2 instance. For more information, see Change the
instance type (p. 331).
Additional resources
For more information:
If you want a recommendation for an instance type that is best able to handle your existing workload,
you can use AWS Compute Optimizer. For more information, see Get recommendations for an instance
type (p. 328).
When you change the instance type, you'll start paying the rate of the new instance type. For the on-
demand rates of all instance types, see Amazon EC2 On-Demand Pricing.
If you want to add additional storage to your instance without changing the instance type, see Attach an
Amazon EBS volume to an instance (p. 1542).
331
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the instance type
Not compatible Change the instance type by launching a new instance (p. 333)
• We recommend that you update the AWS PV driver package before changing the instance type. For
more information, see Upgrade PV drivers on Windows instances (p. 745).
• You must stop your Amazon EBS-backed instance before you can change its instance type. Ensure
that you plan for downtime while your instance is stopped. Stopping the instance and changing its
instance type might take a few minutes, and restarting your instance might take a variable amount of
time depending on your application's startup scripts. For more information, see Stop and start your
instance (p. 580).
• When you stop and start an instance, we move the instance to new hardware. If your instance has a
public IPv4 address, we release the address and give your instance a new public IPv4 address. If you
require a public IPv4 address that does not change, use an Elastic IP address (p. 1233).
• You can't change the instance type if hibernation (p. 586) is enabled for the instance.
• You can't change the instance type of a Spot Instance (p. 407).
• If your instance is in an Auto Scaling group, the Amazon EC2 Auto Scaling service marks the stopped
instance as unhealthy, and may terminate it and launch a replacement instance. To prevent this, you
can suspend the scaling processes for the group while you're changing the instance type. For more
information, see Suspending and resuming a process for an Auto Scaling group in the Amazon EC2
Auto Scaling User Guide.
• When you change the instance type of an instance with NVMe instance store volumes, the updated
instance might have additional instance store volumes, because all NVMe instance store volumes
are available even if they are not specified in the AMI or instance block device mapping. Otherwise,
the updated instance has the same number of instance store volumes that you specified when you
launched the original instance.
1. (Optional) If the new instance type requires drivers that are not installed on the existing instance,
you must connect to your instance and install the drivers first. For more information, see
Compatibility for changing the instance type (p. 334).
2. (Optional) If you configured your Windows instance to use static IP addressing (p. 805) and you
change from an instance type that doesn't support enhanced networking to an instance type that
does support enhanced networking, you might get a warning about a potential IP address conflict
when you reconfigure static IP addressing. To prevent this, enable DHCP on the network interface
for your instance before you change the instance type. From your instance, open the Network and
Sharing Center, open Internet Protocol Version 4 (TCP/IPv4) Properties for the network interface,
332
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the instance type
and choose Obtain an IP address automatically. Change the instance type and reconfigure static IP
addressing on the network interface.
3. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
4. In the navigation pane, choose Instances.
5. Select the instance and choose Instance state, Stop instance. When prompted for confirmation,
choose Stop. It can take a few minutes for the instance to stop.
6. With the instance still selected, choose Actions, Instance settings, Change instance type. This
option is grayed out if the instance state is not stopped.
7. On the Change instance type page, do the following:
a. For Instance type, select the instance type that you want.
If the instance type is not in the list, then it's not compatible with the configuration of your
instance. Instead, use the following instructions: Change the instance type by launching a new
instance (p. 333).
b. (Optional) If the instance type that you selected supports EBS optimization, select EBS-
optimized to enable EBS optimization, or deselect EBS-optimized to disable EBS optimization.
If the instance type that you selected is EBS optimized by default, EBS-optimized is selected
and you can't deselect it.
c. Choose Apply to accept the new settings.
8. To start the instance, select the instance and choose Instance state, Start instance. It can take a few
minutes for the instance to enter the running state. If your instance won't start, see Troubleshoot
changing the instance type (p. 336).
9. [Windows Server 2016 and later] Connect to your Windows instance and run the following
EC2Launch PowerShell script to configure the instance after the instance type is changed.
Important
The administrator password will reset when you enable the initialize instance EC2 Launch
script. You can modify the configuration file to disable the administrator password reset by
specifying it in the settings for the initialization tasks. For steps on how to disable password
reset, see Configure initialization tasks (p. 705).
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -
Schedule
333
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the instance type
• For data on your instance store volumes, back up the data to persistent storage.
• For data on your EBS volumes, take a snapshot of the volumes (p. 1574) or detach the volumes
from the instance (p. 1565) so that you can attach them to the new instance later.
3. In the navigation pane, choose Instances.
4. Choose Launch instances. When you configure the instance, do the following:
a. Select an AMI that will support the instance type that you want.
b. Select the new instance type that you want. If the instance type that you want isn't available,
then it's not compatible with the configuration of the AMI that you selected.
c. If you're using an Elastic IP address, select the VPC that the original instance is currently running
in.
d. If you want to allow the same traffic to reach the new instance, select the security group that is
associated with the original instance.
e. When you're done configuring your new instance, complete the steps to select a key pair and
launch your instance. It can take a few minutes for the instance to enter the running state.
5. If required, attach any new EBS volumes (p. 1542) based on the snapshots that you created, or any
EBS volumes that you detached from the original instance, to the new instance.
6. Install your application and any required software on the new instance.
7. Restore any data that you backed up from the instance store volumes of the original instance.
8. If you are using an Elastic IP address, assign it to the new instance as follows:
For compatibility information for changing Linux instance types, see Compatibility for changing the
instance type in the User Guide for Linux Instances.
Tip
For additional guidance on migrating compatible Windows instances from a Xen instance type
to a Nitro instance type, see Migrate to latest generation instance types (p. 894).
334
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the instance type
Architecture
AMIs are specific to the architecture of the processor, so you must select an instance type with the
same processor architecture as the current instance type. For example:
• If the current instance type has a processor based on the Arm architecture, you are limited to the
instance types that support a processor based on the Arm architecture, such as C6g and M6g.
• The following instance types are the only instance types that support 32-bit AMIs: t2.nano,
t2.micro, t2.small, t2.medium, c3.large, t1.micro, m1.small, m1.medium, and
c1.medium. If you are changing the instance type of a 32-bit instance, you are limited to these
instance types.
Network
Newer instance types must be launched in a VPC. Therefore, if the instance is in the EC2-Classic
platform, you can't change the instance type to one that is available only in a VPC unless you have
a nondefault VPC. To check whether your instance is in a VPC, check the VPC ID value on the details
pane of the Instances screen in the Amazon EC2 console. For more information, see Migrate from
EC2-Classic to a VPC (p. 1385).
Network adapters
If you switch from a driver for one network adapter to another, the network adapter settings are
reset when the operating system creates the new adapter. To reconfigure the settings, you might
need access to a local account with administrator permissions. The following are examples of
moving from one network adapter to another:
• AWS PV (T2 instances) to Intel 82599 VF (M4 instances)
• Intel 82599 VF (most M4 instances) to ENA (M5 instances)
• ENA (M5 instances) to high-bandwidth ENA (M5n instances)
Enhanced networking
Instance types that support enhanced networking (p. 1278) require the necessary drivers installed.
For example, instances based on the Nitro System (p. 210) require EBS-backed AMIs with the
Elastic Network Adapter (ENA) drivers installed. To change from an instance type that does not
support enhanced networking to an instance type that supports enhanced networking, you must
install the ENA drivers (p. 1279) or ixgbevf drivers (p. 1295) on the instance, as appropriate.
Note
When you resize an instance with ENA Express enabled, the new instance type must also
support ENA Express. For a list of instance types that support ENA Express, see Supported
instance types for ENA Express (p. 1291).
To change from an instance type that supports ENA Express to an instance type that does
not support it, ensure that ENA Express is not currently enabled before you resize the
instance.
NVMe
EBS volumes are exposed as NVMe block devices on instances built on the Nitro System (p. 210).
If you change from an instance type that does not support NVMe to an instance type that supports
NVMe, you must first install the NVMe drivers (p. 1750) on your instance. Also, the device names for
devices that you specify in the block device mapping are renamed using NVMe device names (/dev/
nvme[0-26]n1).
AMI
For information about the AMIs required by instance types that support enhanced networking and
NVMe, see the Release Notes in the following documentation:
• General purpose instances (p. 216)
• Compute optimized instances (p. 268)
335
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance purchasing options
If you use the EC2 console to change the instance type, only the instance types that are supported
by the selected AMI are available. However, if you use the AWS CLI to launch an instance, you can
specify an incompatible AMI and instance type. If the AMI and instance type are incompatible,
the instance can't start. For more information, see Compatibility for changing the instance
type (p. 334).
Possible cause: Instance is in cluster placement group
If your instance is in a cluster placement group (p. 1303) and, after changing the instance type, the
instance fails to start, try the following:
1. Stop all the instances in the cluster placement group.
2. Change the instance type of the affected instance.
3. Start all the instances in the cluster placement group.
Application or website not reachable from the internet after changing instance
type
Possible cause: Public IPv4 address is released
When you change the instance type, you must first stop the instance. When you stop an instance, we
release the public IPv4 address and give your instance a new public IPv4 address.
To retain the public IPv4 address between instance stops and starts, we recommend that you use
an Elastic IP address, at no extra cost provided your instance is running. For more information, see
Elastic IP addresses (p. 1233).
• On-Demand Instances (p. 338) – Pay, by the second, for the instances that you launch.
• Savings Plans – Reduce your Amazon EC2 costs by making a commitment to a consistent amount of
usage, in USD per hour, for a term of 1 or 3 years.
• Reserved Instances (p. 340) – Reduce your Amazon EC2 costs by making a commitment to a
consistent instance configuration, including instance type and Region, for a term of 1 or 3 years.
• Spot Instances (p. 382) – Request unused EC2 instances, which can reduce your Amazon EC2 costs
significantly.
• Dedicated Hosts (p. 446) – Pay for a physical host that is fully dedicated to running your instances,
and bring your existing per-socket, per-core, or per-VM software licenses to reduce costs.
336
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Determine the instance lifecycle
• Dedicated Instances (p. 486) – Pay, by the hour, for instances that run on single-tenant hardware.
• Capacity Reservations (p. 492) – Reserve capacity for your EC2 instances in a specific Availability
Zone for any duration.
If you require a capacity reservation, purchase Reserved Instances or Capacity Reservations for a specific
Availability Zone. Spot Instances are a cost-effective choice if you can be flexible about when your
applications run and if they can be interrupted. Dedicated Hosts or Dedicated Instances can help you
address compliance requirements and reduce costs by using your existing server-bound software
licenses. For more information, see Amazon EC2 Pricing.
For more information about Savings Plans, see the Savings Plans User Guide.
Contents
• Determine the instance lifecycle (p. 337)
• On-Demand Instances (p. 338)
• Reserved Instances (p. 340)
• Scheduled Reserved Instances (p. 380)
• Spot Instances (p. 382)
• Dedicated Hosts (p. 446)
• Dedicated Instances (p. 486)
• On-Demand Capacity Reservations (p. 492)
337
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Instances
If the instance is running on a Dedicated Host, the output contains the following information:
"Tenancy": "host"
If the instance is a Dedicated Instance, the output contains the following information:
"Tenancy": "dedicated"
If the instance is a Spot Instance, the output contains the following information:
"InstanceLifecycle": "spot"
On-Demand Instances
With On-Demand Instances, you pay for compute capacity by the second with no long-term
commitments. You have full control over the instance's lifecycle—you decide when to launch, stop,
hibernate, start, reboot, or terminate it.
There is no long-term commitment required when you purchase On-Demand Instances. You pay only for
the seconds that your On-Demand Instances are in the running state, with a 60-second minimum. The
price per second for a running On-Demand Instance is fixed, and is listed on the Amazon EC2 Pricing, On-
Demand Pricing page.
We recommend that you use On-Demand Instances for applications with short-term, irregular workloads
that cannot be interrupted.
For significant savings over On-Demand Instances, use AWS Savings Plans, Spot Instances (p. 382), or
Reserved Instances (p. 340).
Contents
• Work with On-Demand Instances (p. 338)
• On-Demand Instance quotas (p. 339)
• Monitor On-Demand Instance quotas and usage (p. 339)
• Request a quota increase (p. 340)
• Query the prices of On-Demand Instances (p. 340)
338
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Instances
If you're new to Amazon EC2, see How to get started with Amazon EC2 (p. 1).
Quotas apply to running instances only. If your instance is pending, stopping, stopped, or hibernated, it
does not count towards your quota.
Each quota type specifies the maximum number of vCPUs for one or more instance families. For
information about the different instance families, generations, and sizes, see Amazon EC2 Instance
Types.
You can launch any combination of instance types that meet your changing application needs, as long as
the number of vCPUs does not exceed your account quota. For example, with a Standard instance quota
of 256 vCPUs, you could launch 32 m5.2xlarge instances (32 x 8 vCPUs) or 16 c5.4xlarge instances
(16 x 16 vCPUs). For more information, see EC2 On-Demand Instance limits.
Tasks
• Monitor On-Demand Instance quotas and usage (p. 339)
• Request a quota increase (p. 340)
339
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
To view your current quotas using the AWS Trusted Advisor console
With Amazon CloudWatch metrics integration, you can monitor your EC2 usage against your quotas. You
can also configure alarms to warn about approaching quotas. For more information, see Service Quotas
and Amazon CloudWatch alarms in the Service Quotas User Guide.
Reserved Instances
Reserved Instances provide you with significant savings on your Amazon EC2 costs compared to On-
Demand Instance pricing. Reserved Instances are not physical instances, but rather a billing discount
applied to the use of On-Demand Instances in your account. These On-Demand Instances must match
certain attributes, such as instance type and Region, in order to benefit from the billing discount.
Note
Savings Plans also offer significant savings on your Amazon EC2 costs compared to On-
Demand Instance pricing. With Savings Plans, you make a commitment to a consistent usage
amount, measured in USD per hour. This provides you with the flexibility to use the instance
configurations that best meet your needs and continue to save money, instead of making a
commitment to a specific instance configuration. For more information, see the AWS Savings
Plans User Guide.
340
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
In this scenario, you have a running On-Demand Instance (T2) in your account, for which you're currently
paying On-Demand rates. You purchase a Reserved Instance that matches the attributes of your running
instance, and the billing benefit is immediately applied. Next, you purchase a Reserved Instance for
a C4 instance. You do not have any running instances in your account that match the attributes of
this Reserved Instance. In the final step, you launch an instance that matches the attributes of the C4
Reserved Instance, and the billing benefit is immediately applied.
Instance attributes
A Reserved Instance has four instance attributes that determine its price.
• Instance type: For example, m4.large. This is composed of the instance family (for example, m4) and
the instance size (for example, large).
• Region: The Region in which the Reserved Instance is purchased.
• Tenancy: Whether your instance runs on shared (default) or single-tenant (dedicated) hardware. For
more information, see Dedicated Instances (p. 486).
• Platform: The operating system; for example, Windows or Linux/Unix. For more information, see
Choosing a platform (p. 356).
Term commitment
You can purchase a Reserved Instance for a one-year or three-year commitment, with the three-year
commitment offering a bigger discount.
Reserved Instances do not renew automatically; when they expire, you can continue using the EC2
instance without interruption, but you are charged On-Demand rates. In the above example, when the
Reserved Instances that cover the T2 and C4 instances expire, you go back to paying the On-Demand
rates until you terminate the instances or purchase new Reserved Instances that match the instance
attributes.
Important
After you purchase a Reserved Instance, you cannot cancel your purchase. However, you might
be able to modify (p. 370), exchange (p. 374), or sell (p. 363) your Reserved Instance if your
needs change.
341
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Payment options
The following payment options are available for Reserved Instances:
• All Upfront: Full payment is made at the start of the term, with no other costs or additional hourly
charges incurred for the remainder of the term, regardless of hours used.
• Partial Upfront: A portion of the cost must be paid upfront and the remaining hours in the term are
billed at a discounted hourly rate, regardless of whether the Reserved Instance is being used.
• No Upfront: You are billed a discounted hourly rate for every hour within the term, regardless of
whether the Reserved Instance is being used. No upfront payment is required.
Note
No Upfront Reserved Instances are based on a contractual obligation to pay monthly for the
entire term of the reservation. For this reason, a successful billing history is required before
you can purchase No Upfront Reserved Instances.
Generally speaking, you can save more money making a higher upfront payment for Reserved Instances.
You can also find Reserved Instances offered by third-party sellers at lower prices and shorter term
lengths on the Reserved Instance Marketplace. For more information, see Sell in the Reserved Instance
Marketplace (p. 363).
Offering class
If your computing needs change, you might be able to modify or exchange your Reserved Instance,
depending on the offering class.
• Standard: These provide the most significant discount, but can only be modified. Standard Reserved
Instances can't be exchanged.
• Convertible: These provide a lower discount than Standard Reserved Instances, but can be exchanged
for another Convertible Reserved Instance with different instance attributes. Convertible Reserved
Instances can also be modified.
For more information, see Types of Reserved Instances (offering classes) (p. 343).
Important
After you purchase a Reserved Instance, you cannot cancel your purchase. However, you might
be able to modify (p. 370), exchange (p. 374), or sell (p. 363) your Reserved Instance if your
needs change.
For more information, see the Amazon EC2 Reserved Instances Pricing page.
• Regional: When you purchase a Reserved Instance for a Region, it's referred to as a regional Reserved
Instance.
• Zonal: When you purchase a Reserved Instance for a specific Availability Zone, it's referred to as a
zonal Reserved Instance.
The scope does not affect the price. You pay the same price for a regional or zonal Reserved Instance. For
more information about Reserved Instance pricing, see Key variables that determine Reserved Instance
pricing (p. 341) and Amazon EC2 Reserved Instances Pricing.
For more information about how to specify the scope of a Reserved Instance, see RI Attributes,
specifically the Availability Zone bullet.
342
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Availability Zone flexibility The Reserved Instance discount No Availability Zone flexibility—
applies to instance usage in any the Reserved Instance discount
Availability Zone in the specified applies to instance usage in the
Region. specified Availability Zone only.
Instance size flexibility The Reserved Instance discount No instance size flexibility—
applies to instance usage within the Reserved Instance discount
the instance family, regardless of applies to instance usage for the
size. specified instance type and size
only.
Only supported on Amazon
Linux/Unix Reserved Instances
with default tenancy. For more
information, see Instance
size flexibility determined by
normalization factor (p. 345).
Queuing a purchase You can queue purchases for You can't queue purchases for
regional Reserved Instances. zonal Reserved Instances.
For more information and examples, see How Reserved Instances are applied (p. 344).
The configuration of a Reserved Instance comprises a single instance type, platform, scope, and tenancy
over a term. If your computing needs change, you might be able to modify or exchange your Reserved
Instance.
343
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Sell in the Reserved Instance Can be sold in the Reserved Can't be sold in the Reserved
Marketplace Instance Marketplace. Instance Marketplace.
Buy in the Reserved Instance Can be bought in the Reserved Can't be bought in the Reserved
Marketplace Instance Marketplace. Instance Marketplace.
If you purchase a Reserved Instance and you already have a running On-Demand Instance that matches
the specifications of the Reserved Instance, the billing discount is applied immediately and automatically.
You do not have to restart your instances. If you do not have an eligible running On-Demand Instance,
launch an On-Demand Instance with the same specifications as your Reserved Instance. For more
information, see Use your Reserved Instances (p. 350).
The offering class (Standard or Convertible) of the Reserved Instance does not affect how the billing
discount is applied.
Topics
• How zonal Reserved Instances are applied (p. 344)
• How regional Reserved Instances are applied (p. 344)
• Instance size flexibility (p. 345)
• Examples of applying Reserved Instances (p. 347)
• The Reserved Instance discount applies to matching instance usage in that Availability Zone.
• The attributes (tenancy, platform, Availability Zone, instance type, and instance size) of the running
instances must match that of the Reserved Instances.
For example, if you purchase two c4.xlarge default tenancy Linux/Unix Standard Reserved Instances
for Availability Zone us-east-1a, then up to two c4.xlarge default tenancy Linux/Unix instances
running in the Availability Zone us-east-1a can benefit from the Reserved Instance discount.
344
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• The Reserved Instance discount applies to instance usage in any Availability Zone in that Region.
• The Reserved Instance discount applies to instance usage within the instance family, regardless of size
—this is known as instance size flexibility (p. 345).
Limitations
• Supported: Instance size flexibility is only supported for Regional Reserved Instances.
• Not supported: Instance size flexibility is not supported for the following Reserved Instances:
• Reserved Instances that are purchased for a specific Availability Zone (zonal Reserved Instances)
• Reserved Instances for G4ad, G4dn, G5, G5g, and Inf1 instances
• Reserved Instances for Windows Server, Windows Server with SQL Standard, Windows Server with
SQL Server Enterprise, Windows Server with SQL Server Web, RHEL, and SUSE Linux Enterprise
Server
• Reserved Instances with dedicated tenancy
Instance size flexibility is determined by the normalization factor of the instance size. The discount
applies either fully or partially to running instances of the same instance family, depending on the
instance size of the reservation, in any Availability Zone in the Region. The only attributes that must be
matched are the instance family, tenancy, and platform.
The following table lists the different sizes within an instance family, and the corresponding
normalization factor. This scale is used to apply the discounted rate of Reserved Instances to the
normalized usage of the instance family.
nano 0.25
micro 0.5
small 1
medium 2
large 4
xlarge 8
2xlarge 16
3xlarge 24
4xlarge 32
6xlarge 48
345
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
8xlarge 64
9xlarge 72
10xlarge 80
12xlarge 96
16xlarge 128
18xlarge 144
24xlarge 192
32xlarge 256
56xlarge 448
112xlarge 896
For example, a t2.medium instance has a normalization factor of 2. If you purchase a t2.medium
default tenancy Amazon Linux/Unix Reserved Instance in the US East (N. Virginia) and you have two
running t2.small instances in your account in that Region, the billing benefit is applied in full to both
instances.
Or, if you have one t2.large instance running in your account in the US East (N. Virginia) Region, the
billing benefit is applied to 50% of the usage of the instance.
The normalization factor is also applied when modifying Reserved Instances. For more information, see
Modify Reserved Instances (p. 370).
346
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Instance size flexibility also applies to bare metal instances within the instance family. If you have
regional Amazon Linux/Unix Reserved Instances with shared tenancy on bare metal instances, you can
benefit from the Reserved Instance savings within the same instance family. The opposite is also true: if
you have regional Amazon Linux/Unix Reserved Instances with shared tenancy on instances in the same
family as a bare metal instance, you can benefit from the Reserved Instance savings on the bare metal
instance.
The metal instance size does not have a single normalization factor. A bare metal instance has the same
normalization factor as the equivalent virtualized instance size within the same instance family. For
example, an i3.metal instance has the same normalization factor as an i3.16xlarge instance.
m5zn.metal | z1d.metal 96
i3.metal | 128
c5n.metal 144
u-*.metal 896
For example, an i3.metal instance has a normalization factor of 128. If you purchase an i3.metal
default tenancy Amazon Linux/Unix Reserved Instance in the US East (N. Virginia), the billing benefit can
apply as follows:
• If you have one running i3.16xlarge in your account in that Region, the billing benefit is applied in
full to the i3.16xlarge instance (i3.16xlarge normalization factor = 128).
• Or, if you have two running i3.8xlarge instances in your account in that Region, the billing benefit is
applied in full to both i3.8xlarge instances (i3.8xlarge normalization factor = 64).
• Or, if you have four running i3.4xlarge instances in your account in that Region, the billing benefit
is applied in full to all four i3.4xlarge instances (i3.4xlarge normalization factor = 32).
The opposite is also true. For example, if you purchase two i3.8xlarge default tenancy Amazon Linux/
Unix Reserved Instances in the US East (N. Virginia), and you have one running i3.metal instance in
that Region, the billing benefit is applied in full to the i3.metal instance.
347
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• 4 x m3.large Linux, default tenancy Reserved Instances in Availability Zone us-east-1a (capacity is
reserved)
• 4 x m4.large Amazon Linux, default tenancy Reserved Instances in Region us-east-1
• 1 x c4.large Amazon Linux, default tenancy Reserved Instances in Region us-east-1
• The discount and capacity reservation of the four m3.large zonal Reserved Instances is used by the
four m3.large instances because the attributes (instance size, Region, platform, tenancy) between
them match.
• The m4.large regional Reserved Instances provide Availability Zone and instance size flexibility,
because they are regional Amazon Linux Reserved Instances with default tenancy.
You've purchased four m4.large regional Reserved Instances, and in total, they are equal to 16
normalized units/hour (4x4). Account A has two m4.xlarge instances running, which is equivalent to
16 normalized units/hour (2x8). In this case, the four m4.large regional Reserved Instances provide
the full billing benefit to the usage of the two m4.xlarge instances.
• The c4.large regional Reserved Instance in us-east-1 provides Availability Zone and instance size
flexibility, because it is a regional Amazon Linux Reserved Instance with default tenancy, and applies
to the c4.xlarge instance. A c4.large instance is equivalent to 4 normalized units/hour and a
c4.xlarge is equivalent to 8 normalized units/hour.
In this case, the c4.large regional Reserved Instance provides partial benefit to c4.xlarge usage.
This is because the c4.large Reserved Instance is equivalent to 4 normalized units/hour of usage,
but the c4.xlarge instance requires 8 normalized units/hour. Therefore, the c4.large Reserved
Instance billing discount applies to 50% of c4.xlarge usage. The remaining c4.xlarge usage is
charged at the On-Demand rate.
• The m3.2xlarge regional Reserved Instance in us-east-1 provides Availability Zone and instance size
flexibility, because it is a regional Amazon Linux Reserved Instance with default tenancy. It applies first
to the m3.large instances and then to the m3.xlarge instances, because it applies from the smallest
to the largest instance size within the instance family based on the normalization factor.
348
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
The m3.2xlarge regional Reserved Instance provides full benefit to 2 x m3.large usage, because
together these instances account for 8 normalized units/hour. This leaves 8 normalized units/hour to
apply to the m3.xlarge instances.
With the remaining 8 normalized units/hour, the m3.2xlarge regional Reserved Instance provides
full benefit to 1 x m3.xlarge usage, because each m3.xlarge instance is equivalent to 8 normalized
units/hour. The remaining m3.xlarge usage is charged at the On-Demand rate.
Reserved Instances are first applied to usage within the purchasing account, followed by qualifying usage
in any other account in the organization. For more information, see Reserved Instances and consolidated
billing (p. 353). For regional Reserved Instances that offer instance size flexibility, the benefit is applied
from the smallest to the largest instance size within the instance family.
You're running the following On-Demand Instances in account A (the purchasing account):
Another customer is running the following On-Demand Instances in account B—a linked account:
The regional Reserved Instance benefits are applied in the following way:
• The discount of the four m4.xlarge Reserved Instances is used by the two m4.xlarge instances
and the single m4.2xlarge instance in account A (purchasing account). All three instances match
the attributes (instance family, Region, platform, tenancy). The discount is applied to instances in the
purchasing account (account A) first, even though account B (linked account) has two m4.xlarge that
also match the Reserved Instances. There is no capacity reservation because the Reserved Instances are
regional Reserved Instances.
• The discount of the two c4.xlarge Reserved Instances applies to the two c4.xlarge instances,
because they are a smaller instance size than the c4.2xlarge instance. There is no capacity
reservation because the Reserved Instances are regional Reserved Instances.
349
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
In general, Reserved Instances that are owned by an account are applied first to usage in that account.
However, if there are qualifying, unused Reserved Instances for a specific Availability Zone (zonal
Reserved Instances) in other accounts in the organization, they are applied to the account before regional
Reserved Instances owned by the account. This is done to ensure maximum Reserved Instance utilization
and a lower bill. For billing purposes, all the accounts in the organization are treated as one account. The
following example might help explain this.
You're running the following On-Demand Instance in account A (the purchasing account):
A customer also purchases the following zonal Reserved Instances in linked account C:
• The discount of the m4.xlarge zonal Reserved Instance owned by account C is applied to the
m4.xlarge usage in account A.
• The discount of the m4.xlarge regional Reserved Instance owned by account A is applied to the
m4.xlarge usage in account B.
• If the regional Reserved Instance owned by account A was first applied to the usage in account A, the
zonal Reserved Instance owned by account C remains unused and usage in account B is charged at On-
Demand rates.
For more information, see Reserved Instances in the Billing and Cost Management Report.
If you're launching an On-Demand Instance to take advantage of the billing benefit of a Reserved
Instance, ensure that you specify the following information when you configure your On-Demand
Instance:
Platform
You must specify an Amazon Machine Image (AMI) that matches the platform (product description)
of your Reserved Instance. For example, if you specified Linux/UNIX for your Reserved Instance,
you can launch an instance from an Amazon Linux AMI or an Ubuntu AMI.
350
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Instance type
If you purchased a zonal Reserved Instance, you must specify the same instance type as your
Reserved Instance; for example, t3.large. For more information, see How zonal Reserved Instances
are applied (p. 344).
If you purchased a regional Reserved Instance, you must specify an instance type from the same
instance family as the instance type of your Reserved Instance. For example, if you specified
t3.xlarge for your Reserved Instance, you must launch your instance from the T3 family, but you
can specify any size, for example, t3.medium. For more information, see How regional Reserved
Instances are applied (p. 344).
Availability Zone
If you purchased a zonal Reserved Instance for a specific Availability Zone, you must launch the
instance into the same Availability Zone.
If you purchased a regional Reserved Instance, you can launch the instance into any Availability Zone
in the Region that you specified for the Reserved Instance.
Tenancy
The tenancy (dedicated or shared) of the instance must match the tenancy of your Reserved
Instance. For more information, see Dedicated Instances (p. 486).
For examples of how Reserved Instances are applied to your running On-Demand Instances, see How
Reserved Instances are applied (p. 344). For more information, see Why aren't my Amazon EC2
Reserved Instances applying to my AWS billing in the way that I expected?
You can use various methods to launch the On-Demand Instances that use your Reserved Instance
discount. For information about the different launch methods, see Launch your instance (p. 537). You
can also use Amazon EC2 Auto Scaling to launch an instance. For more information, see the Amazon EC2
Auto Scaling User Guide.
When Reserved Instances expire, you are charged On-Demand rates for EC2 instance usage. You can
queue a Reserved Instance for purchase up to three years in advance. This can help you ensure that you
have uninterrupted coverage. For more information, see Queue your purchase (p. 356).
The AWS Free Tier is available for new AWS accounts. If you are using the AWS Free Tier to run Amazon
EC2 instances, and you purchase a Reserved Instance, you are charged under standard pricing guidelines.
For information, see AWS Free Tier.
Contents
• Usage billing (p. 351)
• Viewing your bill (p. 353)
• Reserved Instances and consolidated billing (p. 353)
• Reserved Instance discount pricing tiers (p. 353)
Usage billing
Reserved Instances are billed for every clock-hour during the term that you select, regardless of whether
an instance is running. Each clock-hour starts on the hour (zero minutes and zero seconds past the hour)
351
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
of a standard 24-hour clock. For example, 1:00:00 to 1:59:59 is one clock-hour. For more information
about instance states, see Instance lifecycle (p. 533).
A Reserved Instance billing benefit can be applied to a running instance on a per-second basis.
A Reserved Instance billing benefit can apply to a maximum of 3600 seconds (one hour) of instance
usage per clock-hour. You can run multiple instances concurrently, but can only receive the benefit of the
Reserved Instance discount for a total of 3600 seconds per clock-hour; instance usage that exceeds 3600
seconds in a clock-hour is billed at the On-Demand rate.
For example, if you purchase one m4.xlarge Reserved Instance and run four m4.xlarge instances
concurrently for one hour, one instance is charged at one hour of Reserved Instance usage and the other
three instances are charged at three hours of On-Demand usage.
However, if you purchase one m4.xlarge Reserved Instance and run four m4.xlarge instances for 15
minutes (900 seconds) each within the same hour, the total running time for the instances is one hour,
which results in one hour of Reserved Instance usage and 0 hours of On-Demand usage.
If multiple eligible instances are running concurrently, the Reserved Instance billing benefit is applied
to all the instances at the same time up to a maximum of 3600 seconds in a clock-hour; thereafter, On-
Demand rates apply.
Cost Explorer on the Billing and Cost Management console enables you to analyze the savings against
running On-Demand Instances. The Reserved Instances FAQ includes an example of a list value
calculation.
352
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
If you close your AWS account, On-Demand billing for your resources stops. However, if you have any
Reserved Instances in your account, you continue to receive a bill for these until they expire.
You can view the charges online, or you can download a CSV file.
You can also track your Reserved Instance utilization using the AWS Cost and Usage Report. For more
information, see Reserved Instances under Cost and Usage Report in the AWS Billing User Guide.
If you close the account that purchased the Reserved Instance, the payer account is charged for the
Reserved Instance until the Reserved Instance expires. After the closed account is permanently deleted in
90 days, the member accounts no longer benefit from the Reserved Instance billing discount.
• Pricing tiers and related discounts apply only to purchases of Amazon EC2 Standard Reserved
Instances.
• Pricing tiers do not apply to Reserved Instances for Windows with SQL Server Standard, SQL Server
Web, and SQL Server Enterprise.
• Pricing tiers do not apply to Reserved Instances for Linux with SQL Server Standard, SQL Server Web,
and SQL Server Enterprise.
• Pricing tier discounts only apply to purchases made from AWS. They do not apply to purchases of
third-party Reserved Instances.
• Discount pricing tiers are currently not applicable to Convertible Reserved Instance purchases.
Topics
• Calculate Reserved Instance pricing discounts (p. 354)
• Buy with a discount tier (p. 354)
• Crossing pricing tiers (p. 355)
• Consolidated billing for pricing tiers (p. 355)
353
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
You can determine the pricing tier for your account by calculating the list value for all of your Reserved
Instances in a Region. Multiply the hourly recurring price for each reservation by the total number of
hours for the term and add the undiscounted upfront price (also known as the fixed price) at the time of
purchase. Because the list value is based on undiscounted (public) pricing, it is not affected if you qualify
for a volume discount or if the price drops after you buy your Reserved Instances.
List value = fixed price + (undiscounted recurring hourly price * hours in term)
For example, for a 1-year Partial Upfront t2.small Reserved Instance, assume the upfront price is
$60.00 and the hourly rate is $0.007. This provides a list value of $121.32.
New console
To view the fixed price values for Reserved Instances using the Amazon EC2 console
Old console
To view the fixed price values for Reserved Instances using the Amazon EC2 console
To view the fixed price values for Reserved Instances using the command line
When you buy Reserved Instances, Amazon EC2 automatically applies any discounts to the part of your
purchase that falls within a discount pricing tier. You don't need to do anything differently, and you can
buy Reserved Instances using any of the Amazon EC2 tools. For more information, see Buy Reserved
Instances (p. 355).
After the list value of your active Reserved Instances in a Region crosses into a discount pricing tier,
any future purchase of Reserved Instances in that Region are charged at a discounted rate. If a single
purchase of Reserved Instances in a Region takes you over the threshold of a discount tier, then the
portion of the purchase that is above the price threshold is charged at the discounted rate. For more
information about the temporary Reserved Instance IDs that are created during the purchase process,
see Crossing pricing tiers (p. 355).
354
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
If your list value falls below the price point for that discount pricing tier—for example, if some of your
Reserved Instances expire—future purchases of Reserved Instances in the Region are not discounted.
However, you continue to get the discount applied against any Reserved Instances that were originally
purchased within the discount pricing tier.
When you buy Reserved Instances, one of four possible scenarios occurs:
The Reserved Instance service generates several Reserved Instance IDs because your purchase crossed
from an undiscounted tier, or from one discounted tier to another. There is an ID for each set of
reservations in a tier. Consequently, the ID returned by your purchase CLI command or API action is
different from the actual ID of the new Reserved Instances.
When you search for Reserved Instances to buy, you receive a quote on the cost of the returned offerings.
When you proceed with the purchase, AWS automatically places a limit price on the purchase price. The
total cost of your Reserved Instances won't exceed the amount that you were quoted.
If the price rises or changes for any reason, the purchase is not completed. If, at the time of purchase,
there are offerings similar to your choice but at a lower price, AWS sells you the offerings at the lower
price.
Before you confirm your purchase, review the details of the Reserved Instance that you plan to buy, and
make sure that all the parameters are accurate. After you purchase a Reserved Instance (either from a
third-party seller in the Reserved Instance Marketplace or from AWS), you cannot cancel your purchase.
Note
To purchase and modify Reserved Instances, ensure that your user has the appropriate
permissions, such as the ability to describe Availability Zones. For information, see Example
Policies for Working With the AWS CLI or an AWS SDK and Example Policies for Working in the
Amazon EC2 Console.
355
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Topics
• Choosing a platform (p. 356)
• Queue your purchase (p. 356)
• Buy Standard Reserved Instances (p. 357)
• Buy Convertible Reserved Instances (p. 359)
• Buy from the Reserved Instance Marketplace (p. 361)
• View your Reserved Instances (p. 362)
• Cancel a queued purchase (p. 362)
• Renew a Reserved Instance (p. 363)
Choosing a platform
Amazon EC2 supports the following Windows platforms for Reserved Instances:
• Windows
• Windows with SQL Server Standard
• Windows with SQL Server Web
• Windows with SQL Server Enterprise
When you purchase a Reserved Instance, you must choose an offering for a platform that represents the
operating system for your instance.
• For Windows with SQL Standard, Windows with SQL Server Enterprise, and Windows with SQL Server
Web, you must choose offerings for those specific platforms.
• For all other Windows versions, choose an offering for the Windows platform.
Important
If you plan to purchase a Reserved Instance to apply to an On-Demand Instance that was
launched from an AWS Marketplace AMI, first check the PlatformDetails field of the AMI.
The PlatformDetails field indicates which Reserved Instance to purchase. The platform
details of the AMI must match the platform of the Reserved Instance, otherwise the Reserved
Instance will not be applied to the On-Demand Instance. For information about how to view the
platform details of the AMI, see Understand AMI billing information (p. 193).
For information about the supported platforms for Linux, see Choosing a platform in the Amazon EC2
User Guide for Linux Instances.
You can queue purchases for regional Reserved Instances, but not zonal Reserved Instances or Reserved
Instances from other sellers. You can queue a purchase up to three years in advance. On the scheduled
date and time, the purchase is made using the default payment method. After the payment is successful,
the billing benefit is applied.
You can view your queued purchases in the Amazon EC2 console. The status of a queued purchase is
queued. You can cancel a queued purchase any time before its scheduled time. For details, see Cancel a
queued purchase (p. 362).
356
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
New console
To purchase a regional Reserved Instance, toggle off this setting. When you toggle off this
setting, the Availability Zone field disappears.
5. Select other configurations as needed, and then choose Search.
6. For each Reserved Instance that you want to purchase, enter the desired quantity, and choose
Add to cart.
To purchase a Standard Reserved Instance from the Reserved Instance Marketplace, look for 3rd
party in the Seller column in the search results. The Term column displays non-standard terms.
For more information, see Buy from the Reserved Instance Marketplace (p. 361).
7. To see a summary of the Reserved Instances that you selected, choose View cart.
8. If Order on is Now, the purchase is completed immediately after you choose Order all. To
queue a purchase, choose Now and select a date. You can select a different date for each
eligible offering in the cart. The purchase is queued until 00:00 UTC on the selected date.
9. To complete the order, choose Order all.
If, at the time of placing the order, there are offerings similar to your choice but with a lower
price, AWS sells you the offerings at the lower price.
10. Choose Close.
The status of your order is listed in the State column. When your order is complete, the State
value changes from Payment-pending to Active. When the Reserved Instance is Active, it is
ready to use.
Note
If the status goes to Retired, AWS might not have received your payment.
Old console
357
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
To purchase a Standard Reserved Instance from the Reserved Instance Marketplace, look for 3rd
Party in the Seller column in the search results. The Term column displays non-standard terms.
6. For each Reserved Instance that you want to purchase, enter the quantity, and choose Add to
Cart.
7. To see a summary of the Reserved Instances that you selected, choose View Cart.
8. If Order On is Now, the purchase is completed immediately. To queue a purchase, choose Now
and select a date. You can select a different date for each eligible offering in the cart. The
purchase is queued until 00:00 UTC on the selected date.
9. To complete the order, choose Order.
If, at the time of placing the order, there are offerings similar to your choice but with a lower
price, AWS sells you the offerings at the lower price.
10. Choose Close.
The status of your order is listed in the State column. When your order is complete, the State
value changes from payment-pending to active. When the Reserved Instance is active, it is
ready to use.
Note
If the status goes to retired, AWS might not have received your payment.
To find Reserved Instances on the Reserved Instance Marketplace only, use the marketplace filter
and do not specify a duration in the request, as the term might be shorter than a 1– or 3-year term.
When you find a Reserved Instance that meets your needs, take note of the offering ID. For example:
"ReservedInstancesOfferingId": "bec624df-a8cc-4aad-a72f-4f8abc34caf2"
2. Use the purchase-reserved-instances-offering command to buy your Reserved Instance. You must
specify the Reserved Instance offering ID you obtained the previous step and you must specify the
number of instances for the reservation.
358
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
By default, the purchase is completed immediately. Alternatively, to queue the purchase, add the
following parameter to the previous call.
--purchase-time "2020-12-01T00:00:00Z"
3. Use the describe-reserved-instances command to get the status of your Reserved Instance.
Alternatively, use the following AWS Tools for Windows PowerShell commands:
• Get-EC2ReservedInstancesOffering
• New-EC2ReservedInstance
• Get-EC2ReservedInstance
After the purchase is complete, if you already have a running instance that matches the specifications
of the Reserved Instance, the billing benefit is immediately applied. You do not have to restart your
instances. If you do not have a suitable running instance, launch an instance and ensure that you match
the same criteria that you specified for your Reserved Instance. For more information, see Use your
Reserved Instances (p. 350).
For examples of how Reserved Instances are applied to your running instances, see How Reserved
Instances are applied (p. 344).
New console
To purchase a regional Reserved Instance, toggle off this setting. When you toggle off this
setting, the Availability Zone field disappears.
5. Select other configurations as needed and choose Search.
6. For each Convertible Reserved Instance that you want to purchase, enter the quantity, and
choose Add to cart.
7. To see a summary of your selection, choose View cart.
359
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
8. If Order on is Now, the purchase is completed immediately after you choose Order all. To
queue a purchase, choose Now and select a date. You can select a different date for each
eligible offering in the cart. The purchase is queued until 00:00 UTC on the selected date.
9. To complete the order, choose Order all.
If, at the time of placing the order, there are offerings similar to your choice but with a lower
price, AWS sells you the offerings at the lower price.
10. Choose Close.
The status of your order is listed in the State column. When your order is complete, the State
value changes from Payment-pending to Active. When the Reserved Instance is Active, it is
ready to use.
Note
If the status goes to Retired, AWS might not have received your payment.
Old console
If, at the time of placing the order, there are offerings similar to your choice but with a lower
price, AWS sells you the offerings at the lower price.
10. Choose Close.
The status of your order is listed in the State column. When your order is complete, the State
value changes from payment-pending to active. When the Reserved Instance is active, it is
ready to use.
Note
If the status goes to retired, AWS might not have received your payment.
360
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
When you find a Reserved Instance that meets your needs, take note of the offering ID. For example:
"ReservedInstancesOfferingId": "bec624df-a8cc-4aad-a72f-4f8abc34caf2"
2. Use the purchase-reserved-instances-offering command to buy your Reserved Instance. You must
specify the Reserved Instance offering ID you obtained the previous step and you must specify the
number of instances for the reservation.
By default, the purchase is completed immediately. Alternatively, to queue the purchase, add the
following parameter to the previous call.
--purchase-time "2020-12-01T00:00:00Z"
3. Use the describe-reserved-instances command to get the status of your Reserved Instance.
Alternatively, use the following AWS Tools for Windows PowerShell commands:
• Get-EC2ReservedInstancesOffering
• New-EC2ReservedInstance
• Get-EC2ReservedInstance
If you already have a running instance that matches the specifications of the Reserved Instance, the
billing benefit is immediately applied. You do not have to restart your instances. If you do not have
a suitable running instance, launch an instance and ensure that you match the same criteria that you
specified for your Reserved Instance. For more information, see Use your Reserved Instances (p. 350).
For examples of how Reserved Instances are applied to your running instances, see How Reserved
Instances are applied (p. 344).
There are a few differences between Reserved Instances purchased in the Reserved Instance Marketplace
and Reserved Instances purchased directly from AWS:
• Term – Reserved Instances that you purchase from third-party sellers have less than a full standard
term remaining. Full standard terms from AWS run for one year or three years.
361
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• Upfront price – Third-party Reserved Instances can be sold at different upfront prices. The usage or
recurring fees remain the same as the fees set when the Reserved Instances were originally purchased
from AWS.
• Types of Reserved Instances – Only Amazon EC2 Standard Reserved Instances can be purchased
from the Reserved Instance Marketplace. Convertible Reserved Instances, Amazon RDS, and Amazon
ElastiCache Reserved Instances are not available for purchase on the Reserved Instance Marketplace.
Basic information about you is shared with the seller, for example, your ZIP code and country
information.
This information enables sellers to calculate any necessary transaction taxes that they have to remit to
the government (such as sales tax or value-added tax) and is provided as a disbursement report. In rare
circumstances, AWS might have to provide the seller with your email address, so that they can contact
you regarding questions related to the sale (for example, tax questions).
For similar reasons, AWS shares the legal entity name of the seller on the buyer's purchase invoice. If you
need additional information about the seller for tax or related reasons, contact AWS Support.
New console
362
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Old console
New console
Old console
As soon as you list your Reserved Instances in the Reserved Instance Marketplace, they are available
for potential buyers to find. All Reserved Instances are grouped according to the duration of the term
remaining and the hourly price.
363
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
To fulfill a buyer's request, AWS first sells the Reserved Instance with the lowest upfront price in the
specified grouping. Then, AWS sells the Reserved Instance with the next lowest price, until the buyer's
entire order is fulfilled. AWS then processes the transactions and transfers ownership of the Reserved
Instances to the buyer.
You own your Reserved Instance until it's sold. After the sale, you've given up the capacity reservation
and the discounted recurring fees. If you continue to use your instance, AWS charges you the On-
Demand price starting from the time that your Reserved Instance was sold.
If you want to sell your unused Reserved Instances on the Reserved Instance Marketplace, you must meet
certain eligibility criteria.
For information about buying Reserved Instances on the Reserved Instance Marketplace, see Buy from
the Reserved Instance Marketplace (p. 361).
Contents
• Restrictions and limitations (p. 364)
• Register as a seller (p. 365)
• Bank account for disbursement (p. 365)
• Tax information (p. 366)
• Price your Reserved Instances (p. 366)
• List your Reserved Instances (p. 367)
• Reserved Instance listing states (p. 368)
• Lifecycle of a listing (p. 368)
• After your Reserved Instance is sold (p. 369)
• Getting paid (p. 369)
• Information shared with the buyer (p. 369)
The following limitations and restrictions apply when selling Reserved Instances:
• Only Amazon EC2 Standard regional and zonal Reserved Instances can be sold in the Reserved
Instance Marketplace.
• Amazon EC2 Convertible Reserved Instances cannot be sold in the Reserved Instance Marketplace.
• Reserved Instances for other AWS services, such as Amazon RDS and Amazon ElastiCache, cannot be
sold in the Reserved Instance Marketplace.
• There must be at least one month remaining in the term of the Standard Reserved Instance.
• You cannot sell a Standard Reserved Instance in a Region that is disabled by default.
• The minimum price allowed in the Reserved Instance Marketplace is $0.00.
• You can sell No Upfront, Partial Upfront, or All Upfront Reserved Instances in the Reserved Instance
Marketplace as long as they have been active in your account for at least 30 days. Additionally, if there
is an upfront payment on a Reserved Instance, it can only be sold after AWS has received the upfront
payment.
• You cannot modify your listing in the Reserved Instance Marketplace directly. However, you can
change your listing by first canceling it and then creating another listing with new parameters. For
information, see Price your Reserved Instances (p. 366). You can also modify your Reserved Instances
before listing them. For information, see Modify Reserved Instances (p. 370).
364
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• AWS charges a service fee of 12 percent of the total upfront price of each Standard Reserved Instance
you sell in the Reserved Instance Marketplace. The upfront price is the price the seller is charging for
the Standard Reserved Instance.
• When you register as a seller, the bank you specify must have a US address. For more information, see
Additional seller requirements for paid products in the AWS Marketplace Seller Guide.
• Amazon Internet Services Private Limited (AISPL) customers can't sell Reserved Instances in the
Reserved Instance Marketplace even if they have a US bank account. For more information, see What
are the differences between AWS accounts and AISPL accounts?
Register as a seller
Note
Only the AWS account root user can register an account as a seller.
To sell in the Reserved Instance Marketplace, you must first register as a seller. During registration, you
provide the following information:
• Bank information—AWS must have your bank information in order to disburse funds collected when
you sell your reservations. The bank you specify must have a US address. For more information, see
Bank account for disbursement (p. 365).
• Tax information—All sellers are required to complete a tax information interview to determine any
necessary tax reporting obligations. For more information, see Tax information (p. 366).
After AWS receives your completed seller registration, you receive an email confirming your registration
and informing you that you can get started selling in the Reserved Instance Marketplace.
1. Open the Reserved Instance Marketplace Seller Registration page and sign in using your AWS
credentials.
2. On the Manage Bank Account page, provide the following information about the bank through to
receive payment:
Note
If you are using a corporate bank account, you are prompted to send the information about
the bank account via fax (1-206-765-3424).
After registration, the bank account provided is set as the default, pending verification with the
bank. It can take up to two weeks to verify a new bank account, during which time you can't receive
disbursements. For an established account, it usually takes about two days for disbursements to
complete.
365
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
1. On the Reserved Instance Marketplace Seller Registration page, sign in with the account that you
used when you registered.
2. On the Manage Bank Account page, add a new bank account or modify the default bank account as
needed.
Tax information
Your sale of Reserved Instances might be subject to a transaction-based tax, such as sales tax or value-
added tax. You should check with your business's tax, legal, finance, or accounting department to
determine if transaction-based taxes are applicable. You are responsible for collecting and sending the
transaction-based taxes to the appropriate tax authority.
As part of the seller registration process, you must complete a tax interview in the Seller Registration
Portal. The interview collects your tax information and populates an IRS form W-9, W-8BEN, or W-8BEN-
E, which is used to determine any necessary tax reporting obligations.
The tax information you enter as part of the tax interview might differ depending on whether you
operate as an individual or business, and whether you or your business are a US or non-US person or
entity. As you fill out the tax interview, keep in mind the following:
• Information provided by AWS, including the information in this topic, does not constitute tax, legal, or
other professional advice. To find out how the IRS reporting requirements might affect your business,
or if you have other questions, contact your tax, legal, or other professional advisor.
• To fulfill the IRS reporting requirements as efficiently as possible, answer all questions and enter all
information requested during the interview.
• Check your answers. Avoid misspellings or entering incorrect tax identification numbers. They can
result in an invalidated tax form.
Based on your tax interview responses and IRS reporting thresholds, Amazon might file Form 1099-K.
Amazon mails a copy of your Form 1099-K on or before January 31 in the year following the year that
your tax account reaches the threshold levels. For example, if your account reaches the threshold in
2018, your Form 1099-K is mailed on or before January 31, 2019.
For more information about IRS requirements and Form 1099-K, see the IRS website.
• Upfront price – The upfront price is the only price that you can specify for the Reserved Instance
that you're selling. The upfront price is the one-time price that the buyer pays when they purchase a
Reserved Instance.
Because the value of Reserved Instances decreases over time, by default, AWS can set prices to
decrease in equal increments month over month. However, you can set different upfront prices
based on when your reservation sells. For example, if your Reserved Instance has nine months of its
term remaining, you can specify the amount that you would accept if a customer were to purchase
that Reserved Instance with nine months remaining. You could set another price with five months
remaining, and yet another price with one month remaining.
366
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
These limits typically can't be increased, but will be evaluated on a case-by-case basis if requested. To
request a limit increase, complete the Service limit increase form. For Limit type, choose EC2 Reserved
Instance Sales.
• Can't modify – You cannot modify your listing directly. However, you can change your listing by first
canceling it and then creating another listing with new parameters.
• Can cancel – You can cancel your listing at any time, as long as it's in the active state. You cannot
cancel the listing if it's already matched or being processed for a sale. If some of the instances in your
listing are matched and you cancel the listing, only the remaining unmatched instances are removed
from the listing.
The console determines a suggested price. It checks for offerings that match your Reserved Instance and
matches the one with the lowest price. Otherwise, it calculates a suggested price based on the cost of
the Reserved Instance for its remaining time. If the calculated value is less than $1.01, the suggested
price is $1.01.
If you cancel your listing and a portion of that listing has already been sold, the cancellation is not
effective on the portion that has been sold. Only the unsold portion of the listing is no longer available
in the Reserved Instance Marketplace.
To list a Reserved Instance in the Reserved Instance Marketplace using the AWS Management
Console
To manage Reserved Instances in the Reserved Instance Marketplace using the AWS CLI
367
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
2. Note the ID of the Reserved Instance you want to list and call create-reserved-instances-listing. You
must specify the ID of the Reserved Instance, the number of instances, and the pricing schedule.
3. To view your listing, use the describe-reserved-instances-listings command.
4. To cancel your listing, use the cancel-reserved-instances-listings command.
The information displayed by Listing State is about the status of your listing in the Reserved Instance
Marketplace. It is different from the status information that is displayed by the State column in the
Reserved Instances page. This State information is about your reservation.
Lifecycle of a listing
When all the instances in your listing are matched and sold, the My Listings tab shows that the Total
instance count matches the count listed under Sold. Also, there are no Available instances left for your
listing, and its Status is closed.
When only a portion of your listing is sold, AWS retires the Reserved Instances in the listing and creates
the number of Reserved Instances equal to the Reserved Instances remaining in the count. So, the listing
ID and the listing that it represents, which now has fewer reservations for sale, is still active.
Any future sales of Reserved Instances in this listing are processed this way. When all the Reserved
Instances in the listing are sold, AWS marks the listing as closed.
The My Listings tab in the Reserved Instance console page displays the listing this way:
A buyer purchases two of the reservations, which leaves a count of three reservations still available for
sale. Because of this partial sale, AWS creates a new reservation with a count of three to represent the
remaining reservations that are still for sale.
368
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• Available = 3
• Status = active
If you cancel your listing and a portion of that listing has already sold, the cancelation is not effective
on the portion that has been sold. Only the unsold portion of the listing is no longer available in the
Reserved Instance Marketplace.
The My Listings tab contains the Listing State value. It also contains information about the term,
listing price, and a breakdown of how many instances in the listing are available, pending, sold, and
canceled.
You can also use the describe-reserved-instances-listings command with the appropriate filter to obtain
information about your listings.
Getting paid
As soon as AWS receives funds from the buyer, a message is sent to the registered owner account email
for the sold Reserved Instance.
AWS sends an Automated Clearing House (ACH) wire transfer to your specified bank account.
Typically, this transfer occurs between one to three days after your Reserved Instance has been sold.
Disbursements take place once a day. You will receive an email with a disbursement report after the
funds are released. Keep in mind that you can't receive disbursements until AWS receives verification
from your bank. This can take up to two weeks.
The Reserved Instance that you sold continues to appear when you describe your Reserved Instances.
You receive a cash disbursement for your Reserved Instances through a wire transfer directly into your
bank account. AWS charges a service fee of 12 percent of the total upfront price of each Reserved
Instance you sell in the Reserved Instance Marketplace.
For similar reasons, the buyer's ZIP code and country information are provided to the seller in the
disbursement report. As a seller, you might need this information to accompany any necessary
transaction taxes that you remit to the government (such as sales tax and value-added tax).
AWS cannot offer tax advice, but if your tax specialist determines that you need specific additional
information, contact AWS Support.
369
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
After modification, the benefit of the Reserved Instances is applied only to instances that match the new
parameters. For example, if you change the Availability Zone of a reservation, the capacity reservation
and pricing benefits are automatically applied to instance usage in the new Availability Zone. Instances
that no longer match the new parameters are charged at the On-Demand rate, unless your account has
other applicable reservations.
• The modified reservation becomes effective immediately and the pricing benefit is applied to the new
instances beginning at the hour of the modification request. For example, if you successfully modify
your reservations at 9:15PM, the pricing benefit transfers to your new instance at 9:00PM. You can
get the effective date of the modified Reserved Instances by using the describe-reserved-instances
command.
• The original reservation is retired. Its end date is the start date of the new reservation, and the end
date of the new reservation is the same as the end date of the original Reserved Instance. If you
modify a three-year reservation that had 16 months left in its term, the resulting modified reservation
is a 16-month reservation with the same end date as the original one.
• The modified reservation lists a $0 fixed price and not the fixed price of the original reservation.
• The fixed price of the modified reservation does not affect the discount pricing tier calculations
applied to your account, which are based on the fixed price of the original reservation.
If your modification request fails, your Reserved Instances maintain their original configuration, and are
immediately available for another modification request.
There is no fee for modification, and you do not receive any new bills or invoices.
You can modify your reservations as frequently as you like, but you cannot change or cancel a pending
modification request after you submit it. After the modification has completed successfully, you can
submit another modification request to roll back any changes you made, if needed.
Contents
• Requirements and restrictions for modification (p. 370)
• Submit modification requests (p. 372)
• Troubleshoot modification requests (p. 373)
370
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Change the scope from Linux and Windows A zonal Reserved Instance is
Availability Zone to Region and scoped to an Availability Zone
vice versa and reserves capacity in that
Availability Zone. If you change
the scope from Availability Zone
to Region (in other words, from
zonal to regional), you lose the
capacity reservation benefit.
Change the instance size within Linux/UNIX only The reservation must use
the same instance family and default tenancy. Some instance
generation Instance size flexibility is not families are not supported,
available for Reserved Instances because there are no other sizes
on the other platforms, which available. For more information,
include Linux with SQL Server see Support for modifying
Standard, Linux with SQL Server instance sizes in the Amazon EC2
Web, Linux with SQL Server User Guide for Linux Instances.
Enterprise, Red Hat Enterprise
Linux, SUSE Linux, Windows,
Windows with SQL Standard,
Windows with SQL Server
Enterprise, and Windows with
SQL Server Web.
Change the network from EC2- Linux and Windows The network platform must be
Classic to Amazon VPC and vice available in your AWS account.
versa If you created your AWS account
after 2013-12-04, it does not
support EC2-Classic.
Requirements
Amazon EC2 processes your modification request if there is sufficient capacity for your new configuration
(if applicable), and if the following conditions are met:
371
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• The Reserved Instance cannot be modified before or at the same time that you purchase it
• The Reserved Instance must be active
• There cannot be a pending modification request
• The Reserved Instance is not listed in the Reserved Instance Marketplace
• The original Reserved Instances are all Standard Reserved Instances or all Convertible Reserved
Instances, not some of each type
• The original Reserved Instances must expire within the same hour, if they are Standard Reserved
Instances
• The Reserved Instance is not a G4 instance.
New console
• Scope: Choose whether the configuration applies to an Availability Zone or to the whole
Region.
• Availability Zone: Choose the required Availability Zone. Not applicable for regional Reserved
Instances.
• Count: Specify the number of instances. To split the Reserved Instances into multiple
configurations, reduce the count, choose Add, and specify a count for the additional
configuration. For example, if you have a single configuration with a count of 10, you can
change its count to 6 and add a configuration with a count of 4. This process retires the
original Reserved Instance after the new Reserved Instances are activated.
4. Choose Continue.
5. To confirm your modification choices when you finish specifying your target configurations,
choose Submit modifications.
6. You can determine the status of your modification request by looking at the State column in the
Reserved Instances screen. The following are the possible states.
372
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Old console
• Scope: Choose whether the configuration applies to an Availability Zone or to the whole
Region.
• Availability Zone: Choose the required Availability Zone. Not applicable for regional Reserved
Instances.
• Count: Specify the number of instances. To split the Reserved Instances into multiple
configurations, reduce the count, choose Add, and specify a count for the additional
configuration. For example, if you have a single configuration with a count of 10, you can
change its count to 6 and add a configuration with a count of 4. This process retires the
original Reserved Instance after the new Reserved Instances are activated.
4. To confirm your modification choices when you finish specifying your target configurations,
choose Submit Modifications.
5. You can determine the status of your modification request by looking at the State column in the
Reserved Instances screen. The following are the possible states.
1. To modify your Reserved Instances, you can use one of the following commands:
• modify-reserved-instances (AWS CLI)
• Edit-EC2ReservedInstance (AWS Tools for Windows PowerShell)
2. To get the status of your modification request (processing, fulfilled, or failed), use one of
the following commands:
• describe-reserved-instances-modifications (AWS CLI)
• Get-EC2ReservedInstancesModification (AWS Tools for Windows PowerShell)
your modification request are valid. Your modification request can still fail during processing due to
unavailable capacity.
In some situations, you might get a message indicating incomplete or failed modification requests
instead of a confirmation. Use the information in such messages as a starting point for resubmitting
another modification request. Ensure that you have read the applicable restrictions (p. 370) before
submitting the request.
Amazon EC2 identifies and lists the Reserved Instances that cannot be modified. If you receive a message
like this, go to the Reserved Instances page in the Amazon EC2 console and check the information for
the Reserved Instances.
You submitted one or more Reserved Instances for modification and none of your requests can be
processed. Depending on the number of reservations you are modifying, you can get different versions of
the message.
Amazon EC2 displays the reasons why your request cannot be processed. For example, you might have
specified the same target configuration—a combination of Availability Zone and platform—for one or
more subsets of the Reserved Instances you are modifying. Try submitting the modification requests
again, but ensure that the instance details of the reservations match, and that the target configurations
for all subsets being modified are unique.
When you exchange your Convertible Reserved Instance, the number of instances for your current
reservation is exchanged for a number of instances that cover the equal or higher value of the
configuration of the new Convertible Reserved Instance. Amazon EC2 calculates the number of Reserved
Instances that you can receive as a result of the exchange.
You can't exchange Standard Reserved Instances, but you can modify them. For more information, see
Modify Reserved Instances (p. 370) .
Contents
• Requirements for exchanging Convertible Reserved Instances (p. 374)
• Calculate Convertible Reserved Instances exchanges (p. 376)
• Merge Convertible Reserved Instances (p. 376)
• Exchange a portion of a Convertible Reserved Instance (p. 377)
• Submit exchange requests (p. 377)
• Active
• Not pending a previous exchange request
• Have at least 24 hours remaining before it expires
374
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• Convertible Reserved Instances can only be exchanged for other Convertible Reserved Instances
currently offered by AWS.
• Convertible Reserved Instances are associated with a specific Region, which is fixed for the duration
of the reservation's term. You cannot exchange a Convertible Reserved Instance for a Convertible
Reserved Instance in a different Region.
• You can exchange one or more Convertible Reserved Instances at a time for one Convertible Reserved
Instance only.
• To exchange a portion of a Convertible Reserved Instance, you can modify it into two or
more reservations, and then exchange one or more of the reservations for a new Convertible
Reserved Instance. For more information, see Exchange a portion of a Convertible Reserved
Instance (p. 377). For more information about modifying your Reserved Instances, see Modify
Reserved Instances (p. 370).
• All Upfront Convertible Reserved Instances can be exchanged for Partial Upfront Convertible Reserved
Instances, and vice versa.
Note
If the total upfront payment required for the exchange (true-up cost) is less than $0.00, AWS
automatically gives you a quantity of instances in the Convertible Reserved Instance that
ensures that true-up cost is $0.00 or more.
Note
If the total value (upfront price + hourly price * number of remaining hours) of the new
Convertible Reserved Instance is less than the total value of the exchanged Convertible
Reserved Instance, AWS automatically gives you a quantity of instances in the Convertible
Reserved Instance that ensures that the total value is the same or higher than that of the
exchanged Convertible Reserved Instance.
• To benefit from better pricing, you can exchange a No Upfront Convertible Reserved Instance for an All
Upfront or Partial Upfront Convertible Reserved Instance.
• You cannot exchange All Upfront and Partial Upfront Convertible Reserved Instances for No Upfront
Convertible Reserved Instances.
• You can exchange a No Upfront Convertible Reserved Instance for another No Upfront Convertible
Reserved Instance only if the new Convertible Reserved Instance's hourly price is the same or higher
than the exchanged Convertible Reserved Instance's hourly price.
Note
If the total value (hourly price * number of remaining hours) of the new Convertible Reserved
Instance is less than the total value of the exchanged Convertible Reserved Instance, AWS
automatically gives you a quantity of instances in the Convertible Reserved Instance that
ensures that the total value is the same or higher than that of the exchanged Convertible
Reserved Instance.
• If you exchange multiple Convertible Reserved Instances that have different expiration dates, the
expiration date for the new Convertible Reserved Instance is the date that's furthest in the future.
• If you exchange a single Convertible Reserved Instance, it must have the same term (1-year or 3-
years) as the new Convertible Reserved Instance. If you merge multiple Convertible Reserved Instances
with different term lengths, the new Convertible Reserved Instance has a 3-year term. For more
information, see Merge Convertible Reserved Instances (p. 376).
• When Amazon EC2 exchanges a Convertible Reserved Instance, it retires the associated reservation,
and transfers the end date to the new reservation. After the exchange, Amazon EC2 sets both the
end date for the old reservation and the start date for the new reservation equal to the date of the
exchange. For example, if you exchange a three-year reservation that had 16 months left in its term,
the new reservation is a 16-month reservation with the same end date as the reservation from the
Convertible Reserved Instance that you exchanged.
375
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Each Convertible Reserved Instance has a list value. This list value is compared to the list value of the
Convertible Reserved Instances that you want in order to determine how many instance reservations you
can receive from the exchange.
For example: You have 1 x $35-list value Convertible Reserved Instance that you want to exchange for a
new instance type with a list value of $10.
$35/$10 = 3.5
You can exchange your Convertible Reserved Instance for three $10 Convertible Reserved Instances.
It's not possible to purchase half reservations; therefore you must purchase an additional Convertible
Reserved Instance to cover the remainder:
The fourth Convertible Reserved Instance has the same end date as the other three. If you are
exchanging Partial or All Upfront Convertible Reserved Instances, you pay the true-up cost for the fourth
reservation. If the remaining upfront cost of your Convertible Reserved Instances is $500, and the new
reservation would normally cost $600 on a prorated basis, you are charged $100.
$600 prorated upfront cost of new reservations - $500 remaining upfront cost of original
reservations = $100 difference
For example, you have the following Convertible Reserved Instances in your account:
• You can merge aaaa1111 and bbbb2222 and exchange them for a 1-year Convertible Reserved
Instance. You cannot exchange them for a 3-year Convertible Reserved Instance. The expiration date of
the new Convertible Reserved Instance is 2018-12-31.
• You can merge bbbb2222 and cccc3333 and exchange them for a 3-year Convertible Reserved
Instance. You cannot exchange them for a 1-year Convertible Reserved Instance. The expiration date of
the new Convertible Reserved Instance is 2018-07-31.
376
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
• You can merge cccc3333 and dddd4444 and exchange them for a 3-year Convertible Reserved
Instance. You cannot exchange them for a 1-year Convertible Reserved Instance. The expiration date of
the new Convertible Reserved Instance is 2019-12-31.
In this example, you have a t2.micro Convertible Reserved Instance with four instances in the
reservation. To exchange two t2.micro instances for an m4.xlarge instance:
1. Modify the t2.micro Convertible Reserved Instance by splitting it into two t2.micro Convertible
Reserved Instances with two instances each.
2. Exchange one of the new t2.micro Convertible Reserved Instances for an m4.xlarge Convertible
Reserved Instance.
You can search for Convertible Reserved Instances offerings and select your new configuration from the
choices provided.
New console
377
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Old console
The Reserved Instances that were exchanged are retired, and the new Reserved Instances are displayed in
the Amazon EC2 console. This process can take a few minutes to propagate.
To exchange a Convertible Reserved Instance, first find a new Convertible Reserved Instance that meets
your needs:
Get a quote for the exchange, which includes the number of Reserved Instances you get from the
exchange, and the true-up cost for the exchange:
New regional (p. 344) Reserved Instances 20 per Region per month
New zonal (p. 344) Reserved Instances 20 per Availability Zone per month
For example, in a Region with three Availability Zones, the default quota is 80 new Reserved Instances
per month, calculated as follows:
378
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reserved Instances
Quotas apply to running instances only. If your instance is pending, stopping, stopped, or hibernated, it
does not count towards your quota.
You can view how many Reserved Instances you have purchased by using the Amazon EC2 or the AWS
CLI.
Console
In the following screenshot, the selected line represents a single Reserved Instance
configuration for a t3.micro instance type. The Instance count column in the table view and
the Instance count field in the detail view (outlined in the screenshot) indicate that there are 10
Reserved Instances for this configuration.
AWS CLI
Use the describe-reserved-instances CLI command and specify the ID of the Reserved Instance
configuration.
Example output – The InstanceCount field indicates that there are 10 Reserved Instances for this
configuration.
-------------------------------------------------------------------
| DescribeReservedInstances |
379
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled Instances
+-----------------------------------------------------------------+
|| ReservedInstances ||
|+----------------------+----------------------------------------+|
|| CurrencyCode | USD ||
|| Duration | 31536000 ||
|| End | 2023-08-27T13:29:44+00:00 ||
|| FixedPrice | 59.0 ||
|| InstanceCount | 10 ||
|| InstanceTenancy | default ||
|| InstanceType | t3.micro ||
|| OfferingClass | standard ||
|| OfferingType | All Upfront ||
|| ProductDescription | Linux/UNIX ||
|| ReservedInstancesId | 2fbf16dd-98b6-4a3a-955f-83f87790f04b ||
|| Scope | Region ||
|| Start | 2022-08-27T13:29:45.938000+00:00 ||
|| State | active ||
|| UsagePrice | 0.0 ||
|+----------------------+----------------------------------------+|
||| RecurringCharges |||
||+----------------------------------+--------------------------+||
||| Amount | 0.0 |||
||| Frequency | Hourly |||
||+----------------------------------+--------------------------+||
Considerations
A regional Reserved Instance applies a discount to a running On-Demand Instance. The default On-
Demand Instance limit is 20. You cannot exceed your running On-Demand Instance limit by purchasing
regional Reserved Instances. For example, if you already have 20 running On-Demand Instances, and you
purchase 20 regional Reserved Instances, the 20 regional Reserved Instances are used to apply a discount
to the 20 running On-Demand Instances. If you purchase more regional Reserved Instances, you will not
be able to launch more instances because you have reached your On-Demand Instance limit.
Before purchasing regional Reserved Instances, make sure your On-Demand Instance limit matches or
exceeds the number of regional Reserved Instances you intend to own. If required, make sure you request
an increase to your On-Demand Instance limit before purchasing more regional Reserved Instances.
A zonal Reserved Instance—a Reserved Instance that is purchased for a specific Availability Zone—
provides a capacity reservation as well as a discount. You can exceed your running On-Demand Instance
limit by purchasing zonal Reserved Instances. For example, if you already have 20 running On-Demand
Instances, and you purchase 20 zonal Reserved Instances, you can launch a further 20 On-Demand
Instances that match the specifications of your zonal Reserved Instances, giving you a total of 40 running
instances.
380
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled Instances
future. To reserve capacity, use On-Demand Capacity Reservations (p. 492) instead. For
discounted rates, use Savings Plans.
381
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Spot Instances
A Spot Instance is an instance that uses spare EC2 capacity that is available for less than the On-Demand
price. Because Spot Instances enable you to request unused EC2 instances at steep discounts, you can
lower your Amazon EC2 costs significantly. The hourly price for a Spot Instance is called a Spot price. The
Spot price of each instance type in each Availability Zone is set by Amazon EC2, and is adjusted gradually
based on the long-term supply of and demand for Spot Instances. Your Spot Instance runs whenever
capacity is available.
Spot Instances are a cost-effective choice if you can be flexible about when your applications run and if
your applications can be interrupted. For example, Spot Instances are well-suited for data analysis, batch
jobs, background processing, and optional tasks. For more information, see Amazon EC2 Spot Instances.
For a comparison of the different purchasing options for EC2 instances, see Instance purchasing
options (p. 336).
Topics
Concepts
Before you get started with Spot Instances, you should be familiar with the following concepts:
• Spot capacity pool – A set of unused EC2 instances with the same instance type (for example,
m5.large) and Availability Zone.
• Spot price – The current price of a Spot Instance per hour.
• Spot Instance request – Requests a Spot Instance. When capacity is available, Amazon EC2 fulfills your
request. A Spot Instance request is either one-time or persistent. Amazon EC2 automatically resubmits
a persistent Spot Instance request after the Spot Instance associated with the request is interrupted.
• EC2 instance rebalance recommendation – Amazon EC2 emits an instance rebalance recommendation
signal to notify you that a Spot Instance is at an elevated risk of interruption. This signal provides an
opportunity to proactively rebalance your workloads across existing or new Spot Instances without
having to wait for the two-minute Spot Instance interruption notice.
• Spot Instance interruption – Amazon EC2 terminates, stops, or hibernates your Spot Instance when
Amazon EC2 needs the capacity back. Amazon EC2 provides a Spot Instance interruption notice, which
gives the instance a two-minute warning before it is interrupted.
Launch time Can only be launched immediately if Can only be launched immediately if
the Spot Instance request is active and you make a manual launch request and
capacity is available. capacity is available.
Available If capacity is not available, the If capacity is not available when you
capacity Spot Instance request continues to make a launch request, you get an
insufficient capacity error (ICE).
382
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Hourly price The hourly price for Spot Instances varies The hourly price for On-Demand
based on long-term supply and demand. Instances is static.
Rebalance The signal that Amazon EC2 emits for a You determine when an On-Demand
recommendationrunning Spot Instance when the instance Instance is interrupted (stopped,
is at an elevated risk of interruption. hibernated, or terminated).
Instance You can stop and start an Amazon EBS- You determine when an On-Demand
interruption backed Spot Instance. In addition, Amazon Instance is interrupted (stopped,
EC2 can interrupt (p. 421) an individual hibernated, or terminated).
Spot Instance if capacity is no longer
available.
Spot basics
Related services
You can provision Spot Instances directly using Amazon EC2. You can also provision Spot Instances using
other services in AWS. For more information, see the following documentation.
You can create launch templates or configurations so that Amazon EC2 Auto Scaling can launch
Spot Instances. For more information, see Requesting Spot Instances for fault-tolerant and flexible
applications and Auto Scaling groups with multiple instance types and purchase options in the
Amazon EC2 Auto Scaling User Guide.
Amazon EMR and Spot Instances
There are scenarios where it can be useful to run Spot Instances in an Amazon EMR cluster. For
more information, see Spot Instances and When Should You Use Spot Instances in the Amazon EMR
Management Guide.
383
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
AWS CloudFormation enables you to create and manage a collection of AWS resources using a
template in JSON format. For more information, see EC2 Spot Instance Updates - Auto Scaling and
CloudFormation Integration.
AWS SDK for Java
You can use the Java programming language to manage your Spot Instances. For more information,
see Tutorial: Amazon EC2 Spot Instances and Tutorial: Advanced Amazon EC2 Spot Request
Management.
AWS SDK for .NET
You can use the .NET programming environment to manage your Spot Instances. For more
information, see Tutorial: Amazon EC2 Spot Instances.
If you or Amazon EC2 interrupts a running Spot Instance, you are charged for the seconds used or the full
hour, or you receive no charge, depending on the operating system used and who interrupted the Spot
Instance. For more information, see Billing for interrupted Spot Instances (p. 431).
View prices
To view the current (updated every five minutes) lowest Spot price per AWS Region and instance type,
see the Amazon EC2 Spot Instances Pricing page.
To view the Spot price history for the past three months, use the Amazon EC2 console or the
describe-spot-price-history command (AWS CLI). For more information, see Spot Instance pricing
history (p. 389).
We independently map Availability Zones to codes for each AWS account. Therefore, you can get
different results for the same Availability Zone code (for example, us-west-2a) between different
accounts.
View savings
You can view the savings made from using Spot Instances for a single Spot Fleet (p. 979) or for all
Spot Instances. You can view the savings made in the last hour or the last three days, and you can view
the average cost per vCPU hour and per memory (GiB) hour. Savings are estimated and may differ from
actual savings because they do not include the billing adjustments for your usage. For more information
about viewing savings information, see Savings from purchasing Spot Instances (p. 390).
View billing
Your bill provides details about your service usage. For more information, see Viewing your bill in the
AWS Billing User Guide.
384
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Spot Instances are recommended for stateless, fault-tolerant, flexible applications. For example,
Spot Instances work well for big data, containerized workloads, CI/CD, stateless web servers, high
performance computing (HPC), and rendering workloads.
While running, Spot Instances are exactly the same as On-Demand Instances. However, Spot does
not guarantee that you can keep your running instances long enough to finish your workloads. Spot
also does not guarantee that you can get immediate availability of the instances that you are looking
for, or that you can always get the aggregate capacity that you requested. Moreover, Spot Instance
interruptions and capacity can change over time because Spot Instance availability varies based on
supply and demand, and past performance isn’t a guarantee of future results.
Spot Instances are not suitable for workloads that are inflexible, stateful, fault-intolerant, or tightly
coupled between instance nodes. They're also not recommended for workloads that are intolerant
of occasional periods when the target capacity is not completely available. We strongly warn against
using Spot Instances for these workloads or attempting to fail-over to On-Demand Instances to handle
interruptions.
Regardless of whether you're an experienced Spot user or new to Spot Instances, if you are currently
experiencing issues with Spot Instance interruptions or availability, we recommend that you follow these
best practices to have the best experience using the Spot service.
An EC2 Instance rebalance recommendation is a new signal that notifies you when a Spot Instance is
at elevated risk of interruption. The signal gives you the opportunity to proactively manage the Spot
Instance in advance of the two-minute Spot Instance interruption notice. You can decide to rebalance
your workload to new or existing Spot Instances that are not at an elevated risk of interruption. We've
made it easy for you to use this new signal by using the Capacity Rebalancing feature in Auto Scaling
groups and Spot Fleet. For more information, see Use proactive capacity rebalancing (p. 386).
A Spot Instance interruption notice is a warning that is issued two minutes before Amazon EC2 interrupts
a Spot Instance. If your workload is "time-flexible," you can configure your Spot Instances to be stopped
or hibernated, instead of being terminated, when they are interrupted. Amazon EC2 automatically stops
or hibernates your Spot Instances on interruption, and automatically resumes the instances when we
have available capacity.
We recommend that you create a rule in Amazon EventBridge that captures the rebalance
recommendations and interruption notifications, and then triggers a checkpoint for the progress of
your workload or gracefully handles the interruption. For more information, see Monitor rebalance
recommendation signals (p. 419). For a detailed example that walks you through how to create and use
event rules, see Taking Advantage of Amazon EC2 Spot Instance Interruption Notices.
For more information, see EC2 instance rebalance recommendations (p. 418) and Spot Instance
interruptions (p. 421).
385
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Depending on your specific needs, you can evaluate which instance types you can be flexible across
to fulfill your compute requirements. If a workload can be vertically scaled, you should include larger
instance types (more vCPUs and memory) in your requests. If you can only scale horizontally, you should
include older generation instance types because they are less in demand from On-Demand customers.
A good rule of thumb is to be flexible across at least 10 instance types for each workload. In addition,
make sure that all Availability Zones are configured for use in your VPC and selected for your workload.
Use EC2 Auto Scaling groups or Spot Fleet to manage your aggregate capacity
Spot enables you to think in terms of aggregate capacity—in units that include vCPUs, memory, storage,
or network throughput—rather than thinking in terms of individual instances. Auto Scaling groups and
Spot Fleet enable you to launch and maintain a target capacity, and to automatically request resources
to replace any that are disrupted or manually terminated. When you configure an Auto Scaling group
or a Spot Fleet, you need only specify the instance types and target capacity based on your application
needs. For more information, see Auto Scaling groups in the Amazon EC2 Auto Scaling User Guide and
Create a Spot Fleet request (p. 1012) in this user guide.
386
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
CreateFleet • You need multiple Create a fleet of both Yes – in instant mode
instances with On-Demand Instances if you don’t need auto
either a single and Spot Instances scaling
configuration or a in a single request,
mixed configuration. with multiple launch
• You want to self- specifications that
manage your vary by instance type,
instance lifecycle. AMI, Availability Zone,
or subnet. The Spot
• If you don’t need
Instance allocation
auto scaling, we
strategy defaults to
recommend that you
lowest-price per
use an instant type
unit, but you can
fleet.
change it to price-
capacity-optimized,
capacity-optimized,
or diversified.
387
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
You can launch a Spot Instance using several different services. For more information, see Getting
Started with Amazon EC2 Spot Instances. In this user guide, we describe the following ways to launch a
Spot Instance using EC2:
• You can create a Spot Instance request by using the launch instance wizard (p. 539) in the Amazon
EC2 console or the run-instances AWS CLI command. For more information, see Create a Spot Instance
request (p. 395).
• You can create an EC2 Fleet, in which you specify the desired number of Spot Instances. Amazon EC2
creates a Spot Instance request on your behalf for every Spot Instance that is specified in the EC2
Fleet. For more information, see Create an EC2 Fleet (p. 967).
• You can create a Spot Fleet request, in which you specify the desired number of Spot Instances.
Amazon EC2 creates a Spot Instance request on your behalf for every Spot Instance that is specified in
the Spot Fleet request. For more information, see Create a Spot Fleet request (p. 1012).
Your Spot Instance runs until you stop or terminate it, or until Amazon EC2 interrupts it (known as a Spot
Instance interruption).
When you use Spot Instances, you must be prepared for interruptions. Amazon EC2 can interrupt your
Spot Instance when the demand for Spot Instances rises or when the supply of Spot Instances decreases.
When Amazon EC2 interrupts a Spot Instance, it provides a Spot Instance interruption notice, which
gives the instance a two-minute warning before Amazon EC2 interrupts it. You can't enable termination
protection for Spot Instances. For more information, see Spot Instance interruptions (p. 421).
You can stop, start, reboot, or terminate an Amazon EBS-backed Spot Instance. The Spot service can
stop, terminate, or hibernate a Spot Instance when it interrupts it.
Contents
• Launch Spot Instances in a launch group (p. 389)
• Launch Spot Instances in an Availability Zone group (p. 389)
388
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Although this option can be useful, adding this constraint can decrease the chances that your Spot
Instance request is fulfilled and increase the chances that your Spot Instances are terminated. For
example, your launch group includes instances in multiple Availability Zones. If capacity in one of these
Availability Zones decreases and is no longer available, then Amazon EC2 terminates all instances for the
launch group.
If you create another successful Spot Instance request that specifies the same (existing) launch group
as an earlier successful request, then the new instances are added to the launch group. Subsequently, if
an instance in this launch group is terminated, all instances in the launch group are terminated, which
includes instances launched by the first and second requests.
Although this option can be useful, adding this constraint can lower the chances that your Spot Instance
request is fulfilled.
If you specify an Availability Zone group but don't specify an Availability Zone in the Spot Instance
request, the result depends on the network you specified.
Default VPC
Amazon EC2 uses the Availability Zone for the specified subnet. If you don't specify a subnet, it selects
an Availability Zone and its default subnet, but not necessarily the lowest-priced zone. If you deleted the
default subnet for an Availability Zone, then you must specify a different subnet.
Nondefault VPC
Amazon EC2 uses the Availability Zone for the specified subnet.
• [Default VPC] If you want your Spot Instance launched in a specific low-priced Availability Zone, you
must specify the corresponding subnet in your Spot Instance request. If you do not specify a subnet,
Amazon EC2 selects one for you, and the Availability Zone for this subnet might not have the lowest
Spot price.
• [Nondefault VPC] You must specify the subnet for your Spot Instance.
389
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
When your Spot request is fulfilled, your Spot Instances launch at the current Spot price, not exceeding
the On-Demand price. You can view the Spot price history for the last 90 days, filtering by instance type,
operating system, and Availability Zone.
For the current Spot Instance prices, see Amazon EC2 Spot Instances Pricing.
• If you choose Availability Zones, then choose the Instance type, operating system (Platform),
and Date range for which to view the price history.
• If you choose Instance Types, then choose up to five Instance type(s), the Availability Zone,
operating system (Platform), and Date range for which to view the price history.
The following screenshot shows a price comparison for different instance types.
5. Hover (move your pointer) over the graph to display the prices at specific times in the selected date
range. The prices are displayed in the information blocks above the graph. The price displayed in the
top row shows the price on a specific date. The price displayed in the second row shows the average
price over the selected date range.
6. To display the price per vCPU, toggle on Display normalized prices. To display the price for the
instance type, toggle off Display normalized prices.
You can use one of the following commands. For more information, see Access Amazon EC2 (p. 3).
390
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
launched and terminated by the fleet. You can view this information from the last hour or the last three
days.
The following screenshot from the Savings section shows the Spot usage and savings information for a
Spot Fleet.
• Spot Instances – The number of Spot Instances launched and terminated by the Spot Fleet. When
viewing the savings summary, the number represents all your running Spot Instances.
• vCPU-hours – The number of vCPU hours used across all the Spot Instances for the selected time
frame.
• Mem(GiB)-hours – The number of GiB hours used across all the Spot Instances for the selected time
frame.
• On-Demand total – The total amount you would've paid for the selected time frame had you launched
these instances as On-Demand Instances.
• Spot total – The total amount to pay for the selected time frame.
• Savings – The percentage that you are saving by not paying the On-Demand price.
• Average cost per vCPU-hour – The average hourly cost of using the vCPUs across all the Spot
Instances for the selected time frame, calculated as follows: Average cost per vCPU-hour = Spot total
/ vCPU-hours.
• Average cost per mem(GiB)-hour – The average hourly cost of using the GiBs across all the Spot
Instances for the selected time frame, calculated as follows: Average cost per mem(GiB)-hour = Spot
total / Mem(GiB)-hours.
• Details table – The different instance types (the number of instances per instance type is in
parentheses) that comprise the Spot Fleet. When viewing the savings summary, these comprise all
your running Spot Instances.
Savings information can only be viewed using the Amazon EC2 console.
Alternatively, select the check box next to the Spot Fleet request ID and choose the Savings tab.
4. By default, the page displays usage and savings information for the last three days. You can choose
last hour or the last three days. For Spot Fleets that were launched less than an hour ago, the page
shows the estimated savings for the hour.
391
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
To view the savings information for all running Spot Instances (console)
The following illustration shows how Spot Instance requests work. Notice that the request type (one-
time or persistent) determines whether the request is opened again when Amazon EC2 interrupts a Spot
Instance or if you stop a Spot Instance. If the request is persistent, the request is opened again after your
Spot Instance is interrupted. If the request is persistent and you stop your Spot Instance, the request only
opens after you start your Spot Instance.
Contents
• Spot Instance request states (p. 393)
• Specify a tenancy for your Spot Instances (p. 394)
• Service-linked role for Spot Instance requests (p. 394)
• Create a Spot Instance request (p. 395)
• Find running Spot Instances (p. 400)
• Tag Spot Instance requests (p. 401)
• Cancel a Spot Instance request (p. 406)
• Stop a Spot Instance (p. 407)
• Start a Spot Instance (p. 408)
392
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The following illustration represents the transitions between the request states. Notice that the
transitions depend on the request type (one-time or persistent).
A one-time Spot Instance request remains active until Amazon EC2 launches the Spot Instance, the
request expires, or you cancel the request. If capacity is not available, your Spot Instance is terminated
and the Spot Instance request is closed.
A persistent Spot Instance request remains active until it expires or you cancel it, even if the request is
fulfilled. If capacity is not available, your Spot Instance is interrupted. After your instance is interrupted,
when capacity becomes available again, the Spot Instance is started if stopped or resumed if hibernated.
You can stop a Spot Instance and start it again if capacity is available. If the Spot Instance is terminated
(irrespective of whether the Spot Instance is in a stopped or running state), the Spot Instance request
is opened again and Amazon EC2 launches a new Spot Instance. For more information, see Stop a Spot
Instance (p. 407), Start a Spot Instance (p. 408), and Terminate a Spot Instance (p. 408).
You can track the status of your Spot Instance requests, as well as the status of the Spot Instances
launched, through the status. For more information, see Spot request status (p. 411).
393
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
• Specify a tenancy of dedicated when you create the Spot Instance request. For more information,
see Create a Spot Instance request (p. 395).
• Request a Spot Instance in a VPC with an instance tenancy of dedicated. For more information, see
Create a VPC with a dedicated instance tenancy (p. 489). You cannot request a Spot Instance with a
tenancy of default if you request it in a VPC with an instance tenancy of dedicated.
All instance families support Dedicated Spot Instances except T instances. For each supported instance
family, only the largest instance size or metal size supports Dedicated Spot Instances.
Amazon EC2 uses the service-linked role named AWSServiceRoleForEC2Spot to launch and manage
Spot Instances on your behalf.
If you had an active Spot Instance request before October 2017, when Amazon EC2 began supporting
this service-linked role, Amazon EC2 created the AWSServiceRoleForEC2Spot role in your AWS account.
For more information, see A New Role Appeared in My Account in the IAM User Guide.
If you use the AWS CLI or an API to request a Spot Instance, you must first ensure that this role exists.
394
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
If you no longer need to use Spot Instances, we recommend that you delete the
AWSServiceRoleForEC2Spot role. After this role is deleted from your account, Amazon EC2 will create
the role again if you request Spot Instances.
Grant access to customer managed keys for use with encrypted AMIs and EBS snapshots
If you specify an encrypted AMI (p. 185) or an encrypted Amazon EBS snapshot (p. 1732) for
your Spot Instances and you use a customer managed key for encryption, you must grant the
AWSServiceRoleForEC2Spot role permission to use the customer managed key so that Amazon EC2 can
launch Spot Instances on your behalf. To do this, you must add a grant to the customer managed key, as
shown in the following procedure.
When providing permissions, grants are an alternative to key policies. For more information, see Using
Grants and Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide.
To grant the AWSServiceRoleForEC2Spot role permissions to use the customer managed key
• Use the create-grant command to add a grant to the customer managed key and to specify the
principal (the AWSServiceRoleForEC2Spot service-linked role) that is given permission to perform
the operations that the grant permits. The customer managed key is specified by the key-id
parameter and the ARN of the customer managed key. The principal is specified by the grantee-
principal parameter and the ARN of the AWSServiceRoleForEC2Spot service-linked role.
• You're already using the launch instance wizard (p. 539) or run-instances command to launch On-
Demand Instances, and you simply want to change to launching Spot Instances by changing a single
parameter.
• You do not need multiple instances with different instance types.
This method is generally not recommended for launching Spot Instances because you can't specify
multiple instance types, and you can't launch Spot Instances and On-Demand Instances in the same
request. For the preferred methods for launching Spot Instances, which include launching a fleet that
includes Spot Instances and On-Demand Instances with multiple instance types, see Which is the best
Spot request method to use? (p. 387)
395
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
If you request multiple Spot Instances at one time, Amazon EC2 creates separate Spot Instance requests
so that you can track the status of each request separately. For more information about tracking Spot
Instance requests, see Spot request status (p. 411).
New console
Steps 1–9 are the same steps you'd use to launch an On-Demand Instance. At Step 10, you configure
the Spot Instance request.
The instance name is a tag, where the key is Name, and the value is the name that you
specify. If you don't specify a name, the instance can be identified by its ID, which is
automatically generated when you launch the instance.
b. To tag the Spot Instance request, the instance, the volumes, and the elastic graphics, choose
Add additional tags. Choose Add tag, and then enter a key and value, and select the
resource type to tag. Choose Add tag again for each additional tag to add.
5. Under Application and OS Images (Amazon Machine Image), choose the operating system
(OS) for your instance, and then select an AMI. For more information, see Application and OS
Images (Amazon Machine Image) (p. 542).
6. Under Instance type, select the instance type that meets your requirements for the hardware
configuration and size of your instance. For more information, see Instance type (p. 543).
7. Under Key pair (login), choose an existing key pair, or choose Create new key pair to create a
new one. For more information, see Amazon EC2 key pairs and Windows instances (p. 1476).
Important
If you choose the Proceed without key pair (Not recommended) option, you won't be
able to connect to the instance unless you choose an AMI that is configured to allow
users another way to log in.
8. Under Network settings, use the default settings, or choose Edit to configure the network
settings as necessary.
Security groups form part of the network settings, and define firewall rules for your instance.
These rules specify which incoming network traffic is delivered to your instance.
a. Under Purchasing option, select the Request Spot Instances check box.
b. You can either keep the default configuration for the Spot Instance request, or choose
Customize (at the right) to specify custom settings for your Spot Instance request.
396
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
i. Maximum price: You can request Spot Instances at the Spot price, capped at the On-
Demand price, or you can specify the maximum amount you're willing to pay.
Warning
If you specify a maximum price, your instances will be interrupted more
frequently than if you choose No maximum price.
• No maximum price: Your Spot Instance will launch at the current Spot price. The
price will never exceed the On-Demand price. (Recommended)
• Set your maximum price (per instance/hour): You can specify the maximum
amount you're willing pay.
• If you specify a maximum price that is less than the current Spot price, your Spot
Instance will not launch.
• If you specify a maximum price that is more than the current Spot price, your Spot
Instance will launch and be charged at the current Spot price. After your Spot
Instance is running, if the Spot price rises above your maximum price, Amazon EC2
interrupts your Spot Instance.
• Regardless of the maximum price you specify, you will always be charged the
current Spot price.
To review Spot price trends, see Spot Instance pricing history (p. 389).
ii. Request type: The Spot Instance request type that you choose determines what
happens if your Spot Instance is interrupted.
• One-time: Amazon EC2 places a one-time request for your Spot Instance. If your
Spot Instance is interrupted, the request is not resubmitted.
• Persistent request: Amazon EC2 places a persistent request for your Spot Instance.
If your Spot Instance is interrupted, the request is resubmitted to replenish the
interrupted Spot Instance.
This field is not supported for one-time requests. A one-time request remains active
until all the instances in the request launch or you cancel the request.
• No request expiry date: The request remains active until you cancel it.
• Set your request expiry date: The persistent request remains active until the date
that you specify, or until you cancel it.
iv. Interruption behavior: The behavior that you choose determines what happens when a
Spot Instance is interrupted.
• For persistent requests, valid values are Stop and Hibernate. When an instance is
stopped, charges for EBS volume storage apply.
• For one-time requests, only Terminate is valid.
If you do not specify a value, the default is Terminate, which is not valid for a
persistent Spot Instance request. If you keep the default and try to launch a persistent
Spot Instance request, you'll get an error.
397
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Note
Spot Instances with a defined duration (also known as Spot blocks) are no
longer supported.
11. On the Summary panel, for Number of instances, enter the number of instances to launch.
Note
Amazon EC2 creates a separate request for each Spot Instance.
12. On the Summary panel, review the details of your instance, and make any necessary changes.
After you submit your Spot Instance request, you can't change the parameters of the request.
You can navigate directly to a section in the launch instance wizard by choosing its link in the
Summary panel. For more information, see Summary (p. 547).
13. When you're ready to launch your instance, choose Launch instance.
If the instance fails to launch or the state immediately goes to terminated instead of
running, see Troubleshoot instance launch issues (p. 1923).
Old console
398
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
• Regardless of the maximum price you specify, you will always be charged the current Spot
price.
• If you leave the field empty, you'll pay the current Spot price.
• Persistent request: Choose Persistent request to resubmit the Spot Instance request if your
Spot Instance is interrupted.
• Interruption behavior: By default, the Spot service terminates a Spot Instance when it is
interrupted. If you choose Persistent request, you can then specify that the Spot service stops
or hibernates your Spot Instance when it's interrupted. For more information, see Interruption
behavior (p. 422).
• (Optional) Request valid to: Choose Edit to specify when the Spot Instance request expires.
For more information about configuring your Spot Instance, see Step 3: Configure Instance
Details (p. 550).
7. The AMI you selected includes one or more volumes of storage, including the root device
volume. On the Add Storage page, you can specify additional volumes to attach to the instance
by choosing Add New Volume. For more information, see Step 4: Add Storage (p. 552).
8. On the Add Tags page, specify tags (p. 1894) by providing key and value combinations. For
more information, see Step 5: Add Tags (p. 553).
9. On the Configure Security Group page, use a security group to define firewall rules for your
instance. These rules specify which incoming network traffic is delivered to your instance. All
other traffic is ignored. (For more information about security groups, see Amazon EC2 security
groups for Windows instances (p. 1488).) Select or create a security group, and then choose
Review and Launch. For more information, see Step 6: Configure Security Group (p. 553).
10. On the Review Instance Launch page, check the details of your instance, and make any
necessary changes by choosing the appropriate Edit link. When you are ready, choose Launch.
For more information, see Step 7: Review Instance Launch and Select Key Pair (p. 553).
11. In the Select an existing key pair or create a new key pair dialog box, you can choose an
existing key pair, or create a new one. For example, choose Choose an existing key pair, then
select the key pair that you created when getting set up. For more information, see Amazon EC2
key pairs and Windows instances (p. 1476).
Important
If you choose the Proceed without key pair option, you won't be able to connect to the
instance unless you choose an AMI that is configured to allow users another way to log
in.
12. To launch your instance, select the acknowledgment check box, then choose Launch Instances.
If the instance fails to launch or the state immediately goes to terminated instead of
running, see Troubleshoot instance launch issues (p. 1923).
AWS CLI
Use the run-instances command and specify the Spot Instance options in the --instance-
market-options parameter.
399
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
--instance-market-options file://spot-options.json
The following is the data structure to specify in the JSON file for --instance-market-options.
You can also specify ValidUntil and InstanceInterruptionBehavior. If you do not specify a
field in the data structure, the default value is used.
{
"MarketType": "spot",
"SpotOptions": {
"SpotInstanceType": "persistent"
}
}
For example launch specification files to use with these commands, see Spot Instance request
example launch specifications (p. 409). If you download a launch specification file from the Spot
Requests console, you must use the request-spot-fleet command instead (the Spot Requests console
specifies a Spot Instance request using a Spot Fleet).
400
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Note
For Spot Instance requests that are created by a Spot Fleet, the requests are not tagged
instantly with the system tag that indicates the Spot Fleet to which they belong, and for a
period of time may appear separate from Spot Fleet request.
Alternatively, in the navigation pane, choose Instances. In the top right corner, choose the settings
icon ( ), and then under Attribute columns, select Instance lifecycle. For each instance, Instance
lifecycle is either normal, spot, or scheduled.
To enumerate your Spot Instances, use the describe-spot-instance-requests command with the --query
option.
[
{
"ID": "i-1234567890abcdef0"
},
{
"ID": "i-0598c7d356eba48d7"
}
]
Alternatively, you can enumerate your Spot Instances using the describe-instances command with the --
filters option.
To describe a single Spot Instance instance, use the describe-spot-instance-requests command with the
--spot-instance-request-ids option.
When you tag a Spot Instance request, the instances and volumes that are launched by the Spot Instance
request are not automatically tagged. You need to explicitly tag the instances and volumes launched
by the Spot Instance request. You can assign a tag to a Spot Instance and volumes during launch, or
afterward.
For more information about how tags work, see Tag your Amazon EC2 resources (p. 1894).
Contents
401
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Prerequisites
Grant the user the permission to tag resources. For more information about IAM policies and example
policies, see Example: Tag resources (p. 1445).
The IAM policy you create is determined by which method you use for creating a Spot Instance request.
• If you use the launch instance wizard or run-instances to request Spot Instances, see To grant a
user the permission to tag resources when using the launch instance wizard or run-instances.
• If you use the request-spot-instances command to request Spot Instances, see To grant a user
the permission to tag resources when using request-spot-instances.
To grant a user the permission to tag resources when using the launch instance wizard or run-
instances
• The ec2:RunInstances action. This grants the user permission to launch an instance.
• For Resource, specify spot-instances-request. This allows users to create Spot Instance
requests, which request Spot Instances.
• The ec2:CreateTags action. This grants the user permission to create tags.
• For Resource, specify *. This allows users to tag all resources that are created during instance launch.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowLaunchInstances",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
},
{
"Sid": "TagSpotInstanceRequests",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
402
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Note
When you use the RunInstances action to create Spot Instance requests and tag the Spot
Instance requests on create, you need to be aware of how Amazon EC2 evaluates the spot-
instances-request resource in the RunInstances statement.
The spot-instances-request resource is evaluated in the IAM policy as follows:
• If you don't tag a Spot Instance request on create, Amazon EC2 does not evaluate the spot-
instances-request resource in the RunInstances statement.
• If you tag a Spot Instance request on create, Amazon EC2 evaluates the spot-instances-
request resource in the RunInstances statement.
Therefore, for the spot-instances-request resource, the following rules apply to the IAM
policy:
• If you use RunInstances to create a Spot Instance request and you don't intend to tag the Spot
Instance request on create, you don’t need to explicitly allow the spot-instances-request
resource; the call will succeed.
• If you use RunInstances to create a Spot Instance request and intend to tag the Spot Instance
request on create, you must include the spot-instances-request resource in the
RunInstances allow statement, otherwise the call will fail.
• If you use RunInstances to create a Spot Instance request and intend to tag the Spot Instance
request on create, you must specify the spot-instances-request resource or include a *
wildcard in the CreateTags allow statement, otherwise the call will fail.
For example IAM policies, including policies that are not supported for Spot Instance requests,
see Work with Spot Instances (p. 1439).
• The ec2:RequestSpotInstances action. This grants the user permission to create a Spot Instance
request.
• The ec2:CreateTags action. This grants the user permission to create tags.
• For Resource, specify spot-instances-request. This allows users to tag only the Spot Instance
request.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TagSpotInstanceRequest",
"Effect": "Allow",
"Action": [
"ec2:RequestSpotInstances",
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:us-east-1:111122223333:spot-instances-request/*"
}
403
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
2. To add a tag, on the Add Tags page, choose Add Tag, and enter the key and value for the tag.
Choose Add another tag for each additional tag.
For each tag, you can tag the Spot Instance request, the Spot Instances, and the volumes with
the same tag. To tag all three, ensure that Instances, Volumes, and Spot Instance Requests are
selected. To tag only one or two, ensure that the resources you want to tag are selected, and the
other resources are cleared.
3. Complete the required fields to create a Spot Instance request, and then choose Launch. For more
information, see Create a Spot Instance request (p. 395).
To tag a Spot Instance request when you create it, configure the Spot Instance request configuration as
follows:
• Specify the tags for the Spot Instance request using the --tag-specification parameter.
• For ResourceType, specify spot-instances-request. If you specify another value, the Spot
Instance request will fail.
• For Tags, specify the key-value pair. You can specify more than one key-value pair.
In the following example, the Spot Instance request is tagged with two tags: Key=Environment and
Value=Production, and Key=Cost-Center and Value=123.
After you have created a Spot Instance request, you can add tags to the Spot Instance request using the
console.
After your Spot Instance request has launched your Spot Instance, you can add tags to the instance using
the console. For more information, see Add and delete tags on an individual resource (p. 1900).
To tag an existing Spot Instance request or Spot Instance using the AWS CLI
Use the create-tags command to tag existing resources. In the following example, the existing Spot
Instance request and the Spot Instance are tagged with Key=purpose and Value=test.
404
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Use the describe-tags command to view the tags for the specified resource. In the following example,
you describe the tags for the specified request.
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "sir-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-instances-request",
"Value": "Production"
},
{
"Key": "Another key",
"ResourceId": "sir-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-instances-request",
"Value": "Another value"
}
]
}
You can also view the tags of a Spot Instance request by describing the Spot Instance request.
Use the describe-spot-instance-requests command to view the configuration of the specified Spot
Instance request, which includes any tags that were specified for the request.
{
"SpotInstanceRequests": [
{
"CreateTime": "2020-06-24T14:22:11+00:00",
"InstanceId": "i-1234567890EXAMPLE",
"LaunchSpecification": {
"SecurityGroups": [
{
"GroupName": "launch-wizard-6",
"GroupId": "sg-1234567890EXAMPLE"
}
],
"BlockDeviceMappings": [
405
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 8,
"VolumeType": "gp2"
}
}
],
"ImageId": "ami-1234567890EXAMPLE",
"InstanceType": "t2.micro",
"KeyName": "my-key-pair",
"NetworkInterfaces": [
{
"DeleteOnTermination": true,
"DeviceIndex": 0,
"SubnetId": "subnet-11122233"
}
],
"Placement": {
"AvailabilityZone": "eu-west-1c",
"Tenancy": "default"
},
"Monitoring": {
"Enabled": false
}
},
"LaunchedAvailabilityZone": "eu-west-1c",
"ProductDescription": "Linux/UNIX",
"SpotInstanceRequestId": "sir-1234567890EXAMPLE",
"SpotPrice": "0.012600",
"State": "active",
"Status": {
"Code": "fulfilled",
"Message": "Your spot request is fulfilled.",
"UpdateTime": "2020-06-25T18:30:21+00:00"
},
"Tags": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Another key",
"Value": "Another value"
}
],
"Type": "one-time",
"InstanceInterruptionBehavior": "terminate"
}
]
}
• Your Spot Instance request is open when your request has not yet been fulfilled and no instances have
been launched.
• Your Spot Instance request is active when your request has been fulfilled and Spot Instances have
launched as a result.
• Your Spot Instance request is disabled when you stop your Spot Instance.
406
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
If your Spot Instance request is active and has an associated running Spot Instance, canceling the
request does not terminate the instance. For more information about terminating a Spot Instance, see
Terminate a Spot Instance (p. 408).
• Use the cancel-spot-instance-requests command to cancel the specified Spot Instance request.
Limitations
• You can only stop a Spot Instance if the Spot Instance was launched from a persistent Spot
Instance request.
• You can't stop a Spot Instance if the associated Spot Instance request is cancelled. When the Spot
Instance request is cancelled, you can only terminate the Spot Instance.
• You can't stop a Spot Instance if it is part of a fleet or launch group, or Availability Zone group.
Console
AWS CLI
• Use the stop-instances command to manually stop one or more Spot Instances.
407
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Prerequisites
Limitations
• You can't start a Spot Instance if it is part of fleet or launch group, or Availability Zone group.
Console
AWS CLI
• Use the start-instances command to manually start one or more Spot Instances.
If you cancel an active Spot Instance request that has a running Spot Instance, the running Spot
Instance is not automatically terminated; you must manually terminate the Spot Instance.
If you cancel a disabled Spot Instance request that has a stopped Spot Instance, the stopped Spot
Instance is automatically terminated by the Amazon EC2 Spot service. There might be a short lag
between when you cancel the Spot Instance request and when the Spot service terminates the Spot
Instance.
408
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
For information about canceling a Spot Instance request, see Cancel a Spot Instance request (p. 406).
Console
1. Before you terminate an instance, verify that you won't lose any data by checking that your
Amazon EBS volumes won't be deleted on termination and that you've copied any data that you
need from your instance store volumes to persistent storage, such as Amazon EBS or Amazon
S3.
2. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
3. In the navigation pane, choose Instances.
4. To confirm that the instance is a Spot Instance, check that spot appears in the Instance lifecycle
column.
5. Select the instance, and choose Instance state, Terminate instance.
6. Choose Terminate when prompted for confirmation.
AWS CLI
Examples
• Example 1: Launch Spot Instances (p. 409)
• Example 2: Launch Spot Instances in the specified Availability Zone (p. 410)
• Example 3: Launch Spot Instances in the specified subnet (p. 410)
• Example 4: Launch a Dedicated Spot Instance (p. 411)
The following example does not include an Availability Zone or subnet. Amazon EC2 selects an
Availability Zone for you. Amazon EC2 launches the instances in the default subnet of the selected
Availability Zone.
{
"ImageId": "ami-0abcdef1234567890",
"KeyName": "my-key-pair",
"SecurityGroupIds": [ "sg-1a2b3c4d5e6f7g8h9" ],
409
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
"InstanceType": "m5.medium",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
The following example includes an Availability Zone. Amazon EC2 launches the instances in the default
subnet of the specified Availability Zone.
{
"ImageId": "ami-0abcdef1234567890",
"KeyName": "my-key-pair",
"SecurityGroupIds": [ "sg-1a2b3c4d5e6f7g8h9" ],
"InstanceType": "m5.medium",
"Placement": {
"AvailabilityZone": "us-west-2a"
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
The following example includes a subnet. Amazon EC2 launches the instances in the specified subnet. If
the VPC is a nondefault VPC, the instance does not receive a public IPv4 address by default.
{
"ImageId": "ami-0abcdef1234567890",
"SecurityGroupIds": [ "sg-1a2b3c4d5e6f7g8h9" ],
"InstanceType": "m5.medium",
"SubnetId": "subnet-1a2b3c4d",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
{
"ImageId": "ami-0abcdef1234567890",
"KeyName": "my-key-pair",
"InstanceType": "m5.medium",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-1a2b3c4d5e6f7g8h9",
"Groups": [ "sg-1a2b3c4d5e6f7g8h9" ],
"AssociatePublicIpAddress": true
}
],
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
410
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The following example requests Spot Instance with a tenancy of dedicated. A Dedicated Spot Instance
must be launched in a VPC.
{
"ImageId": "ami-0abcdef1234567890",
"KeyName": "my-key-pair",
"SecurityGroupIds": [ "sg-1a2b3c4d5e6f7g8h9" ],
"InstanceType": "c5.8xlarge",
"SubnetId": "subnet-1a2b3c4d5e6f7g8h9",
"Placement": {
"Tenancy": "dedicated"
}
}
At each step of the process—also called the Spot request lifecycle—specific events determine successive
request states.
Contents
• Lifecycle of a Spot request (p. 411)
• Get request status information (p. 415)
• Spot request status codes (p. 415)
• EC2 Spot Instance Request Fulfillment event (p. 417)
411
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Pending evaluation
As soon as you create a Spot Instance request, it goes into the pending-evaluation state unless one
or more request parameters are not valid (bad-parameters).
Holding
If one or more request constraints are valid but can't be met yet, or if there is not enough capacity, the
request goes into a holding state waiting for the constraints to be met. The request options affect the
likelihood of the request being fulfilled. For example, if there is no capacity, your request stays in a
holding state until there is available capacity. If you specify an Availability Zone group, the request stays
in a holding state until the Availability Zone constraint is met.
In the event of an outage of one of the Availability Zones, there is a chance that the spare EC2 capacity
available for Spot Instance requests in other Availability Zones can be affected.
412
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Pending evaluation/fulfillment-terminal
Your Spot Instance request can go to a terminal state if you create a request that is valid only during
a specific time period and this time period expires before your request reaches the pending fulfillment
phase. It might also happen if you cancel the request, or if a system error occurs.
Pending fulfillment
When the constraints you specified (if any) are met, your Spot request goes into the pending-
fulfillment state.
At this point, Amazon EC2 is getting ready to provision the instances that you requested. If the process
stops at this point, it is likely to be because it was canceled by the user before a Spot Instance was
launched. It might also be because an unexpected system error occurred.
Fulfilled
When all the specifications for your Spot Instances are met, your Spot request is fulfilled. Amazon
EC2 launches the Spot Instances, which can take a few minutes. If a Spot Instance is hibernated or
stopped when interrupted, it remains in this state until the request can be fulfilled again or the request is
canceled.
413
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
If you stop a Spot Instance, your Spot request goes into the marked-for-stop or instance-
stopped-by-user state until the Spot Instance can be started again or the request is cancelled.
¹ A Spot Instance goes into the instance-stopped-by-user state if you stop the instance or run the
shutdown command from the instance. After you've stopped the instance, you can start it again. On
restart, the Spot Instance request returns to the pending-evaluation state and then Amazon EC2
launches a new Spot Instance when the constraints are met.
² The Spot request state is disabled if you stop the Spot Instance but do not cancel the request. The
request state is cancelled if your Spot Instance is stopped and the request expires.
Fulfilled-terminal
Your Spot Instances continue to run as long as there is available capacity for your instance type, and
you don't terminate the instance. If Amazon EC2 must terminate your Spot Instances, the Spot request
goes into a terminal state. A request also goes into the terminal state if you cancel the Spot request or
terminate the Spot Instances.
414
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
¹ The request state is closed if you terminate the instance but do not cancel the request. The request
state is cancelled if you terminate the instance and cancel the request. Even if you terminate a Spot
Instance before you cancel its request, there might be a delay before Amazon EC2 detects that your Spot
Instance was terminated. In this case, the request state can either be closed or cancelled.
† When Amazon EC2 interrupts a Spot Instance if it needs the capacity back and the instance is
configured to terminate on interruption, the status is immediately set to instance-terminated-
no-capacity (it is not set to marked-for-termination). However, the instance remains in the
running state for 2 minutes to reflect the 2-minute period when the instance receives the Spot Instance
interruption notice. After 2 minutes, the instance state is set to terminated.
Persistent requests
When your Spot Instances are terminated (either by you or Amazon EC2), if the Spot request is a
persistent request, it returns to the pending-evaluation state and then Amazon EC2 can launch a
new Spot Instance when the constraints are met.
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
415
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
az-group-constraint
Amazon EC2 cannot launch all the instances you requested in the same Availability Zone.
bad-parameters
One or more parameters for your Spot request are not valid (for example, the AMI you specified does
not exist). The status message indicates which parameter is not valid.
canceled-before-fulfillment
There is not enough capacity available for the instances that you requested.
constraint-not-fulfillable
The Spot request can't be fulfilled because one or more constraints are not valid (for example, the
Availability Zone does not exist). The status message indicates which constraint is not valid.
fulfilled
The Spot request is active, and Amazon EC2 is launching your Spot Instances.
instance-stopped-by-price
Your instance was stopped because the Spot price exceeded your maximum price.
instance-stopped-by-user
Your instance was stopped because a user stopped the instance or ran the shutdown command from
the instance.
instance-stopped-no-capacity
Your instance was terminated because the Spot price exceeded your maximum price. If your request
is persistent, the process restarts, so your request is pending evaluation.
instance-terminated-by-schedule
Your Spot Instance was terminated at the end of its scheduled duration.
instance-terminated-by-service
You terminated a Spot Instance that had been fulfilled, so the request state is closed (unless it's a
persistent request) and the instance state is terminated.
instance-terminated-launch-group-constraint
One or more of the instances in your launch group was terminated, so the launch group constraint is
no longer fulfilled.
instance-terminated-no-capacity
Amazon EC2 cannot launch all the instances that you requested at the same time. All instances in a
launch group are started and terminated together.
416
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
limit-exceeded
The limit on the number of EBS volumes or total volume storage was exceeded. For more
information about these limits and how to request an increase, see Amazon EBS Limits in the
Amazon Web Services General Reference.
marked-for-stop
After you make a Spot Instance request, it goes into the pending-evaluation state while the
system evaluates the parameters of your request.
pending-fulfillment
The Spot request can't be fulfilled yet because a Spot Instance can't be added to the placement
group at this time.
price-too-low
The request can't be fulfilled yet because your maximum price is below the Spot price. In this case,
no instance is launched and your request remains open.
request-canceled-and-instance-running
You canceled the Spot request while the Spot Instances are still running. The request is cancelled,
but the instances remain running.
schedule-expired
The Spot request expired because it was not fulfilled before the specified date.
system-error
There was an unexpected system error. If this is a recurring issue, please contact AWS Support for
assistance.
{
"version": "0",
"id": "01234567-1234-0123-1234-012345678901",
"detail-type": "EC2 Spot Instance Request Fulfillment",
"source": "aws.ec2",
"account": "123456789012",
417
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-2",
"resources": ["arn:aws:ec2:us-east-2:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"spot-instance-request-id": "sir-1a2b3c4d",
"instance-id": "i-1234567890abcdef0"
}
}
It is not always possible for Amazon EC2 to send the rebalance recommendation signal before the two-
minute Spot Instance interruption notice. Therefore, the rebalance recommendation signal can arrive
along with the two-minute interruption notice.
Rebalance recommendations are made available as a EventBridge event and as an item in the instance
metadata (p. 817) on the Spot Instance. Events are emitted on a best effort basis.
Note
Rebalance recommendations are only supported for Spot Instances that are launched after
November 5, 2020 00:00 UTC.
Topics
• Rebalance actions you can take (p. 418)
• Monitor rebalance recommendation signals (p. 419)
• Services that use the rebalance recommendation signal (p. 421)
Graceful shutdown
When you receive the rebalance recommendation signal for a Spot Instance, you can start your
instance shutdown procedures, which might include ensuring that processes are completed before
stopping them. For example, you can upload system or application logs to Amazon Simple Storage
Service (Amazon S3), you can shut down Amazon SQS workers, or you can complete deregistration
from the Domain Name System (DNS). You can also save your work in external storage and resume it
at a later time.
Prevent new work from being scheduled
When you receive the rebalance recommendation signal for a Spot Instance, you can prevent new
work from being scheduled on the instance, while continuing to use the instance until the scheduled
work is completed.
Proactively launch new replacement instances
You can configure Auto Scaling groups, EC2 Fleet, or Spot Fleet to automatically launch replacement
Spot Instances when a rebalance recommendation signal is emitted. For more information, see Use
Capacity Rebalancing to handle Amazon EC2 Spot interruptions in the Amazon EC2 Auto Scaling
418
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
User Guide, and Capacity Rebalancing (p. 955) for EC2 Fleet and Capacity Rebalancing (p. 998) for
Spot Fleet in this user guide.
When the rebalance recommendation signal is emitted for a Spot Instance, the event for the signal is
sent to Amazon EventBridge. If EventBridge detects an event pattern that matches a pattern defined in a
rule, EventBridge invokes a target (or targets) specified in the rule.
{
"version": "0",
"id": "12345678-1234-1234-1234-123456789012",
"detail-type": "EC2 Instance Rebalance Recommendation",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-2",
"resources": ["arn:aws:ec2:us-east-2:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"instance-id": "i-1234567890abcdef0"
}
}
The following fields form the event pattern that is defined in the rule:
You can write an EventBridge rule and automate what actions to take when the event pattern matches
the rule.
The following example creates an EventBridge rule to send an email, text message, or mobile push
notification every time Amazon EC2 emits a rebalance recommendation signal. The signal is emitted as
an EC2 Instance Rebalance Recommendation event, which triggers the action defined by the rule.
Before creating the EventBridge rule, you must create the Amazon SNS topic for the email, text message,
or mobile push notification.
419
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance Rebalance Recommendation"]
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
420
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
For more information, see Amazon EventBridge rules and Amazon EventBridge event patterns in the
Amazon EventBridge User Guide
We recommend that you check for rebalance recommendation signals every 5 seconds so that you don't
miss an opportunity to act on the rebalance recommendation.
If a Spot Instance receives a rebalance recommendation, the time that the signal was emitted is present
in the instance metadata. You can retrieve the time that the signal was emitted as follows.
The following is example output, which indicates the time, in UTC, that the rebalance recommendation
signal was emitted for the Spot Instance.
{"noticeTime": "2020-10-27T08:22:00Z"}
If the signal has not been emitted for the instance, events/recommendations/rebalance is not
present and you receive an HTTP 404 error when you try to retrieve it.
• Use Capacity Rebalancing to handle Amazon EC2 Spot interruptions in the Amazon EC2 Auto Scaling
User Guide
• Capacity Rebalancing (p. 955) in the EC2 Fleet topic in this user guide
• Capacity Rebalancing (p. 998) in the Spot Fleet topic in this user guide
When Amazon EC2 interrupts a Spot Instance, it either terminates, stops, or hibernates the instance,
depending on what you specified when you created the Spot request.
Demand for Spot Instances can vary significantly from moment to moment, and the availability of Spot
Instances can also vary significantly depending on how many unused EC2 instances are available. It is
always possible that your Spot Instance might be interrupted.
421
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Contents
• Reasons for interruption (p. 422)
• Interruption behavior (p. 422)
• Stop interrupted Spot Instances (p. 423)
• Hibernate interrupted Spot Instances (p. 424)
• Terminate interrupted Spot Instances (p. 426)
• Prepare for interruptions (p. 427)
• Initiate a Spot Instance interruption (p. 427)
• Spot Instance interruption notices (p. 429)
• Find interrupted Spot Instances (p. 430)
• Determine whether Amazon EC2 terminated a Spot Instance (p. 431)
• Billing for interrupted Spot Instances (p. 431)
Capacity
Amazon EC2 can interrupt your Spot Instance when it needs it back. EC2 reclaims your instance
mainly to repurpose capacity, but it can also occur for other reasons such as host maintenance or
hardware decommission.
Price
You can specify the maximum price in your Spot request. However, if you specify a maximum price,
your instances will be interrupted more frequently than if you do not specify it.
Constraints
If your Spot request includes a constraint such as a launch group or an Availability Zone group, the
Spot Instances are terminated as a group when the constraint can no longer be met.
You can see the historical interruption rates for your instance type in the Spot Instance Advisor.
Interruption behavior
You can specify that Amazon EC2 must do one of the following when it interrupts a Spot Instance:
You can specify the interruption behavior when you create a Spot request. If you do not specify
an interruption behavior, the default is that Amazon EC2 terminates Spot Instances when they are
interrupted.
422
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The way in which you specify the interruption behavior is different depending on how you request Spot
Instances.
• If you request Spot Instances using the launch instance wizard (p. 539), you can specify the
interruption behavior as follows: From Request type, choose Persistent (new console) or select
the Persistent request check box (old console) and then, from Interruption behavior, choose an
interruption behavior.
• If you request Spot Instances using the Spot console (p. 1012), you can specify the interruption
behavior as follows: Select the Maintain target capacity check box and then, from Interruption
behavior, choose an interruption behavior.
• If you configure Spot Instances in a launch template (p. 556), you can specify the interruption
behavior as follows: In the launch template, expand Advanced details and select the Request Spot
Instances check box. Choose Customize and then, from Interruption behavior, choose an interruption
behavior.
• If you configure Spot Instances in the request configuration when using the create-fleet CLI, you can
specify the interruption behavior as follows: For InstanceInterruptionBehavior, specify an
interruption behavior.
• If you configure Spot Instances in the request configuration when using the request-spot-fleet CLI, you
can specify the interruption behavior as follows: For InstanceInterruptionBehavior, specify an
interruption behavior.
• If you configure Spot Instances using the request-spot-instances CLI, you can specify the interruption
behavior as follows: For --instance-interruption-behavior, specify an interruption behavior.
Considerations
For example, consider a Spot Fleet with the lowestPrice allocation strategy. At initial launch,
a c3.large pool meets the lowestPrice criteria for the launch specification. Later, when the
c3.large instances are interrupted, Amazon EC2 stops the instances and replenishes capacity from
another pool that fits the lowestPrice strategy. This time, the pool happens to be a c4.large pool
and Amazon EC2 launches c4.large instances to meet the target capacity. Similarly, Spot Fleet could
move to a c5.large pool the next time. In each of these transitions, Amazon EC2 does not prioritize
pools with earlier stopped instances, but rather prioritizes purely on the specified allocation strategy.
The lowestPrice strategy can lead back to pools with earlier stopped instances. For example, if
instances are interrupted in the c5.large pool and the lowestPrice strategy leads it back to the
c3.large or c4.large pools, the earlier stopped instances are restarted to fulfill target capacity.
• While a Spot Instance is stopped, you can modify some of its instance attributes, but not the instance
type. If you detach or delete an EBS volume, it is not attached when the Spot Instance is started. If you
detach the root volume and Amazon EC2 attempts to start the Spot Instance, the instance will fail to
start and Amazon EC2 will terminate the stopped instance.
423
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Prerequisites
Spot Instance request type – Must be persistent. You can't specify a launch group in the Spot
Instance request.
• When the instance receives a signal from Amazon EC2, the agent prompts the operating system
to hibernate. If the agent is not installed, or the underlying operating system doesn't support
hibernation, or there isn't enough volume space to save the instance memory, hibernation fails and
Amazon EC2 stops the instance instead.
• The instance memory (RAM) is preserved on the root volume.
• The EBS volumes and private IP addresses of the instance are preserved.
• Instance store volumes and public IP addresses, other than Elastic IP addresses, are not preserved.
For information about hibernating On-Demand Instances, see Hibernate your On-Demand Windows
instance (p. 586).
Considerations
• Only Amazon EC2 can hibernate a Spot Instance. You can't manually hibernate a Spot Instance.
• Only Amazon EC2 can resume a hibernated Spot Instance. You can't manually resume a hibernated
Spot Instance.
• Amazon EC2 resumes the instance when capacity becomes available.
• When Amazon EC2 hibernates a Spot Instance, hibernation begins immediately. You receive an
interruption notice, but you do not have two minutes before the Spot Instance is interrupted.
• While the instance is in the process of hibernating, instance health checks might fail.
424
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
• When the hibernation process completes, the state of the instance is stopped.
• While the instance is hibernated, you are charged only for the EBS volumes. With EC2 Fleet and Spot
Fleet, if you have many hibernated instances, you can exceed the limit on the number of EBS volumes
for your account.
• Make sure that you are familiar with the implications of hibernating an instance. For information about
what happens when an instance is hibernated, see Differences between reboot, stop, hibernate, and
terminate (p. 536).
Prerequisites
Spot Instance request type – Must be persistent. You can't specify a launch group in the Spot
Instance request.
The following supported AMIs include the hibernation agent. To use an earlier version of the
following AMIs, you must install the hibernation agent (p. 426).
• Windows Server 2008 R2 AMI 2017.11.19 or later
• Windows Server 2012 or Windows Server 2012 R2 AMI 2017.11.19 or later
• Windows Server 2016 AMI 2017.11.19 or later
• Windows Server 2019
¹ To use an earlier version of the Ubuntu Xenial AMI, it must have a Ubuntu kernel tuned by
AWS(linux-aws) greater than 4.4.0-1041.
For information about the supported Linux AMIs, see the prerequisites in the Amazon EC2 User Guide
for Linux Instances.
Start the hibernation agent
We recommend that you use user data to start the hibernation agent at instance launch.
Alternatively, you could start the agent manually. For more information, see Start the hibernation
agent at launch (p. 426).
Supported instance families
Can be up to 16 GB.
Root volume type
Must be large enough to store the instance memory (RAM) during hibernation.
EBS root volume encryption – recommended, but not a prerequisite for Spot Instance hibernation
We strongly recommend that you use an encrypted EBS volume as the root volume, because
instance memory is stored on the root volume during hibernation. This ensures that the contents
425
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
of memory (RAM) are encrypted when the data is at rest on the volume and when data is moving
between the instance and volume.
Use one of the following three options to ensure that the root volume is an encrypted EBS volume:
• EBS encryption by default – You can enable EBS encryption by default to ensure that all new
EBS volumes created in your AWS account are encrypted. This way, you can enable hibernation for
your instances without specifying encryption intent at instance launch. For more information, see
Encryption by default (p. 1735).
• EBS "single-step" encryption – You can launch encrypted EBS-backed EC2 instances from an
unencrypted AMI and also enable hibernation at the same time. For more information, see Use
encryption with EBS-backed AMIs (p. 185).
• Encrypted AMI – You can enable EBS encryption by using an encrypted AMI to launch your
instance. If your AMI does not have an encrypted root snapshot, you can copy it to a new AMI and
request encryption. For more information, see Encrypt an unencrypted image during copy (p. 188)
and Copy an AMI (p. 160).
You must install the hibernation agent on your AMI, unless you plan to use an AMI that already includes
the agent.
The following instructions describe how to install the hibernation agent on a Windows AMI. For the
instructions to install the hibernation agent on a Linux AMI, see Install the hibernation agent on your on
Linux AMI in the Amazon EC2 User Guide for Linux Instances.
If your AMI doesn't include the agent, download the following files to the C:\Program Files\Amazon
\Hibernate folder on your Windows instance.
• EC2HibernateAgent.exe
• EC2HibernateAgent.ps1
• LICENSE.txt
The hibernation agent must run at instance startup, whether the agent was included in your AMI or you
installed it yourself.
The following instructions describe how to start the hibernation agent on a Windows instance. For the
instructions to start the hibernation agent on a Linux instance, see Start the hibernation agent at launch
in the Amazon EC2 User Guide for Linux Instances.
Follow the steps to request a Spot Instance using your preferred launch method (p. 537), and add the
following to the user data.
<powershell>."C:\Program Files\Amazon\Hibernate\EC2HibernateAgent.exe"</powershell>
426
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
We recommend that you follow these best practices so that you're prepared for a Spot Instance
interruption.
• Create your Spot request using an Auto Scaling group. If your Spot Instances are interrupted, the Auto
Scaling group will automatically launch replacement instances. For more information, see Auto Scaling
groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
• Ensure that your instance is ready to go as soon as the request is fulfilled by using an Amazon Machine
Image (AMI) that contains the required software configuration. You can also use user data to run
commands at startup.
• Data on instance store volumes is lost when the instance is stopped or terminated. Back up any
important data on instance store volumes to a more persistent storage, such as Amazon S3, Amazon
EBS, or Amazon DynamoDB.
• Store important data regularly in a place that isn't affected if the Spot Instance terminates. For
example, you can use Amazon S3, Amazon EBS, or DynamoDB.
• Divide the work into small tasks (using a Grid, Hadoop, or queue-based architecture) or use
checkpoints so that you can save your work frequently.
• Amazon EC2 emits a rebalance recommendation signal to the Spot Instance when the instance is at an
elevated risk of interruption. You can rely on the rebalance recommendation to proactively manage
Spot Instance interruptions without having to wait for the two-minute Spot Instance interruption
notice. For more information, see EC2 instance rebalance recommendations (p. 418).
• Use the two-minute Spot Instance interruption notices to monitor the status of your Spot Instances.
For more information, see Spot Instance interruption notices (p. 429).
• While we make every effort to provide these warnings as soon as possible, it is possible that your Spot
Instance is interrupted before the warnings can be made available. Test your application to ensure that
it handles an unexpected instance interruption gracefully, even if you are monitoring for rebalance
recommendation signals and interruption notices. You can do this by running the application using an
On-Demand Instance and then terminating the On-Demand Instance yourself.
• Run a controlled fault injection experiment with AWS Fault Injection Simulator to test how your
application responds when your Spot Instance is interrupted. For more information, see the Tutorial:
Test Spot Instance interruptions using AWS FIS in the AWS Fault Injection Simulator User Guide.
The underlying service that performs the Spot Instance interruption is AWS Fault Injection Simulator
(AWS FIS). For information about AWS FIS, see AWS Fault Injection Simulator.
Note
Interruption behaviors are terminate, stop, and hibernate. If you set the interruption
behavior to hibernate, when you initiate a Spot Instance interruption, the hibernation process
will begin immediately.
Initiating a Spot Instance interruption is supported in all AWS Regions except Asia Pacific (Jakarta), Asia
Pacific (Osaka), China (Beijing), China (Ningxia), and Middle East (UAE).
427
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Topics
• Initiate a Spot Instance interruption (p. 428)
• Verify the Spot Instance interruption (p. 428)
You can use the EC2 console to quickly initiate a Spot Instance interruption. For more advanced
experiments to test Spot Instance interruptions, you can create your own experiments using the AWS FIS
console.
To create more advanced experiments to test Spot Instance interruptions using the AWS FIS
console
The AWS FIS console opens. For more information, see Tutorial: Test Spot Instance interruptions
using AWS FIS in the AWS Fault Injection Simulator User Guide.
To verify that the instance was interrupted after you initiated the interruption
428
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The best way for you to gracefully handle Spot Instance interruptions is to architect your application to
be fault-tolerant. To accomplish this, you can take advantage of Spot Instance interruption notices. We
recommend that you check for these interruption notices every 5 seconds.
The interruption notices are made available as a EventBridge event and as items in the instance
metadata (p. 817) on the Spot Instance. Interruption notices are emitted on a best effort basis.
The following is an example of the event for Spot Instance interruption. The possible values for
instance-action are hibernate, stop, or terminate.
{
"version": "0",
"id": "12345678-1234-1234-1234-123456789012",
"detail-type": "EC2 Spot Instance Interruption Warning",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-2",
"resources": ["arn:aws:ec2:us-east-2:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"instance-id": "i-1234567890abcdef0",
"instance-action": "action"
}
}
instance-action
If your Spot Instance is marked to be stopped or terminated by Amazon EC2, the instance-action
item is present in your instance metadata (p. 817). Otherwise, it is not present. You can retrieve
instance-action as follows.
429
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The instance-action item specifies the action and the approximate time, in UTC, when the action will
occur.
The following example output indicates the time at which this instance will be stopped.
The following example output indicates the time at which this instance will be terminated.
If Amazon EC2 is not preparing to stop or terminate the instance, or if you terminated the instance
yourself, instance-action is not present in the instance metadata and you receive an HTTP 404 error
when you try to retrieve it.
termination-time
This item is maintained for backward compatibility; you should use instance-action instead.
If your Spot Instance is marked for termination by Amazon EC2, the termination-time item is present
in your instance metadata. Otherwise, it is not present. You can retrieve termination-time as follows.
The termination-time item specifies the approximate time in UTC when the instance receives the
shutdown signal. The following is example output.
2015-01-05T18:02:00Z
If Amazon EC2 is not preparing to terminate the instance, or if you terminated the Spot Instance yourself,
the termination-time item is either not present in the instance metadata (so you receive an HTTP 404
error) or contains a value that is not a time value.
If Amazon EC2 fails to terminate the instance, the request status is set to fulfilled. The
termination-time value remains in the instance metadata with the original approximate time, which
is now in the past.
Alternatively, in the navigation pane, choose Spot Requests. You can see both Spot Instance
requests and Spot Fleet requests. To view the IDs of the instances, select a Spot Instance request or a
430
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Spot Fleet request and choose the Instances tab. Choose an instance ID to display the instance in the
Instances pane.
3. For each Spot Instance, you can view its state in the Instance State column.
You can list your interrupted Spot Instances using the describe-instances command with the --filters
parameter. To list only the instance IDs in the output, include the --query parameter.
For more information about using CloudTrail, see Log Amazon EC2 and Amazon EBS API calls with AWS
CloudTrail (p. 1170).
Instance usage
Who interrupts the Operating system Interrupted in the first Interrupted in any hour
Spot Instance hour after the first hour
If you stop or terminate Windows and Linux Charged for the seconds Charged for the seconds
the Spot Instance (excluding RHEL and used used
SUSE)
RHEL and SUSE Charged for the full Charged for the full
hour even if you used a hours used, and
partial hour charged a full hour for
the interrupted partial
hour
If the Amazon EC2 Windows and Linux No charge Charged for the seconds
interrupts the Spot (excluding RHEL and used
Instance SUSE)
431
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Who interrupts the Operating system Interrupted in the first Interrupted in any hour
Spot Instance hour after the first hour
While an interrupted Spot Instance is stopped, you are charged only for the EBS volumes, which are
preserved.
With EC2 Fleet and Spot Fleet, if you have many stopped instances, you can exceed the limit on the
number of EBS volumes for your account.
432
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Benefits
You can use the Spot placement score feature for the following:
• To relocate and scale Spot compute capacity in a different Region, as needed, in response to increased
capacity needs or decreased available capacity in the current Region.
• To identify the most optimal Availability Zone in which to run single-Availability Zone workloads.
• To simulate future Spot capacity needs so that you can pick an optimal Region for the expansion of
your Spot-based workloads.
• To find an optimal combination of instance types to fulfill your Spot capacity needs.
Topics
• Costs (p. 433)
• How Spot placement score works (p. 433)
• Limitations (p. 435)
• Required IAM permission (p. 436)
• Calculate a Spot placement score (p. 436)
• Example configurations (p. 440)
Costs
There is no additional charge for using the Spot placement score feature.
First, you specify your desired target Spot capacity and your compute requirements, as follows:
1. Specify the target Spot capacity, and optionally the target capacity unit.
433
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
You can specify your desired target Spot capacity in terms of the number of instances or vCPUs, or in
terms of the amount of memory in MiB. To specify the target capacity in number of vCPUs or amount
of memory, you must specify the target capacity unit as vcpu or memory-mib. Otherwise, it defaults
to number of instances.
By specifying your target capacity in terms of the number of vCPUs or the amount of memory, you can
use these units when counting the total capacity. For example, if you want to use a mix of instances
of different sizes, you can specify the target capacity as a total number of vCPUs. The Spot placement
score feature then considers each instance type in the request by its number of vCPUs, and counts the
total number of vCPUs rather than the total number of instances when totaling up the target capacity.
For example, say you specify a total target capacity of 30 vCPUs, and your instance type list consists of
c5.xlarge (4 vCPUs), m5.2xlarge (8 vCPUs), and r5.large (2 vCPUs). To achieve a total of 30 vCPUs, you
could get a mix of 2 c5.xlarge (2*4 vCPUs), 2 m5.2xlarge (2*8 vCPUs), and 3 r5.large (3*2 vCPUs).
2. Specify instance types or instance attributes.
You can either specify the instance types to use, or you can specify the instance attributes that you
need for your compute requirements, and then let Amazon EC2 identify the instance types that have
those attributes. This is known as attribute-based instance type selection.
You can't specify both instance types and instance attributes in the same Spot placement score
request.
If you specify instance types, you must specify at least three different instance types, otherwise
Amazon EC2 will return a low Spot placement score. Similarly, if you specify instance attributes, they
must resolve to at least three different instance types.
For examples of different ways to specify your Spot requirements, see Example configurations (p. 440).
Amazon EC2 calculates the Spot placement score for each Region or Availability Zone, and returns either
the top 10 Regions or the top 10 Availability Zones where your Spot request is likely to succeed. The
default is to return a list of scored Regions. If you plan to launch all of your Spot capacity into a single
Availability Zone, then it's useful to request a list of scored Availability Zones.
You can specify a Region filter to narrow down the Regions that will be returned in the response.
You can combine the Region filter and a request for scored Availability Zones. In this way, the scored
Availability Zones are confined to the Regions for which you've filtered. To find the highest-scored
Availability Zone in a Region, specify only that Region, and the response will return a scored list of all of
the Availability Zones in that Region.
The Spot placement score for each Region or Availability Zone is calculated based on the target capacity,
the composition of the instance types, the historical and current Spot usage trends, and the time of the
request. Because Spot capacity is constantly fluctuating, the same Spot placement score request can
yield different scores when calculated at different times.
Regions and Availability Zones are scored on a scale from 1 to 10. A score of 10 indicates that your Spot
request is highly likely—but not guaranteed—to succeed. A score of 1 indicates that your Spot request is
not likely to succeed at all. The same score might be returned for different Regions or Availability Zones.
If low scores are returned, you can edit your compute requirements and recalculate the score. You can
also request Spot placement score recommendations for the same compute requirements at different
times of the day.
434
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
A Spot placement score is only relevant if your Spot request has exactly the same configuration as the
Spot placement score configuration (target capacity, target capacity unit, and instance types or instance
attributes), and is configured to use the capacity-optimized allocation strategy. Otherwise, the
likelihood of getting available Spot capacity will not align with the score.
While a Spot placement score serves as a guideline, and no score guarantees that your Spot request will
be fully or partially fulfilled, you can use the following information to get the best results:
• Use the same configuration – The Spot placement score is relevant only if the Spot request
configuration (target capacity, target capacity unit, and instance types or instance attributes) in
your Auto Scaling group, EC2 Fleet, or Spot Fleet is the same as what you entered to get the Spot
placement score.
If you used attribute-based instance type selection in your Spot placement score request, you can
use attribute-based instance type selection to configure your Auto Scaling group, EC2 Fleet, or Spot
Fleet. For more information, see Creating an Auto Scaling group with a set of requirements on the
instance types used, Attribute-based instance type selection for EC2 Fleet (p. 940), and Attribute-
based instance type selection for Spot Fleet (p. 984).
Note
If you specified your target capacity in terms of the number of vCPUs or the amount of
memory, and you specified instance types in your Spot placement score configuration,
note that you can’t currently create this configuration in your Auto Scaling group, EC2
Fleet, or Spot Fleet. Instead, you must manually set the instance weighting by using the
WeightedCapacity parameter.
• Use the capacity-optimized allocation strategy – Any score assumes that your fleet request
will be configured to use all Availability Zones (for requesting capacity across Regions) or a single
Availability Zone (if requesting capacity in one Availability Zone) and the capacity-optimized Spot
allocation strategy for your request for Spot capacity to succeed. If you use other allocation strategies,
such as lowest-price, the likelihood of getting available Spot capacity will not align with the score.
• Act on a score immediately – The Spot placement score recommendation reflects the available
Spot capacity at the time of the request, and the same configuration can yield different scores when
calculated at different times due to Spot capacity fluctuations. While a score of 10 means that your
Spot capacity request is highly likely—but not guaranteed—to succeed, for best results we recommend
that you act on a score immediately. We also recommend that you get a fresh score each time you
attempt a capacity request.
Limitations
• Target capacity limit – Your Spot placement score target capacity limit is based on your recent Spot
usage, while accounting for potential usage growth. If you have no recent Spot usage, we provide you
with a low default limit aligned with your Spot request limit.
• Request configurations limit – We can limit the number of new request configurations within a 24-
hour period if we detect patterns not associated with the intended use of the Spot placement score
feature. If you reach the limit, you can retry the request configurations that you've already used, but
you can't specify new request configurations until the next 24-hour period.
• Minimum number of instance types – If you specify instance types, you must specify at least three
different instance types, otherwise Amazon EC2 will return a low Spot placement score. Similarly, if
you specify instance attributes, they must resolve to at least three different instance types. Instance
types are considered different if they have a different name. For example, m5.8xlarge, m5a.8xlarge,
and m5.12xlarge are all considered different.
435
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
The following is an example IAM policy that grants permission to use the
ec2:GetSpotPlacementScores EC2 API action.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:GetSpotPlacementScores",
"Resource": "*"
}
]
}
For information about editing an IAM policy, see Editing IAM policies in the IAM User Guide.
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
Topics
• Calculate a Spot placement score by specifying instance attributes (console) (p. 436)
• Calculate a Spot placement score by specifying instance types (console) (p. 437)
• Calculate the Spot placement score (AWS CLI) (p. 438)
436
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
437
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
1. (Optional) To generate all of the possible parameters that can be specified for the Spot placement
score configuration, use the get-spot-placement-scores command and the --generate-cli-
skeleton parameter.
Expected output
{
"InstanceTypes": [
""
],
"TargetCapacity": 0,
"TargetCapacityUnitType": "vcpu",
"SingleAvailabilityZone": true,
"RegionNames": [
""
],
"InstanceRequirementsWithMetadata": {
"ArchitectureTypes": [
"x86_64_mac"
],
"VirtualizationTypes": [
"hvm"
],
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 0
},
"MemoryMiB": {
"Min": 0,
"Max": 0
},
"CpuManufacturers": [
"amd"
],
"MemoryGiBPerVCpu": {
"Min": 0.0,
"Max": 0.0
},
"ExcludedInstanceTypes": [
""
],
"InstanceGenerations": [
"previous"
],
"SpotMaxPricePercentageOverLowestPrice": 0,
"OnDemandMaxPricePercentageOverLowestPrice": 0,
"BareMetal": "excluded",
"BurstablePerformance": "excluded",
"RequireHibernateSupport": true,
"NetworkInterfaceCount": {
"Min": 0,
"Max": 0
},
"LocalStorage": "included",
438
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
"LocalStorageTypes": [
"hdd"
],
"TotalLocalStorageGB": {
"Min": 0.0,
"Max": 0.0
},
"BaselineEbsBandwidthMbps": {
"Min": 0,
"Max": 0
},
"AcceleratorTypes": [
"fpga"
],
"AcceleratorCount": {
"Min": 0,
"Max": 0
},
"AcceleratorManufacturers": [
"amd"
],
"AcceleratorNames": [
"vu9p"
],
"AcceleratorTotalMemoryMiB": {
"Min": 0,
"Max": 0
}
}
},
"DryRun": true,
"MaxResults": 0,
"NextToken": ""
}
2. Create a JSON configuration file using the output from the previous step, and configure it as follows:
a. For TargetCapacity, enter your desired Spot capacity in terms of the number of instances or
vCPUs, or the amount of memory (MiB).
b. For TargetCapacityUnitType, enter the unit for the target capacity. If you omit this
parameter, it defaults to units.
With a Region filter, the response returns only the Regions that you specify. If you specified
true for SingleAvailabilityZone, the response returns only the Availability Zones in the
specified Regions.
e. You can include either InstanceTypes or InstanceRequirements, but not both in the same
configuration.
• To specify a list of instance types, specify the instance types in the InstanceTypes
parameter. Specify at least three different instance types. If you specify only one or two
439
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
instance types, Spot placement score returns a low score. For the list of instance types, see
Amazon EC2 Instance Types.
• To specify the instance attributes so that Amazon EC2 will identify the instance
types that match those attributes, specify the attributes that are located in the
InstanceRequirements structure.
You must provide values for VCpuCount, MemoryMiB, and CpuManufacturers. You can
omit the other attributes; when omitted, the default values are used. For a description of
each attribute and their default values, see get-spot-placement-scores in the Amazon EC2
Command Line Reference.
"SpotPlacementScores": [
{
"Region": "us-east-1",
"Score": 7
},
{
"Region": "us-west-1",
"Score": 5
},
...
"SpotPlacementScores": [
{
"Region": "us-east-1",
"AvailabilityZoneId": "use1-az1"
"Score": 8
},
{
"Region": "us-east-1",
"AvailabilityZoneId": "usw2-az3"
"Score": 6
},
...
Example configurations
When using the AWS CLI, you can use the following example configurations.
Example configurations
• Example: Specify instance types and target capacity (p. 441)
440
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
• Example: Specify instance types, and target capacity in terms of memory (p. 441)
• Example: Specify attributes for attribute-based instance type selection (p. 441)
• Example: Specify attributes for attribute-based instance type selection and return a scored list of
Availability Zones (p. 442)
The following example configuration specifies three different instance types and a target Spot capacity
of 500 Spot Instances.
{
"InstanceTypes": [
"m5.4xlarge",
"r5.2xlarge",
"m4.4xlarge"
],
"TargetCapacity": 500
}
The following example configuration specifies three different instance types and a target Spot capacity
of 500,000 MiB of memory, where the number of Spot Instances to launch must provide a total of
500,000 MiB of memory.
{
"InstanceTypes": [
"m5.4xlarge",
"r5.2xlarge",
"m4.4xlarge"
],
"TargetCapacity": 500000,
"TargetCapacityUnitType": "memory-mib"
}
The following example configuration is configured for attribute-based instance type selection, and is
followed by a text explanation of the example configuration.
{
"TargetCapacity": 5000,
"TargetCapacityUnitType": "vcpu",
"InstanceRequirementsWithMetadata": {
"ArchitectureTypes": ["arm64"],
"VirtualizationTypes": ["hvm"],
"InstanceRequirements": {
"VCpuCount": {
"Min": 1,
"Max": 12
},
"MemoryMiB": {
"Min": 512
}
}
}
}
InstanceRequirementsWithMetadata
441
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
In the preceding example, the following required instance attributes are specified:
Note that there are several other optional attributes that you can specify. For the list of attributes, see
get-spot-placement-scores in the Amazon EC2 Command Line Reference.
TargetCapacityUnitType
The TargetCapacityUnitType parameter specifies the unit for the target capacity. In the example,
the target capacity is 5000 and the target capacity unit type is vcpu, which together specify a desired
target capacity of 5000 vCPUs, where the number of Spot Instances to launch must provide a total of
5000 vCPUs.
Example: Specify attributes for attribute-based instance type selection and return a scored list of
Availability Zones
The following example configuration is configured for attribute-based instance type selection. By
specifying "SingleAvailabilityZone": true, the response will return a list of scored Availability
Zones.
{
"TargetCapacity": 1000,
"TargetCapacityUnitType": "vcpu",
"SingleAvailabilityZone": true,
"InstanceRequirementsWithMetadata": {
"ArchitectureTypes": ["arm64"],
"VirtualizationTypes": ["hvm"],
"InstanceRequirements": {
"VCpuCount": {
"Min": 1,
"Max": 12
},
"MemoryMiB": {
"Min": 512
}
}
}
}
Data feed files arrive in your bucket typically once an hour, and each hour of usage is typically covered in
a single data file. These files are compressed (gzip) before they are delivered to your bucket. Amazon EC2
can write multiple files for a given hour of usage where files are large (for example, when file contents
for the hour exceed 50 MB before compression).
442
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Note
You can create only one Spot Instance data feed per AWS account. If you don't have a Spot
Instance running during a certain hour, you don't receive a data feed file for that hour.
Spot Instance data feed is supported in all AWS Regions except China (Beijing), China (Ningxia), AWS
GovCloud (US), and the Regions that are disabled by default.
Contents
• Data feed file name and format (p. 443)
• Amazon S3 bucket requirements (p. 444)
• Subscribe to your Spot Instance data feed (p. 444)
• Describe your Spot Instance data feed (p. 444)
• Delete your Spot Instance data feed (p. 445)
bucket-name.s3.amazonaws.com/optional-prefix/aws-account-id.YYYY-MM-DD-HH.n.unique-id.gz
For example, if your bucket name is my-bucket-name and your prefix is my-prefix, your file names are
similar to the following:
my-bucket-name.s3.amazonaws.com/my-prefix/111122223333.2019-03-17-20.001.pwBdGTJG.gz
For more information about bucket names, see Rules for bucket naming in the Amazon Simple Storage
Service User Guide.
The Spot Instance data feed files are tab-delimited. Each line in the data file corresponds to one instance
hour and contains the fields listed in the following table.
Field Description
Timestamp The timestamp used to determine the price charged for this instance usage.
UsageType The type of usage and instance type being charged for. For m1.small Spot
Instances, this field is set to SpotUsage. For all other instance types, this field is
set to SpotUsage:{instance-type}. For example, SpotUsage:c1.medium.
Operation The product being charged for. For Linux Spot Instances, this field is
set to RunInstances. For Windows Spot Instances, this field is set to
RunInstances:0002. Spot usage is grouped according to Availability Zone.
InstanceID The ID of the Spot Instance that generated this instance usage.
MyBidID The ID for the Spot Instance request that generated this instance usage.
MarketPrice The Spot price at the time specified in the Timestamp field.
Version The version included in the data feed file name for this record.
443
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Before you choose an Amazon S3 bucket for the data feed, consider the following:
• You must have FULL_CONTROL permission to the bucket, which includes permission for the
s3:GetBucketAcl and s3:PutBucketAcl actions.
If you're the bucket owner, you have this permission by default. Otherwise, the bucket owner must
grant your AWS account this permission.
• When you subscribe to a data feed, these permissions are used to update the bucket ACL to give the
AWS data feed account FULL_CONTROL permission. The AWS data feed account writes data feed files
to the bucket. If your account doesn't have the required permissions, the data feed files cannot be
written to the bucket.
Note
If you update the ACL and remove the permissions for the AWS data feed account, the data
feed files cannot be written to the bucket. You must resubscribe to the data feed to receive
the data feed files.
• Each data feed file has its own ACL (separate from the ACL for the bucket). The bucket owner
has FULL_CONTROL permission to the data files. The AWS data feed account has read and write
permissions.
• If you delete your data feed subscription, Amazon EC2 doesn't remove the read and write permissions
for the AWS data feed account on either the bucket or the data files. You must remove these
permissions yourself.
• You must use a customer managed key if you encrypt your Amazon S3 bucket using server-side
encryption with a AWS KMS key stored in AWS Key Management Service (SSE-KMS). For more
information, see Amazon S3 bucket server-side encryption in the Amazon CloudWatch Logs User Guide.
Note
For Spot Instance data feed, the resource that generates the S3 files is no longer Amazon
CloudWatch Logs. Therefore, you must remove the aws:SourceArn section from the S3
bucket permission policy and from the KMS policy.
Example output
{
"SpotDatafeedSubscription": {
"OwnerId": "111122223333",
"Bucket": "my-bucket-name",
"Prefix": "my-prefix",
"State": "Active"
}
}
444
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Instances
Example output
{
"SpotDatafeedSubscription": {
"OwnerId": "123456789012",
"Prefix": "spotdata",
"Bucket": "my-s3-bucket",
"State": "Active"
}
}
Each quota type specifies the maximum number of vCPUs for one or more instance families. For
information about the different instance families, generations, and sizes, see Amazon EC2 Instance
Types.
You can launch any combination of instance types that meet your changing application needs. For
example, with an All Standard Spot Instance Requests quota of 256 vCPUs, you could request 32
m5.2xlarge Spot Instances (32 x 8 vCPUs) or 16 c5.4xlarge Spot Instances (16 x 16 vCPUs).
Tasks
• Monitor Spot Instance quotas and usage (p. 445)
• Request a quota increase (p. 446)
445
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
• The Amazon EC2 Services quotas page in the Service Quotas console
• The get-service-quota AWS CLI
For more information, see Amazon EC2 service quotas (p. 1909) in the Amazon EC2 User Guide for Linux
Instances and Viewing service quotas in the Service Quotas User Guide.
With Amazon CloudWatch metrics integration, you can monitor EC2 usage against your quotas. You can
also configure alarms to warn about approaching quotas. For more information, see Service Quotas and
Amazon CloudWatch alarms in the Service Quotas User Guide.
Unlimited mode is suitable for burstable performance Spot Instances only if the instance runs long
enough to accrue CPU credits for bursting. Otherwise, paying for surplus credits makes burstable
performance Spot Instances more expensive than using other instances. For more information, see When
to use unlimited mode versus fixed CPU (p. 244).
T2 instances, when configured in Standard mode (p. 249), get launch credits (p. 250). T2 instances
are the only burstable performance instances that get launch credits. Launch credits are meant to
provide a productive initial launch experience for T2 instances by providing sufficient compute resources
to configure the instance. Repeated launches of T2 instances to access new launch credits is not
permitted. If you require sustained CPU, you can earn credits (by idling over some period), use Unlimited
mode (p. 242) for T2 Spot Instances, or use an instance type with dedicated CPU.
Dedicated Hosts
An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your
use. Dedicated Hosts allow you to use your existing per-socket, per-core, or per-VM software licenses,
including Windows Server, Microsoft SQL Server, SUSE, and Linux Enterprise Server.
For information about the configurations supported on Dedicated Hosts, see Dedicated Hosts
Configuration.
Contents
• Differences between Dedicated Hosts and Dedicated Instances (p. 447)
• Bring your own license (p. 447)
• Dedicated Host instance capacity (p. 448)
• Burstable T3 instances on Dedicated Hosts (p. 449)
446
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
There are no performance, security, or physical differences between Dedicated Instances and instances
on Dedicated Hosts. However, there are some differences between the two. The following table
highlights some of the key differences between Dedicated Instances and Dedicated Hosts:
* Microsoft SQL Server with License Mobility through Software Assurance, and Windows Virtual Desktop
Access (VDA) licenses can be used with Dedicated Instance.
For more information about Dedicated Instances, see Dedicated Instances (p. 486).
447
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
These are the general steps to follow in order to bring your own volume licensed machine image into
Amazon EC2.
1. Verify that the license terms controlling the use of your machine images allow usage in a virtualized
cloud environment. For more information about Microsoft Licensing, see Amazon Web Services and
Microsoft Licensing.
2. After you have verified that your machine image can be used within Amazon EC2, import it using VM
Import/Export. For information about how to import your machine image, see the VM Import/Export
User Guide.
3. After you import your machine image, you can launch instances from it onto active Dedicated Hosts in
your account.
4. When you run these instances, depending on the operating system, you might be required to activate
these instances against your own KMS server (for example, Windows Server or Windows SQL Server).
You can't activate your imported Windows AMI against the Amazon Windows KMS server.
Note
To track how your images are used in AWS, enable host recording in AWS Config. You can use
AWS Config to record configuration changes to a Dedicated Host and use the output as a data
source for license reporting. For more information, see Track configuration changes (p. 485).
For example, when you allocate an R5 Dedicated Host, it has 2 sockets and 48 physical cores on which
you can run different instance sizes, such as r5.2xlarge and r5.4xlarge, up to the core capacity
associated with the host. However, for each instance family, there is a limit on the number of instances
that can be run for each instance size. For example, an R5 Dedicated Host supports up to 2 r5.8xlarge
instances, which uses 32 of the physical cores. Additional R5 instances of another size can then be used
to fill the host to core capacity. For the supported number of instance sizes for each instance family, see
Dedicated Hosts Configuration.
Note
For Dedicated Hosts that support multiple instance sizes, we recommend that you launch the
larger instance sizes first, and then fill the remaining instance capacity with the smaller instance
sizes as needed.
The following table shows examples of different instance size combinations that you can run on a
Dedicated Host.
448
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
For more information about the instance families and instance size configurations supported on
Dedicated Hosts, see the Dedicated Hosts Configuration Table.
T3 Dedicated Hosts are best suited for running BYOL software with low to moderate CPU utilization. This
includes eligible per-socket, per-core, or per-VM software licenses, such as Windows Server, Windows
Desktop, SQL Server, SUSE Enterprise Linux Server, Red Hat Enterprise Linux, and Oracle Database.
Examples of workloads suited for T3 Dedicated Hosts are small and medium databases, virtual desktops,
development and test environments, code repositories, and product prototypes. T3 Dedicated Hosts are
not recommended for workloads with sustained high CPU utilization or for workloads that experience
correlated CPU bursts simultaneously.
T3 instances on Dedicated Hosts use the same credit model as T3 instances on shared tenancy hardware.
However, they support the standard credit mode only; they do not support the unlimited credit
mode. In standard mode, T3 instances on Dedicated Hosts earn, spend, and accrue credits in the same
way as burstable instances on shared tenancy hardware. They provide a baseline CPU performance with
the ability to burst above the baseline level. To burst above the baseline, the instance spends credits
that it has accrued in its CPU credit balance. When the accrued credits are depleted, CPU utilization is
lowered to the baseline level. For more information about standard mode, see How standard burstable
performance instances work (p. 250).
T3 Dedicated Hosts support all of the features offered by Amazon EC2 Dedicated Hosts, including
multiple instance sizes on a single host, Host resource groups, and BYOL.
T3 Dedicated Hosts run general purpose burstable T3 instances that share CPU resources of the host
by providing a baseline CPU performance and the ability to burst to a higher level when needed. This
enables T3 Dedicated Hosts, which have 48 cores, to support up to a maximum of 192 instances per
host. In order to efficiently utilize the host’s resources and to provide the best instance performance, the
Amazon EC2 instance placement algorithm automatically calculates the supported number of instances
and instance size combinations that can be launched on the host.
T3 Dedicated Hosts support multiple instance types on the same host. All T3 instance sizes are
supported on Dedicated Hosts. You can run different combinations of T3 instances up to the CPU limit of
the host.
The following table lists the supported instance types, summarizes the performance of each instance
type, and indicates the maximum number of instances of each size that can be launched.
Instance
vCPUs Memory Baseline CPU Network burst Amazon Max number of
type (GiB) utilization per bandwidth EBS burst instances per
vCPU (Gbps) bandwidth Dedicated Host
(Mbps)
t3.nano
2 0.5 5% 5 Up to 2,085 192
t3.micro
2 1 10% 5 Up to 2,085 192
t3.small
2 2 20% 5 Up to 2,085 192
449
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Instance
vCPUs Memory Baseline CPU Network burst Amazon Max number of
type (GiB) utilization per bandwidth EBS burst instances per
vCPU (Gbps) bandwidth Dedicated Host
(Mbps)
t3.medium
2 4 20% 5 Up to 2,085 192
t3.large
2 8 30% 5 2,780 96
t3.xlarge
4 16 40% 5 2,780 48
t3.2xlarge
8 32 40% 5 2,780 24
You can use the DedicatedHostCPUUtilization Amazon CloudWatch metric to monitor the vCPU
utilization of a Dedicated Host. The metric is available in the EC2 namespace and Per-Host-Metrics
dimension. For more information, see Dedicated Host metrics (p. 1144).
• To run RHEL, SUSE Linux, and SQL Server on Dedicated Hosts, you must bring your own AMIs. RHEL,
SUSE Linux, and SQL Server AMIs that are offered by AWS or that are available on AWS Marketplace
can't be used with Dedicated Hosts. For more information on how to create your own AMI, see Bring
your own license (p. 447).
This restriction does not apply to hosts allocated for high memory instances (u-6tb1.metal,
u-9tb1.metal, u-12tb1.metal, u-18tb1.metal, and u-24tb1.metal). RHEL and SUSE Linux
AMIs that are offered by AWS or that are available on AWS Marketplace can be used with these hosts.
• There is a limit on the number of running Dedicated Hosts per instance family per AWS account per
Region. Quotas apply to running instances only. If your instance is pending, stopping, stopped, or
hibernated, it does not count towards your quota. To view the quotas for your account, or to request a
quota increase, use the Service Quotas console.
• The instances that run on a Dedicated Host can only be launched in a VPC.
• Auto Scaling groups are supported when using a launch template that specifies a host resource group.
For more information, see Creating a Launch Template for an Auto Scaling Group in the Amazon EC2
Auto Scaling User Guide.
• Amazon RDS instances are not supported.
• The AWS Free Usage tier is not available for Dedicated Hosts.
• Instance placement control refers to managing instance launches onto Dedicated Hosts. You cannot
launch Dedicated Hosts into placement groups.
• If you allocate a host for a virtualized instance type, you can't modify the instance type to a .metal
instance type after the host is allocated. For example, if you allocate a host for the m5.large instance
type, you can't modify the instance type to m5.metal.
Similarly, if you allocate a host for a .metal instance type, you can't modify the instance type to
a virtualized instance type after the host is allocated. For example, if you allocate a host for the
m5.metal instance type, you can't modify the instance type to m5.large.
450
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Payment Options
• On-Demand Dedicated Hosts (p. 451)
• Dedicated Host Reservations (p. 451)
• Savings Plans (p. 451)
• Pricing for Windows Server on Dedicated Hosts (p. 452)
On-Demand billing is automatically activated when you allocate a Dedicated Host to your account.
The On-Demand price for a Dedicated Host varies by instance family and Region. You pay per second
(with a minimum of 60 seconds) for active Dedicated Host, regardless of the quantity or the size of
instances that you choose to launch on it. For more information about On-Demand pricing, see Amazon
EC2 Dedicated Hosts On-Demand Pricing.
You can release an On-Demand Dedicated Host at any time to stop accruing charges for it. For
information about releasing a Dedicated Host, see Release Dedicated Hosts (p. 466).
• No Upfront—No Upfront Reservations provide you with a discount on your Dedicated Host usage over
a term and do not require an upfront payment. Available in one-year and three-year terms. Only some
instance families support the three-year term for No Upfront Reservations.
• Partial Upfront—A portion of the reservation must be paid upfront and the remaining hours in the
term are billed at a discounted rate. Available in one-year and three-year terms.
• All Upfront—Provides the lowest effective price. Available in one-year and three-year terms and
covers the entire cost of the term upfront, with no additional future charges.
You must have active Dedicated Hosts in your account before you can purchase reservations. Each
reservation can cover one or more hosts that support the same instance family in a single Availability
Zone. Reservations are applied to the instance family on the host, not the instance size. If you have
three Dedicated Hosts with different instances sizes (m4.xlarge, m4.medium, and m4.large) you can
associate a single m4 reservation with all those Dedicated Hosts. The instance family and Availability
Zone of the reservation must match that of the Dedicated Hosts you want to associate it with.
When a reservation is associated with a Dedicated Host, the Dedicated Host can't be released until the
reservation's term is over.
For more information about reservation pricing, see Amazon EC2 Dedicated Hosts Pricing.
Savings Plans
Savings Plans are a flexible pricing model that offers significant savings over On-Demand Instances. With
Savings Plans, you make a commitment to a consistent amount of usage, in USD per hour, for a term of
one or three years. This provides you with the flexibility to use the Dedicated Hosts that best meet your
needs and continue to save money, instead of making a commitment to a specific Dedicated Host. For
more information, see the AWS Savings Plans User Guide.
Note
Savings Plans are not supported with u-6tb1.metal, u-9tb1.metal, u-12tb1.metal,
u-18tb1.metal, and u-24tb1.metal Dedicated Hosts.
451
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
In addition, you can also use Windows Server AMIs provided by Amazon to run the latest versions of
Windows Server on Dedicated Hosts. This is common for scenarios where you have existing SQL Server
licenses eligible to run on Dedicated Hosts, but need Windows Server to run the SQL Server workload.
Windows Server AMIs provided by Amazon are supported on current generation instance types (p. 204)
only. For more information, see Amazon EC2 Dedicated Hosts Pricing.
If you no longer need an On-Demand host, you can stop the instances running on the host, direct them
to launch on a different host, and then release the host.
Dedicated Hosts are also integrated with AWS License Manager. With License Manager, you can create a
host resource group, which is a collection of Dedicated Hosts that are managed as a single entity. When
creating a host resource group, you specify the host management preferences, such as auto-allocate and
auto-release, for the Dedicated Hosts. This allows you to launch instances onto Dedicated Hosts without
manually allocating and managing those hosts. For more information, see Host Resource Groups in the
AWS License Manager User Guide.
Contents
• Allocate Dedicated Hosts (p. 452)
• Launch instances onto a Dedicated Host (p. 455)
• Launch instances into a host resource group (p. 456)
• Understand auto-placement and affinity (p. 458)
• Modify Dedicated Host auto-placement (p. 458)
• Modify the supported instance types (p. 459)
• Modify instance tenancy and affinity (p. 461)
• View Dedicated Hosts (p. 462)
• Tag Dedicated Hosts (p. 463)
• Monitor Dedicated Hosts (p. 465)
• Release Dedicated Hosts (p. 466)
• Purchase Dedicated Host Reservations (p. 467)
• View Dedicated Host reservations (p. 468)
• Tag Dedicated Host Reservations (p. 469)
452
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Support for multiple instance sizes of the same instance family on the same Dedicated Host is available
for the following instance families: A1, C5, M5, R5, C5n, M5n, R5n, and T3. Other instance families
support only one instance size on the same Dedicated Host.
Due to a hardware limitation with N-type Dedicated Hosts, such as C5n, M5n, and R5n, you cannot mix
smaller instance sizes (large, xlarge, and 2xlarge) with larger instance sizes (4xlarge, 9xlarge,
18xlarge, and .metal). If you require smaller and larger instance sizes on N-type hosts at the same
time, you must allocate separate hosts for the smaller and larger instance sizes.
New console
• To configure the Dedicated Host to support multiple instance types in the selected instance
family, for Support multiple instance types, choose Enable. Enabling this allows you to
launch different instance sizes from the same instance family onto the Dedicated Host.
For example, if you choose the m5 instance family and choose this option, you can launch
m5.xlarge and m5.4xlarge instances onto the Dedicated Host.
• To configure the Dedicated Host to support a single instance type within the selected instance
family, clear Support multiple instance types, and then for Instance type, choose the
instance type to support. This allows you to launch a single instance type on the Dedicated
Host. For example, if you choose this option and specify m5.4xlarge as the supported
instance type, you can launch only m5.4xlarge instances onto the Dedicated Host.
5. For Availability Zone, choose the Availability Zone in which to allocate the Dedicated Host.
6. To allow the Dedicated Host to accept untargeted instance launches that match its instance
type, for Instance auto-placement, choose Enable. For more information about auto-
placement, see Understand auto-placement and affinity (p. 458).
7. To enable host recovery for the Dedicated Host, for Host recovery, choose Enable. For more
information, see Host recovery (p. 476).
8. For Quantity, enter the number of Dedicated Hosts to allocate.
9. (Optional) Choose Add new tag and enter a tag key and a tag value.
10. Choose Allocate.
Old console
• To configure the Dedicated Host to support multiple instance types in the selected instance
family, select Support multiple instance types. Enabling this allows you to launch different
instance sizes from the same instance family onto the Dedicated Host. For example, if you
choose the m5 instance family and choose this option, you can launch m5.xlarge and
453
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
m5.4xlarge instances onto the Dedicated Host. The instance family must be powered by the
Nitro System.
• To configure the Dedicated Host to support a single instance type within the selected instance
family, clear Support multiple instance types, and then for Instance type, choose the
instance type to support. This allows you to launch a single instance type on the Dedicated
Host. For example, if you choose this option and specify m5.4xlarge as the supported
instance type, you can launch only m5.4xlarge instances onto the Dedicated Host.
5. For Availability Zone, choose the Availability Zone in which to allocate the Dedicated Host.
6. To allow the Dedicated Host to accept untargeted instance launches that match its instance
type, for Instance auto-placement, choose Enable. For more information about auto-
placement, see Understand auto-placement and affinity (p. 458).
7. To enable host recovery for the Dedicated Host, for Host recovery choose Enable. For more
information, see Host recovery (p. 476).
8. For Quantity, enter the number of Dedicated Hosts to allocate.
9. (Optional) Choose Add Tag and enter a tag key and a tag value.
10. Choose Allocate host.
AWS CLI
Use the allocate-hosts AWS CLI command. The following command allocates a Dedicated Host that
supports multiple instance types from the m5 instance family in us-east-1a Availability Zone. The
host also has host recovery enabled and it has auto-placement disabled.
The following command allocates a Dedicated Host that supports untargeted m4.large instance
launches in the eu-west-1a Availability Zone, enables host recovery, and applies a tag with a key of
purpose and a value of production.
PowerShell
Use the New-EC2Host AWS Tools for Windows PowerShell command. The following command
allocates a Dedicated Host that supports multiple instance types from the m5 instance family in
us-east-1a Availability Zone. The host also has host recovery enabled and it has auto-placement
disabled.
The following commands allocate a Dedicated Host that supports untargeted m4.large instance
launches in the eu-west-1a Availability Zone, enable host recovery, and apply a tag with a key of
purpose and a value of production.
The TagSpecification parameter used to tag a Dedicated Host on creation requires an object
that specifies the type of resource to be tagged, the tag key, and the tag value. The following
commands create the required object.
454
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
The following command allocates the Dedicated Host and applies the tag specified in the $tagspec
object.
Before you launch your instances, take note of the limitations. For more information, see Dedicated
Hosts restrictions (p. 450).
You can launch an instance onto a Dedicated Host using the following methods.
Console
To launch an instance onto a specific Dedicated Host from the Dedicated Hosts page
• Select Off — The instance launches onto the specified host, but it is not guaranteed to restart
on the same Dedicated Host if stopped.
• Select the Dedicated Host ID — If stopped, the instance always restarts on this specific host.
For more information about Affinity, see Understand auto-placement and affinity (p. 458).
455
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Note
The Tenancy and Host options are pre-configured based on the host that you selected.
8. Configure the remaining instance options as needed. For more information, see Launch an
instance using defined parameters (p. 541).
9. Choose Launch instance.
To launch an instance onto a Dedicated Host using the Launch Instance wizard
• Select Off — The instance launches onto the specified host, but it is not guaranteed to
restart on the same Dedicated Host if stopped.
• Select the Dedicated Host ID — If stopped, the instance always restarts on this specific
host.
For more information about Affinity, see Understand auto-placement and affinity (p. 458).
7. Configure the remaining instance options as needed. For more information, see Launch an
instance using defined parameters (p. 541).
8. Choose Launch instance.
AWS CLI
Use the run-instances AWS CLI command and specify the instance affinity, tenancy, and host in the
Placement request parameter.
PowerShell
Use the New-EC2Instance AWS Tools for Windows PowerShell command and specify the instance
affinity, tenancy, and host in the Placement request parameter.
456
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
have a host with available instance capacity, Amazon EC2 automatically allocates a new host in the host
resource group, and then launches the instance onto that host. For more information, see Host Resource
Groups in the AWS License Manager User Guide.
• You must associate a core- or socket-based license configuration with the AMI.
• You can't use SQL Server, SUSE, or RHEL AMIs provided by Amazon EC2 with Dedicated Hosts.
• You can't target a specific host by choosing a host ID, and you can't enable instance affinity when
launching an instance into a host resource group.
You can launch an instance into a host resource group using the following methods.
Console
• Select Off — The instance launches onto the specified host, but it is not guaranteed to
restart on the same Dedicated Host if stopped.
• Select the Dedicated Host ID — If stopped, the instance always restarts on this specific
host.
For more information about Affinity, see Understand auto-placement and affinity (p. 458).
7. Configure the remaining instance options as needed. For more information, see Launch an
instance using defined parameters (p. 541).
8. Choose Launch instance.
AWS CLI
Use the run-instances AWS CLI command, and in the Placement request parameter, omit the
Tenancy option and specify the host resource group ARN.
PowerShell
457
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Use the New-EC2Instance AWS Tools for Windows PowerShell command, and in the Placement
request parameter, omit the Tenancy option and specify the host resource group ARN.
Auto-placement
Auto-placement is configured at the host level. It allows you to manage whether instances that you
launch are launched onto a specific host, or onto any available host that has matching configurations.
When the auto-placement of a Dedicated Host is disabled, it only accepts Host tenancy instance launches
that specify its unique host ID. This is the default setting for new Dedicated Hosts.
When the auto-placement of a Dedicated Host is enabled, it accepts any untargeted instance launches
that match its instance type configuration.
When launching an instance, you need to configure its tenancy. Launching an instance onto a Dedicated
Host without providing a specific HostId enables it to launch on any Dedicated Host that has auto-
placement enabled and that matches its instance type.
Host affinity
Host affinity is configured at the instance level. It establishes a launch relationship between an instance
and a Dedicated Host.
When affinity is set to Host, an instance launched onto a specific host always restarts on the same host
if stopped. This applies to both targeted and untargeted launches.
When affinity is set to Off, and you stop and restart the instance, it can be restarted on any available
host. However, it tries to launch back onto the last Dedicated Host on which it ran (on a best-effort
basis).
New console
Old console
458
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
AWS CLI
Use the modify-hosts AWS CLI command. The following example enables auto-placement for the
specified Dedicated Host.
PowerShell
Use the Edit-EC2Host AWS Tools for Windows PowerShell command. The following example enables
auto-placement for the specified Dedicated Host.
You can modify a Dedicated Host to change the instance types that it supports. If it currently supports
a single instance type, you can modify it to support multiple instance types within that instance family.
Similarly, if it currently supports multiple instance types, you can modify it to support a specific instance
type only.
To modify a Dedicated Host to support multiple instance types, you must first stop all running instances
on the host. The modification takes approximately 10 minutes to complete. The Dedicated Host
transitions to the pending state while the modification is in progress. You can't start stopped instances
or launch new instances on the Dedicated Host while it is in the pending state.
To modify a Dedicated Host that supports multiple instance types to support only a single instance type,
the host must either have no running instances, or the running instances must be of the instance type
that you want the host to support. For example, to modify a host that supports multiple instance types
in the m5 instance family to support only m5.large instances, the Dedicated Host must either have no
running instances, or it must have only m5.large instances running on it.
If you allocate a host for a virtualized instance type, you can't modify the instance type to a .metal
instance type after the host is allocated. For example, if you allocate a host for the m5.large instance
type, you can't modify the instance type to m5.metal. Similarly, if you allocate a host for a .metal
instance type, you can't modify the instance type to a virtualized instance type after the host is
allocated. For example, if you allocate a host for the m5.metal instance type, you can't modify the
instance type to m5.large.
459
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You can modify the supported instance types using one of the following methods.
New console
• If the Dedicated Host currently supports a specific instance type, Support multiple instance
types is not enabled, and Instance type lists the supported instance type. To modify the host
to support multiple types in the current instance family, for Support multiple instance types,
choose Enable.
You must first stop all instances running on the host before modifying it to support multiple
instance types.
• If the Dedicated Host currently supports multiple instance types in an instance family,
Enabled is selected for Support multiple instance types. To modify the host to support
a specific instance type, for Support multiple instance types, clear Enable, and then for
Instance type, select the specific instance type to support.
You can't change the instance family supported by the Dedicated Host.
5. Choose Save.
Old console
• If the Dedicated Host currently supports a specific instance type, No is selected for Support
multiple instance types. To modify the host to support multiple types in the current instance
family, for Support multiple instance types, select Yes.
You must first stop all instances running on the host before modifying it to support multiple
instance types.
• If the Dedicated Host currently supports multiple instance types in an instance family, Yes is
selected for Support multiple instance types, and Instance family displays the supported
instance family. To modify the host to support a specific instance type, for Support multiple
instance types, select No, and then for Instance type, select the specific instance type to
support.
You can't change the instance family supported by the Dedicated Host.
5. Choose Save.
AWS CLI
460
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
The following command modifies a Dedicated Host to support multiple instance types within the m5
instance family.
The following command modifies a Dedicated Host to support m5.xlarge instances only.
PowerShell
The following command modifies a Dedicated Host to support multiple instance types within the m5
instance family.
The following command modifies a Dedicated Host to support m5.xlarge instances only.
You can modify an instance's tenancy and affinity using the following methods.
Console
461
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
For more information, see Understand auto-placement and affinity (p. 458).
6. Choose Save.
AWS CLI
Use the modify-instance-placement AWS CLI command. The following example changes the
specified instance's affinity from default to host, and specifies the Dedicated Host that the
instance has affinity with.
PowerShell
Use the Edit-EC2InstancePlacement AWS Tools for Windows PowerShell command. The following
example changes the specified instance's affinity from default to host, and specifies the
Dedicated Host that the instance has affinity with.
New console
Available vCPUs indicates the vCPUs that are available on the Dedicated Host for new instance
launches. For example, a Dedicated Host that supports multiple instance types within the c5
instance family, and that has no instances running on it, has 72 available vCPUs. This means that
you can launch different combinations of instance types onto the Dedicated Host to consume
the 72 available vCPUs.
462
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
For information about instances running on the host, choose Running instances.
Old console
AWS CLI
The following example uses the describe-hosts (AWS CLI) command to view the available instance
capacity for a Dedicated Host that supports multiple instance types within the c5 instance family.
The Dedicated Host already has two c5.4xlarge instances and four c5.2xlarge instances running
on it.
"AvailableInstanceCapacity": [
{ "AvailableCapacity": 2,
"InstanceType": "c5.xlarge",
"TotalCapacity": 18 },
{ "AvailableCapacity": 4,
"InstanceType": "c5.large",
"TotalCapacity": 36 }
],
"AvailableVCpus": 8
PowerShell
463
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You can also apply tags to Dedicated Hosts at the time of creation. For more information, see Allocate
Dedicated Hosts (p. 452).
New console
Old console
AWS CLI
The following command tags the specified Dedicated Host with Owner=TeamA.
PowerShell
The New-EC2Tag command needs a Tag object, which specifies the key and value pair to be used
for the Dedicated Host tag. The following commands create a Tag object named $tag, with a key
and value pair of Owner and TeamA respectively.
464
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
The following command tags the specified Dedicated Host with the $tag object.
Console
AWS CLI
Use the describe-hosts AWS CLI command and then review the state property in the hostSet
response element.
PowerShell
Use the Get-EC2Host AWS Tools for Windows PowerShell command and then review the state
property in the hostSet response element.
State Description
available AWS hasn't detected an issue with the Dedicated Host. No maintenance or
repairs are scheduled. Instances can be launched onto this Dedicated Host.
released The Dedicated Host has been released. The host ID is no longer in use.
Released hosts can't be reused.
under-assessment AWS is exploring a possible issue with the Dedicated Host. If action must be
taken, you are notified via the AWS Management Console or email. Instances
can't be launched onto a Dedicated Host in this state.
pending The Dedicated Host cannot be used for new instance launches. It is either
being modified to support multiple instance types (p. 459), or a host
recovery (p. 476) is in progress.
465
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
State Description
permanent-failure An unrecoverable failure has been detected. You receive an eviction notice
through your instances and by email. Your instances might continue to run.
If you stop or terminate all instances on a Dedicated Host with this state,
AWS retires the host. AWS does not restart instances in this state. Instances
can't be launched onto Dedicated Hosts in this state.
released- AWS permanently releases Dedicated Hosts that have failed and no longer
permanent-failure have running instances on them. The Dedicated Host ID is no longer
available for use.
New console
Old console
AWS CLI
PowerShell
466
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
After you release a Dedicated Host, you can't reuse the same host or host ID again, and you are no longer
charged On-Demand billing rates for it. The state of the Dedicated Host is changed to released, and
you are not able to launch any instances onto that host.
Note
If you have recently released Dedicated Hosts, it can take some time for them to stop counting
towards your limit. During this time, you might experience LimitExceeded errors when trying
to allocate new Dedicated Hosts. If this is the case, try allocating new hosts again after a few
minutes.
The instances that were stopped are still available for use and are listed on the Instances page. They
retain their host tenancy setting.
Console
To purchase reservations
• Host instance family—The options listed correspond with the Dedicated Hosts in your
account that are not already assigned to a reservation.
• Availability Zone—The Availability Zone of the Dedicated Hosts in your account that aren't
already assigned to a reservation.
• Payment option—The payment option for the offering.
• Term—The term of the reservation, which can be one or three years.
4. Choose Find offering and select an offering that matches your requirements.
5. Choose the Dedicated Hosts to associate with the reservation, and then choose Review.
6. Review your order and choose Order.
AWS CLI
To purchase reservations
1. Use the describe-host-reservation-offerings AWS CLI command to list the available offerings
that match your needs. The following example lists the offerings that support instances in the
m4 instance family and have a one-year term.
Note
The term is specified in seconds. A one-year term includes 31,536,000 seconds, and a
three-year term includes 94,608,000 seconds.
The command returns a list of offerings that match your criteria. Note the offeringId of the
offering to purchase.
467
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
2. Use the purchase-host-reservation AWS CLI command to purchase the offering and provide
the offeringId noted in the previous step. The following example purchases the specified
reservation and associates it with a specific Dedicated Host that is already allocated in the AWS
account, and it applies a tag with a key of purpose and a value of production.
PowerShell
To purchase reservations
1. Use the Get-EC2HostReservationOffering AWS Tools for Windows PowerShell command to list
the available offerings that match your needs. The following examples list the offerings that
support instances in the m4 instance family and have a one-year term.
Note
The term is specified in seconds. A one-year term includes 31,536,000 seconds, and a
three-year term includes 94,608,000 seconds.
The command returns a list of offerings that match your criteria. Note the offeringId of the
offering to purchase.
2. Use the New-EC2HostReservation AWS Tools for Windows PowerShell command to purchase
the offering and provide the offeringId noted in the previous step. The following example
purchases the specified reservation and associates it with a specific Dedicated Host that is
already allocated in the AWS account.
You can view details of your Dedicated Host reservations using the following methods.
Console
468
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
AWS CLI
PowerShell
PS C:\> Get-EC2HostReservation
You can tag a Dedicated Host Reservation using the command line tools only.
AWS CLI
PowerShell
The New-EC2Tag command needs a Tag parameter, which specifies the key and value pair to be
used for the Dedicated Host Reservation tag. The following commands create the Tag parameter.
469
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
In this model, the AWS account that owns the Dedicated Host (owner) shares it with other AWS accounts
(consumers). Consumers can launch instances onto Dedicated Hosts that are shared with them in
the same way that they would launch instances onto Dedicated Hosts that they allocate in their own
account. The owner is responsible for managing the Dedicated Host and the instances that they launch
onto it. Owners can't modify instances that consumers launch onto shared Dedicated Hosts. Consumers
are responsible for managing the instances that they launch onto Dedicated Hosts shared with them.
Consumers can't view or modify instances owned by other consumers or by the Dedicated Host owner,
and they can't modify Dedicated Hosts that are shared with them.
Contents
• Prerequisites for sharing Dedicated Hosts (p. 470)
• Limitations for sharing Dedicated Hosts (p. 470)
• Related services (p. 470)
• Share across Availability Zones (p. 471)
• Share a Dedicated Host (p. 471)
• Unshare a shared Dedicated Host (p. 472)
• Identify a shared Dedicated Host (p. 472)
• View instances running on a shared Dedicated Host (p. 473)
• Shared Dedicated Host permissions (p. 473)
• Billing and metering (p. 474)
• Dedicated Host limits (p. 474)
• Host recovery and Dedicated Host sharing (p. 474)
Related services
AWS Resource Access Manager
Dedicated Host sharing integrates with AWS Resource Access Manager (AWS RAM). AWS RAM is a service
that enables you to share your AWS resources with any AWS account or through AWS Organizations.
With AWS RAM, you share resources that you own by creating a resource share. A resource share specifies
the resources to share, and the consumers with whom to share them. Consumers can be individual AWS
accounts, or organizational units or an entire organization from AWS Organizations.
470
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
For more information about AWS RAM, see the AWS RAM User Guide.
To identify the location of your Dedicated Hosts relative to your accounts, you must use the Availability
Zone ID (AZ ID). The Availability Zone ID is a unique and consistent identifier for an Availability Zone
across all AWS accounts. For example, use1-az1 is an Availability Zone ID for the us-east-1 Region
and it is the same location in every AWS account.
To view the Availability Zone IDs for the Availability Zones in your account
If you share a Dedicated Host with auto-placement enabled, keep the following in mind as it could lead
to unintended Dedicated Host usage:
• If consumers launch instances with Dedicated Host tenancy and they do not have capacity on a
Dedicated Host that they own in their account, the instance is automatically launched onto the shared
Dedicated Host.
To share a Dedicated Host, you must add it to a resource share. A resource share is an AWS RAM resource
that lets you share your resources across AWS accounts. A resource share specifies the resources to share,
and the consumers with whom they are shared. You can add the Dedicated Host to an existing resource,
or you can add it to a new resource share.
If you are part of an organization in AWS Organizations and sharing within your organization is enabled,
consumers in your organization are automatically granted access to the shared Dedicated Host.
Otherwise, consumers receive an invitation to join the resource share and are granted access to the
shared Dedicated Host after accepting the invitation.
Note
After you share a Dedicated Host, it could take a few minutes for consumers to have access to it.
You can share a Dedicated Host that you own by using one of the following methods.
To share a Dedicated Host that you own using the Amazon EC2 console
471
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
4. Select the resource share to which to add the Dedicated Host and choose Share host.
It could take a few minutes for consumers to get access to the shared host.
To share a Dedicated Host that you own using the AWS RAM console
To share a Dedicated Host that you own using the AWS CLI
• Consumers with whom the Dedicated Host was shared can no longer launch new instances onto it.
• Instances owned by consumers that were running on the Dedicated Host at the time of unsharing
continue to run but are scheduled for retirement. Consumers receive retirement notifications for
the instances and they have two weeks to take action on the notifications. However, if the Dedicated
Host is reshared with the consumer within the retirement notice period, the instance retirements are
cancelled.
To unshare a shared Dedicated Host that you own, you must remove it from the resource share. You can
do this by using one of the following methods.
To unshare a shared Dedicated Host that you own using the Amazon EC2 console
To unshare a shared Dedicated Host that you own using the AWS RAM console
To unshare a shared Dedicated Host that you own using the AWS CLI
472
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Command line
Use the describe-hosts command. The command returns the Dedicated Hosts that you own and
Dedicated Hosts that are shared with you.
To view the instances running on a shared Dedicated Host using the Amazon EC2 console
Command line
To view the instances running on a shared Dedicated Host using the AWS CLI
Use the describe-hosts command. The command returns the instances running on each Dedicated
Host. Owners see all of the instances running on the host. Consumers only see running instances
that they launched on the shared hosts. InstanceOwnerId shows the AWS account ID of the
instance owner.
473
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Owners are billed for Dedicated Hosts that they share. Consumers are not billed for instances that they
launch onto shared Dedicated Hosts.
Dedicated Host Reservations continue to provide billing discounts for shared Dedicated Hosts. Only
Dedicated Host owners can purchase Dedicated Host Reservations for shared Dedicated Hosts that they
own.
An Outpost is a pool of AWS compute and storage capacity deployed at a customer site. AWS operates,
monitors, and manages this capacity as part of an AWS Region.
You can allocate Dedicated Hosts on Outposts that you own in your account. This makes it easier for you
to bring your existing software licenses and workloads that require a dedicated physical server to AWS
Outposts.
Dedicated Hosts allow you to use your eligible software licenses on Amazon EC2, so that you get the
flexibility and cost effectiveness of using your own licenses. Other software licenses that are bound
to virtual machines, sockets, or physical cores, can also be used on Dedicated Hosts, subject to their
license terms. While Outposts have always been a single-tenant environments that are eligible for BYOL
workloads, Dedicated Hosts allows you to limit the needed licenses to a single host as opposed to the
entire Outpost deployment.
Additionally, using Dedicated Hosts on an Outpost gives you greater flexibility in instance type
deployment, and more granular control over instance placement. You can target a specific host for
instance launches and use host affinity to ensure that the instance always runs on that host, or you can
use auto-placement to launch an instance onto any available host that has matching configurations and
available capacity.
Contents
• Prerequisites (p. 475)
• Supported features (p. 475)
• Considerations (p. 475)
• Allocate and use a Dedicated Host on an Outpost (p. 475)
474
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Prerequisites
You must have an Outpost installed at your site. For more information, see Create an Outpost and order
Outpost capacity in the AWS Outposts User Guide.
Supported features
• The following instance families are supported: C5, M5, R5, C5d, M5d, R5d, G4dn, and i3en.
• Dedicated Hosts on Outposts can be configured to support multiple instance sizes. Support for
multiple instance sizes is available for the following instance families: C5, M5, R5, C5d, M5d, and R5d.
For more information, see Dedicated Host instance capacity (p. 448).
• Dedicated Hosts on Outposts support auto-placement and targeted instance launches. For more
information, see Understand auto-placement and affinity (p. 458).
• Dedicated Hosts on Outposts support host affinity. For more information, see Understand auto-
placement and affinity (p. 458).
• Dedicated Hosts on Outposts support sharing with AWS RAM. For more information, see Work with
shared Dedicated Hosts (p. 469).
Considerations
• Dedicated Host Reservations are not supported on Outposts.
• Host resource groups and AWS License Manager are not supported on Outposts.
• Dedicated Hosts on Outposts do not support burstable T3 instances.
• Dedicated Hosts on Outposts do not support host recovery.
Prerequisites
Create a subnet on the Outpost. For more information, see Create a subnet in the AWS Outposts User
Guide.
475
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
3. For Availability Zone, select the Availability Zone associated with the Outpost.
4. For Outpost ARN, enter the ARN of the Outpost.
5. Configure the remaining Dedicated Host settings as needed. For more information, see Allocate
Dedicated Hosts (p. 452).
6. Choose Allocate.
AWS CLI
Use the allocate-hosts AWS CLI command. For --availability-zone, specify the Availability
Zone associated with the Outpost. For --outpost-arn, specify the ARN of the Outpost.
Host recovery
Dedicated Host auto recovery restarts your instances on to a new replacement host when certain
problematic conditions are detected on your Dedicated Host. Host recovery reduces the need for
manual intervention and lowers the operational burden if there is an unexpected Dedicated Host failure
concerning system power or network connectivity events. Other Dedicated Host issues will require
manual intervention to recover from.
Contents
• Host recovery basics (p. 476)
• Supported instance types (p. 478)
• Configure host recovery (p. 478)
• Host recovery states (p. 479)
• Manually recover unsupported instances (p. 480)
• Related services (p. 480)
• Pricing (p. 480)
476
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Important
Dedicated Host auto recovery does not occur when the host is scheduled for retirement.
When a system power or network connectivity failure is detected on your Dedicated Host, Dedicated
Host auto recovery is initiated and Amazon EC2 automatically allocates a replacement Dedicated Host.
The replacement Dedicated Host receives a new host ID, but retains the same attributes as the original
Dedicated Host, including:
• Availability Zone
• Instance type
• Tags
• Auto placement settings
• Reservation
When the replacement Dedicated Host is allocated, the instances are recovered on to the replacement
Dedicated Host. The recovered instances retain the same attributes as the original instances, including:
• Instance ID
• Private IP addresses
• Elastic IP addresses
• EBS volume attachments
• All instance metadata
Additionally, the built-in integration with AWS License Manager automates the tracking and
management of your licenses.
Note
AWS License Manager integration is supported only in Regions in which AWS License Manager is
available.
If instances have a host affinity relationship with the impaired Dedicated Host, the recovered instances
establish host affinity with the replacement Dedicated Host.
When all of the instances have been recovered on to the replacement Dedicated Host, the impaired
Dedicated Host is released, and the replacement Dedicated Host becomes available for use.
When host recovery is initiated, the AWS account owner is notified by email and by an AWS Health
Dashboard event. A second notification is sent after the host recovery has been successfully completed.
If you are using AWS License Manager to track your licenses, AWS License Manager allocates new licenses
for the replacement Dedicated Host based on the license configuration limits. If the license configuration
has hard limits that will be breached as a result of the host recovery, the recovery process is not allowed
and you are notified of the host recovery failure through an Amazon SNS notification (if notification
settings have been configured for AWS License Manager). If the license configuration has soft limits
that will be breached as a result of the host recovery, the recovery is allowed to continue and you are
notified of the limit breach through an Amazon SNS notification. For more information, see Using
License Configurations and Settings in License Manager in the AWS License Manager User Guide.
Dedicated Host auto recovery does not occur when the host is scheduled for retirement. You will
receive a retirement notification in the AWS Health Dashboard, an Amazon CloudWatch event, and the
AWS account owner email address receives a message regarding the Dedicated Host failure. Follow the
477
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
remedial steps described in the retirement notification within the specified time period to manually
recover the instances on the retiring host.
Stopped instances are not recovered on to the replacement Dedicated Host. If you attempt to start
a stopped instance that targets the impaired Dedicated Host, the instance start fails. We recommend
that you modify the stopped instance to either target a different Dedicated Host, or to launch on any
available Dedicated Host with matching configurations and auto-placement enabled.
Instances with instance storage are not recovered on to the replacement Dedicated Host. As a remedial
measure, the impaired Dedicated Host is marked for retirement and you receive a retirement notification
after the host recovery is complete. Follow the remedial steps described in the retirement notification
within the specified time period to manually recover the remaining instances on the impaired Dedicated
Host.
To recover instances that are not supported, see Manually recover unsupported instances (p. 480).
Note
Dedicated Host auto recovery of supported metal instance types will take longer to detect and
recover from than non-metal instance types.
Contents
• Enable host recovery (p. 478)
• Disable host recovery (p. 479)
• View the host recovery configuration (p. 479)
You can enable host recovery at the time of Dedicated Host allocation or after allocation.
For more information about enabling host recovery at the time of Dedicated Host allocation, see Allocate
Dedicated Hosts (p. 452).
478
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You can disable host recovery at any time after the Dedicated Host has been allocated.
You can view the host recovery configuration for a Dedicated Host at any time.
To view the host recovery configuration for a Dedicated Host using the console
To view the host recovery configuration for a Dedicated Host using the AWS CLI
The HostRecovery response element indicates whether host recovery is enabled or disabled.
After the replacement Dedicated Host is allocated, it enters the pending state. It remains in this state
until the host recovery process is complete. You can't launch instances on to the replacement Dedicated
Host while it is in the pending state. Recovered instances on the replacement Dedicated Host remain in
the impaired state during the recovery process.
After the host recovery is complete, the replacement Dedicated Host enters the available state,
and the recovered instances return to the running state. You can launch instances on to the
replacement Dedicated Host after it enters the available state. The original impaired Dedicated Host is
permanently released and it enters the released-permanent-failure state.
If the impaired Dedicated Host has instances that do not support host recovery, such as instances with
instance store-backed volumes, the Dedicated Host is not released. Instead, it is marked for retirement
and enters the permanent-failure state.
479
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
For EBS-backed instances that could not be automatically recovered, we recommend that you manually
stop and start the instances to recover them onto a new Dedicated Host. For more information about
stopping your instance, and about the changes that occur in your instance configuration when it's
stopped, see Stop and start your instance (p. 580).
For instance store-backed instances that could not be automatically recovered, we recommend that you
do the following:
1. Launch a replacement instance on a new Dedicated Host from your most recent AMI.
2. Migrate all of the necessary data to the replacement instance.
3. Terminate the original instance on the impaired Dedicated Host.
Related services
Dedicated Host integrates with the following services:
• AWS License Manager—Tracks licenses across your Amazon EC2 Dedicated Hosts (supported only
in Regions in which AWS License Manager is available). For more information, see the AWS License
Manager User Guide.
Pricing
There are no additional charges for using host recovery, but the usual Dedicated Host charges apply. For
more information, see Amazon EC2 Dedicated Hosts Pricing.
As soon as host recovery is initiated, you are no longer billed for the impaired Dedicated Host. Billing for
the replacement Dedicated Host begins only after it enters the available state.
If the impaired Dedicated Host was billed using the On-Demand rate, the replacement Dedicated Host
is also billed using the On-Demand rate. If the impaired Dedicated Host had an active Dedicated Host
Reservation, it is transferred to the replacement Dedicated Host.
Host maintenance
With host maintenance, your Amazon EC2 instances on a degraded Dedicated Host are automatically
rebooted on a newly allocated Dedicated Host during a scheduled maintenance event. This helps
reduce application downtime and offloads the undifferentiated heavy-lift of maintenance to AWS. Host
maintenance is also performed for planned and routine Amazon EC2 maintenance.
Host maintenance is supported on all new Dedicated Host allocations made through Amazon EC2
console. For any Dedicated Host in your AWS account or any new Dedicated Host allocated through
480
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
AllocateHosts API, you can configure host maintenance for supported Dedicated Hosts. For more
information, see the section called “Configuring host maintenance” (p. 483).
Contents
• Host maintenance basics (p. 481)
• Host maintenance versus host recovery (p. 482)
• Supported instance types (p. 482)
• Instances on Dedicated Host (p. 482)
• Configuring host maintenance (p. 483)
• Maintenance event (p. 484)
• Host maintenance states (p. 484)
• Related services (p. 484)
• Pricing (p. 485)
The replacement Dedicated Host receives a new host ID, but retains the same attributes as the original
Dedicated Host. These attributes include the following.
Host maintenance is available in all AWS Regions for all supported Dedicated Hosts. For more
information about Dedicated Hosts where host maintenance is not supported, see the section called
“Limitations” (p. 481).
Your degraded Dedicated Host is released after all of your instances have been rebooted to a new
Dedicated Host or stopped. You can access your instances on the degraded Dedicated Host before the
scheduled maintenance event, but launching instances on the degraded Dedicated Host is not supported.
You can use the newly allocated Dedicated Host to launch new instances on the host before the
scheduled maintenance event. Some capacity on the new host is reserved for rebooting instances from
the degraded host. For more information, see the section called “Instances on Dedicated Host” (p. 482).
Limitations
• Host maintenance is not supported in AWS Outposts, AWS Local Zones, and AWS Wavelength Zones.
• Host maintenance cannot be turned on or off for hosts already within a host resource group. Hosts
added to a host resource group retain their host maintenance setting. For more information, see Host
resource groups.
• Host maintenance is only supported on specific instance types. For more information, see the section
called “Supported instance types” (p. 482).
481
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You can stop and start an instance on the degraded host at any point before the scheduled
maintenance event is initiated. Doing this reboots your instance on to another host, and your instance
won't undergo scheduled maintenance. You must update your instance's host affinity to the new host
where you want to reboot your instance. For more information, see Stop and start your instance.
Note
The data on any local store volume is not preserved when you stop and start your instance.
Instances with an instance store volume as the root device are terminated after the specified
termination date. Any data on the instance store volumes is deleted when the instances are terminated.
Terminated instances are permanently deleted, and cannot be started again. For instances with instance
store volumes as the root device, we recommend launching replacement instances on a different
Dedicated Host using the most recent Amazon Machine Image, and migrating all available data to
the replacement instances before the specified termination date. For more information, see Instance
retirement.
Instances that cannot be rebooted automatically are stopped after the specified date. You can start
these instances again on a different host. Instances using an Amazon EBS volume as a root device
continue to use the same Amazon EBS volume after being started on a new host.
482
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You can set the order of instance reboot by rescheduling the start time of an instance reboot in https://
console.aws.amazon.com/ec2/.
To enable host maintenance for your Dedicated Host using AWS Management Console.
To disable host maintenance for your Dedicated Host using AWS Management Console.
To view the host maintenance configuration for your Dedicated Host using AWS
Management Console.
AWS CLI
To enable or disable host maintenance for your new Dedicated Host during allocation using AWS
CLI.
Enable
Disable
To enable or disable host maintenance for your existing Dedicated Host using AWS CLI.
Enable
483
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
Disable
To view the host maintenance configuration for your Dedicated Host using AWS CLI.
Note
If you disable host maintenance, you receive an email notification to evict the degraded host
and manually migrate your instances to another host within 28 days. A replacement host is
allocated if you have Dedicated Host reservation. After 28 days, the instances running on the
degraded host are terminated, and the host is released automatically.
Maintenance event
On detection of degradation, a maintenance event is scheduled 14 days later, to reboot your instances
on a new Dedicated Host. You receive an email notification providing details about the degraded host,
scheduled maintenance event, and maintenance time slots. For more information, see View scheduled
events.
You can reschedule the maintenance event for any day up to seven days after the date of the scheduled
event. For more information about rescheduling, see Reschedule a scheduled event.
The maintenance event usually takes a few minutes to complete. In the rare case of unsuccessful event,
you receive an email notification to evict the instances on the degraded host within a specified time
frame.
After detecting degradation on a Dedicated Host and before scheduling a maintenance event, host
maintenance automatically allocates a new Dedicated Host in your account. This newly allocated
replacement host stays in a pending state until a maintenance event is scheduled. Once the
maintenance event is scheduled, the new Dedicated Host moves to the available state. You can launch
new instances on this host at any time, even before the maintenance event.
Note
The capacity required to migrate existing instances from the degraded host to the new host is
made unavailable to enable a smooth transition during the maintenance event.
Related services
Dedicated Host integrates with AWS License Manager—Tracks licenses across your Amazon EC2
Dedicated Hosts (supported only in Regions in which AWS License Manager is available). For more
information, see the AWS License Manager User Guide.
484
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Hosts
You must have sufficient licenses in your AWS account for your new Dedicated Host. The licenses
associated with your degraded host are released when the host is released after the completion of the
scheduled maintenance event.
Pricing
There are no additional charges for using host maintenance, but the usual Dedicated Host charges apply.
For more information, see Amazon EC2 Dedicated Hosts Pricing.
As soon as host maintenance is initiated, you are no longer billed for the degraded Dedicated Host.
Billing for the newly allocated Dedicated Host begins only after it enters the available state.
If the degraded Dedicated Host was billed using the On-Demand rate, the newly allocated Dedicated
Host is also billed using the On-Demand rate. If the degraded Dedicated Host had an active Dedicated
Host Reservation, it is transferred to the new Dedicated Host.
AWS Config records configuration information for Dedicated Hosts and instances individually, and pairs
this information through relationships. There are three reporting conditions:
• AWS Config recording status—When On, AWS Config is recording one or more AWS resource types,
which can include Dedicated Hosts and Dedicated Instances. To capture the information required for
license reporting, verify that hosts and instances are being recorded with the following fields.
• Host recording status—When Enabled, the configuration information for Dedicated Hosts is recorded.
• Instance recording status—When Enabled, the configuration information for Dedicated Instances is
recorded.
If any of these three conditions are disabled, the icon in the Edit Config Recording button is red. To
derive the full benefit of this tool, ensure that all three recording methods are enabled. When all three
are enabled, the icon is green. To edit the settings, choose Edit Config Recording. You are directed to
the Set up AWS Config page in the AWS Config console, where you can set up AWS Config and start
recording for your hosts, instances, and other supported resource types. For more information, see
Setting up AWS Config using the Console in the AWS Config Developer Guide.
Note
AWS Config records your resources after it discovers them, which might take several minutes.
After AWS Config starts recording configuration changes to your hosts and instances, you can get the
configuration history of any host that you have allocated or released and any instance that you have
launched, stopped, or terminated. For example, at any point in the configuration history of a Dedicated
Host, you can look up how many instances are launched on that host, along with the number of sockets
and cores on the host. For any of those instances, you can also look up the ID of its Amazon Machine
Image (AMI). You can use this information to report on licensing for your own server-bound software
that is licensed per-socket or per-core.
• By using the AWS Config console. For each recorded resource, you can view a timeline page, which
provides a history of configuration details. To view this page, choose the gray icon in the Config
Timeline column of the Dedicated Hosts page. For more information, see Viewing Configuration
Details in the AWS Config Console in the AWS Config Developer Guide.
• By running AWS CLI commands. First, you can use the list-discovered-resources command to get a
list of all hosts and instances. Then, you can use the get-resource-config-history command to get the
485
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
configuration details of a host or instance for a specific time interval. For more information, see View
Configuration Details Using the CLI in the AWS Config Developer Guide.
• By using the AWS Config API in your applications. First, you can use the ListDiscoveredResources action
to get a list of all hosts and instances. Then, you can use the GetResourceConfigHistory action to get
the configuration details of a host or instance for a specific time interval.
For example, to get a list of all of your Dedicated Hosts from AWS Config, run a CLI command such as the
following.
To obtain the configuration history of a Dedicated Host from AWS Config, run a CLI command such as
the following.
For more information, see Viewing Configuration Details in the AWS Config Console.
• AWS CLI: Viewing Configuration Details (AWS CLI) in the AWS Config Developer Guide.
• Amazon EC2 API: GetResourceConfigHistory.
Dedicated Instances
By default, EC2 instances run on shared tenancy hardware. Dedicated Instances are EC2 instances that
run on hardware that's dedicated to a single customer. Dedicated Instances that belong to different AWS
accounts are physically isolated at a hardware level, even if those accounts are linked to a single payer
account. However, Dedicated Instances might share hardware with other instances from the same AWS
account that are not Dedicated Instances.
A Dedicated Host is also a physical server that's dedicated for your use. With a Dedicated Host, you have
visibility and control over how instances are placed on the server. For more information, see Dedicated
Hosts (p. 446).
Topics
• Dedicated Instance basics (p. 487)
• Supported features (p. 487)
• Differences between Dedicated Instances and Dedicated Hosts (p. 488)
• Dedicated Instances limitations (p. 489)
• Pricing for Dedicated Instances (p. 489)
• Work with Dedicated Instances (p. 489)
486
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
• Create a VPC with a tenancy of dedicated, so that all instances in the VPC run as Dedicated Instances.
For more information, see Create a VPC with a dedicated instance tenancy (p. 489).
• Create a VPC with a tenancy of default and manually specify a tenancy of dedicated for the
instances to run as Dedicated Instances. For more information, see Launch Dedicated Instances into a
VPC (p. 489).
Supported features
Dedicated Instances support the following features and AWS service integrations:
Topics
• Reserved Instances (p. 487)
• Automatic scaling (p. 487)
• Automatic recovery (p. 487)
• Dedicated Spot Instances (p. 487)
• Burstable performance instances (p. 488)
Reserved Instances
To guarantee that sufficient capacity is available to launch Dedicated Instances, you can purchase
Dedicated Reserved Instances or Capacity Reservations. For more information, see Reserved
Instances (p. 340) and On-Demand Capacity Reservations (p. 492).
When you purchase a Dedicated Reserved Instance, you are purchasing the capacity to launch a
Dedicated Instance into a VPC at a much reduced usage fee; the price break in the usage charge applies
only if you launch an instance with dedicated tenancy. When you purchase a Reserved Instance with
default tenancy, it applies only to a running instance with default tenancy; it does not apply to a
running instance with dedicated tenancy.
You can't use the modification process to change the tenancy of a Reserved Instance after you've
purchased it. However, you can exchange a Convertible Reserved Instance for a new Convertible
Reserved Instance with a different tenancy.
Automatic scaling
You can use Amazon EC2 Auto Scaling to launch Dedicated Instances. For more information, see
Launching Auto Scaling Instances in a VPC in the Amazon EC2 Auto Scaling User Guide.
Automatic recovery
You can configure automatic recovery for a Dedicated Instance if it becomes impaired due to an
underlying hardware failure or a problem that requires AWS involvement to repair. For more information,
see Recover your instance (p. 606).
487
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
Amazon EC2 has systems in place to identify and correct variability in performance. However, it is still
possible to experience short-term variability if you launch multiple T3 Dedicated Instances that have
correlated CPU usage patterns. For these more demanding or correlated workloads, we recommend
using M5 or M5a Dedicated Instances rather than T3 Dedicated Instances.
There are no performance, security, or physical differences between Dedicated Instances and instances
on Dedicated Hosts. However, there are some differences between the two. The following table
highlights some of the key differences between Dedicated Instances and Dedicated Hosts:
* Microsoft SQL Server with License Mobility through Software Assurance, and Windows Virtual Desktop
Access (VDA) licenses can be used with Dedicated Instance.
For more information about Dedicated Hosts, see Dedicated Hosts (p. 446).
488
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
• Some AWS services or their features are not supported with a VPC with the instance tenancy set to
dedicated. Refer to the respective service's documentation to confirm if there are any limitations.
• Some instance types can't be launched into a VPC with the instance tenancy set to dedicated. For
more information about supported instance types, see Amazon EC2 Dedicated Instances.
• When you launch a Dedicated Instance backed by Amazon EBS, the EBS volume doesn't run on single-
tenant hardware.
Topics
• Create a VPC with a dedicated instance tenancy (p. 489)
• Launch Dedicated Instances into a VPC (p. 489)
• Display tenancy information (p. 490)
• Change the tenancy of an instance (p. 491)
• Change the tenancy of a VPC (p. 491)
For more information about creating a VPC and choosing the tenancy options, see Create a VPC in the
Amazon VPC User Guide.
Console
To launch a Dedicated Instance into a default tenancy VPC using the console
489
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
5. In the Key pair section, select the key pair to associate with the instance.
6. In the Advanced details section, for Tenancy, select Dedicated.
7. Configure the remaining instance options as needed. For more information, see Launch an
instance using defined parameters (p. 541).
8. Choose Launch instance.
Command line
To set the tenancy option for an instance during launch using the command line
For more information about launching an instance with a tenancy of host, see Launch instances onto a
Dedicated Host (p. 455).
•
Choose the settings icon ( ) in the top-right corner, toggle to choose Tenancy, and choose
Confirm.
• Select the instance. On the Details tab near the bottom of the page, under Host and
placement group, check the value for Tenancy.
Command line
490
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Dedicated Instances
To describe the tenancy value of a Reserved Instance using the command line
To describe the tenancy value of a Reserved Instance offering using the command line
Console
Command line
You can modify the instance tenancy of a VPC using the AWS CLI, an AWS SDK, or the Amazon EC2 API
only.
491
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Command line
To modify the instance tenancy attribute of a VPC using the AWS CLI
Use the modify-vpc-tenancy command and specify the ID of the VPC and instance tenancy value.
The only supported value is default.
The following are some common use cases for Capacity Reservations:
• Disaster recovery — you can reserve capacity in a different Availability Zone or Region to ensure that
the capacity you need is available during a fail over event.
• Regulatory requirements — you can use Capacity Reservations to satisfy regulatory requirements for
high availability. Capacity Reservations ensure that capacity is in place to meet those requirements,
even if you aren't utilizing those resources.
• Events — you can create Capacity Reservations before your business-critical events to ensure that you
can scale when you need to.
You can create Capacity Reservations at any time, without entering into a one-year or three-year term
commitment. The capacity becomes available and billing starts as soon as the Capacity Reservation
is provisioned in your account. When you no longer need the capacity assurance, cancel the Capacity
Reservation to release the capacity and to stop incurring charges. You can also use the billing discounts
offered by Savings Plans and Regional Reserved Instances to reduce the cost of a Capacity Reservation.
Capacity Reservations can only be used by instances that match their attributes. By default, they are
automatically used by running instances that match the attributes. If you don't have any running
instances that match the attributes of the Capacity Reservation, it remains unused until you launch an
instance with matching attributes.
Contents
• Differences between Capacity Reservations, Reserved Instances, and Savings Plans (p. 493)
• Supported platforms (p. 493)
• Quotas (p. 494)
• Limitations (p. 494)
• Capacity Reservation pricing and billing (p. 494)
• Work with Capacity Reservations (p. 496)
492
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
† You can combine Capacity Reservations with Savings Plans or Regional Reserved Instances to receive a
discount.
Supported platforms
You must create the Capacity Reservation with the correct platform to ensure that it properly matches
with your instances. Capacity Reservations support the following platforms:
• Windows
• Windows with SQL Server
• Windows with SQL Server Web
493
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
When you purchase a Capacity Reservation, you must specify the platform that represents the operating
system for your instance.
• For Windows with SQL Standard, Windows with SQL Server Enterprise, and Windows with SQL Server
Web, you must choose the specific platform.
• For all other Windows versions, excluding BYOL which is not supported, choose the Windows platform.
For more information about the supported Linux platforms, see Supported platforms in the Amazon EC2
User Guide for Linux Instances.
Quotas
The number of instances for which you are allowed to reserve capacity is based on your account's On-
Demand Instance quota. You can reserve capacity for as many instances as that quota allows, minus the
number of instances that are already running.
Quotas apply to running instances only. If your instance is pending, stopping, stopped, or hibernated, it
does not count towards your quota.
Limitations
Before you create Capacity Reservations, take note of the following limitations and restrictions.
• Active and unused Capacity Reservations count toward your On-Demand Instance limits.
• Capacity Reservations are not transferable from one AWS account to another. However, you can share
Capacity Reservations with other AWS accounts. For more information, see Work with shared Capacity
Reservations (p. 512).
• Zonal Reserved Instance billing discounts do not apply to Capacity Reservations.
• Capacity Reservations can be created in cluster placement groups. Spread and partition placement
groups are not supported.
• Capacity Reservations can't be used with Dedicated Hosts. Capacity Reservations can be used with
Dedicated Instances.
• Capacity Reservations can't be used with Bring Your Own License (BYOL).
• Capacity Reservations do not ensure that a hibernated instance can resume after you try to start it.
Pricing
Capacity Reservations are charged at the equivalent On-Demand rate whether you run instances in
reserved capacity or not. If you do not use the reservation, this shows up as unused reservation on your
494
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Amazon EC2 bill. When you run an instance that matches the attributes of a reservation, you just pay for
the instance and nothing for the reservation. There are no upfront or additional charges.
For example, if you create a Capacity Reservation for 20 m4.large Linux instances and run 15
m4.large Linux instances in the same Availability Zone, you will be charged for 15 active instances and
for 5 unused instances in the reservation.
Billing discounts for Savings Plans and Regional Reserved Instances apply to Capacity Reservations. For
more information, see Billing discounts (p. 495).
Billing
Billing starts as soon as the Capacity Reservation is provisioned in your account, and it continues while
the Capacity Reservation remains provisioned in your account.
Capacity Reservations are billed at per-second granularity. This means that you are charged for partial
hours. For example, if a Capacity Reservation remains provisioned in your account for 24 hours and 15
minutes, you are billed for 24.25 reservation hours.
The following example shows how a Capacity Reservation is billed. The Capacity Reservation is created
for one m4.large Linux instance, which has an On-Demand rate of $0.10 per usage hour. In this
example, the Capacity Reservation is provisioned in the account for five hours. The Capacity Reservation
is unused for the first hour, so it is billed for one unused hour at the m4.large instance type's standard
On-Demand rate. In hours two through five, the Capacity Reservation is occupied by an m4.large
instance. During this time, the Capacity Reservation accrues no charges, and the account is instead billed
for the m4.large instance occupying it. In the sixth hour, the Capacity Reservation is canceled and the
m4.large instance runs normally outside of the reserved capacity. For that hour, it is charged at the On-
Demand rate of the m4.large instance type.
Billing discounts
Billing discounts for Savings Plans and Regional Reserved Instances apply to Capacity Reservations. AWS
automatically applies these discounts to Capacity Reservations that have matching attributes. When
a Capacity Reservation is used by an instance, the discount is applied to the instance. Discounts are
preferentially applied to instance usage before covering unused Capacity Reservations.
Billing discounts for zonal Reserved Instances do not apply to Capacity Reservations.
495
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
You can view the charges online, or you can download a CSV file. For more information, see Capacity
Reservation Line Items in the AWS Billing and Cost Management User Guide.
By default, Capacity Reservations automatically match new instances and running instances that have
matching attributes (instance type, platform, and Availability Zone). This means that any instance with
matching attributes automatically runs in the Capacity Reservation. However, you can also target a
Capacity Reservation for specific workloads. This enables you to explicitly control which instances are
allowed to run in that reserved capacity.
You can specify how the reservation ends. You can choose to cancel the Capacity Reservation or end it
automatically at a specified time. If you specify an end time, the Capacity Reservation is canceled within
an hour of the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation
is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019. After a reservation ends, you can no
longer target instances to the Capacity Reservation. Instances running in the reserved capacity continue
to run uninterrupted. If instances targeting a Capacity Reservation are stopped, you cannot restart them
until you remove their Capacity Reservation targeting preference or configure them to target a different
Capacity Reservation.
Contents
• Create a Capacity Reservation (p. 496)
• Launch instances into an existing Capacity Reservation (p. 497)
• Modify a Capacity Reservation (p. 498)
• Modify an instance's Capacity Reservation settings (p. 499)
• View a Capacity Reservation (p. 500)
• Cancel a Capacity Reservation (p. 501)
Your request to create a Capacity Reservation could fail if one of the following is true:
• Amazon EC2 does not have sufficient capacity to fulfill the request. Either try again at a later time,
try a different Availability Zone, or try a smaller capacity. If your application is flexible across instance
types and sizes, try different instance attributes.
• The requested quantity exceeds your On-Demand Instance limit for the selected instance family.
Increase your On-Demand Instance limit for the instance family and try again. For more information,
see On-Demand Instance quotas (p. 339).
496
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
match the instance type, platform, and Availability Zone that you specify here or the Capacity
Reservation is not applied. For example, if an open Capacity Reservation doesn't match, an instance
launch that targets that Capacity Reservation explicitly will fail.
• open—(Default) The Capacity Reservation matches any instance that has matching attributes
(instance type, platform, and Availability Zone). If you launch an instance with matching
attributes, it is placed into the reserved capacity automatically.
• targeted—The Capacity Reservation only accepts instances that have matching attributes
(instance type, platform, and Availability Zone), and that explicitly target the reservation.
5. Choose Request reservation.
For example, the following command creates a Capacity Reservation that reserves capacity for three
m5.2xlarge instances running Windows with SQL Server AMIs in the us-east-1a Availability Zone.
497
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Launching an instance into a Capacity Reservation reduces its available capacity by the number of
instances launched. For example, if you launch three instances, the available capacity of the Capacity
Reservation is reduced by three.
1. Open the Launch Instance wizard by choosing Launch Instances from Dashboard or Instances.
2. Select an Amazon Machine Image (AMI) and an instance type.
3. Complete the Configure Instance Details page. For Capacity Reservation, choose one of the
following options:
• None — Prevents the instances from launching into a Capacity Reservation. The instances run in
On-Demand capacity.
• Open — Launches the instances into any Capacity Reservation that has matching attributes and
sufficient capacity for the number of instances you selected. If there is no matching Capacity
Reservation with sufficient capacity, the instance uses On-Demand capacity.
• Target by ID — Launches the instances into the selected Capacity Reservation. If the selected
Capacity Reservation does not have sufficient capacity for the number of instances you selected,
the instance launch fails.
• Target by group — Launches the instances into any Capacity Reservation with matching
attributes and available capacity in the selected Capacity Reservation group. If the selected
group does not have a Capacity Reservation with matching attributes and available capacity, the
instances launch into On-Demand capacity.
4. Complete the remaining steps to launch the instances.
To launch an instance into an existing Capacity Reservation using the AWS CLI
The following example launches a t2.micro instance into any open Capacity Reservation that has
matching attributes and available capacity:
The following example launches a t2.micro instance into a targeted Capacity Reservation:
The following example launches a t2.micro instance into a Capacity Reservation group:
498
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
When modifying a Capacity Reservation, you can only increase or decrease the quantity and change the
way in which it is released. You cannot change the instance type, EBS optimization, platform, Availability
Zone, or instance eligibility of a Capacity Reservation. If you need to modify any of these attributes, we
recommend that you cancel the reservation, and then create a new one with the required attributes.
If you specify a new quantity that exceeds your remaining On-Demand Instance limit for the selected
instance type, the update fails.
For example, the following command modifies a Capacity Reservation to reserve capacity for eight
instances.
• Start in any Capacity Reservation that has matching attributes (instance type, platform, and
Availability Zone) and available capacity.
• Start the instance in a specific Capacity Reservation.
• Start in any Capacity Reservation that has matching attributes and available capacity in a Capacity
Reservation group
• Prevent the instance from starting in a Capacity Reservation.
• Open — Launches the instances into any Capacity Reservation that has matching attributes and
sufficient capacity for the number of instances you selected. If there is no matching Capacity
Reservation with sufficient capacity, the instance uses On-Demand capacity.
• None — Prevents the instances from launching into a Capacity Reservation. The instances run in
On-Demand capacity.
• Specify Capacity Reservation — Launches the instances into the selected Capacity Reservation.
If the selected Capacity Reservation does not have sufficient capacity for the number of instances
you selected, the instance launch fails.
• Specify Capacity Reservation group — Launches the instances into any Capacity Reservation
with matching attributes and available capacity in the selected Capacity Reservation group. If
the selected group does not have a Capacity Reservation with matching attributes and available
capacity, the instances launch into On-Demand capacity.
499
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
For example, the following command changes an instance's Capacity Reservation setting to open or
none.
For example, the following command modifies an instance to target a specific Capacity Reservation.
For example, the following command modifies an instance to target a specific Capacity Reservation
group.
Note
Due to the eventual consistency model followed by the Amazon EC2 APIs, after you create a
Capacity Reservation, it can take up to 5 minutes for the console and the describe-capacity-
reservations response to indicate that the Capacity Reservation is in the active state. During
this time, the console and the describe-capacity-reservations response might indicate
that the Capacity Reservation is in the pending state. However, the Capacity Reservation might
already be available for use and you can attempt to launch instances into it.
500
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Example output.
{
"CapacityReservations": [
{
"CapacityReservationId": "cr-1234abcd56EXAMPLE ",
"EndDateType": "unlimited",
"AvailabilityZone": "eu-west-1a",
"InstanceMatchCriteria": "open",
"Tags": [],
"EphemeralStorage": false,
"CreateDate": "2019-08-16T09:03:18.000Z",
"AvailableInstanceCount": 1,
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 1,
"State": "active",
"Tenancy": "default",
"EbsOptimized": true,
"InstanceType": "a1.medium",
"PlacementGroupArn": "arn:aws:ec2:us-east-1:123456789012:placement-group/MyPG"
},
{
"CapacityReservationId": "cr-abcdEXAMPLE9876ef ",
"EndDateType": "unlimited",
"AvailabilityZone": "eu-west-1a",
"InstanceMatchCriteria": "open",
"Tags": [],
"EphemeralStorage": false,
"CreateDate": "2019-08-07T11:34:19.000Z",
"AvailableInstanceCount": 3,
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 3,
"State": "cancelled",
"Tenancy": "default",
"EbsOptimized": true,
"InstanceType": "m5.large"
}
]
}
You can cancel empty Capacity Reservations and Capacity Reservations that have running instances. If
you cancel a Capacity Reservation that has running instances, the instances continue to run normally
outside of the capacity reservation at standard On-Demand Instance rates or at a discounted rate if you
have a matching Savings Plan or Regional Reserved Instance.
After you cancel a Capacity Reservation, instances that target it can no longer launch. Modify these
instances so that they either target a different Capacity Reservation, launch into any open Capacity
Reservation with matching attributes and sufficient capacity, or avoid launching into a Capacity
Reservation. For more information, see Modify an instance's Capacity Reservation settings (p. 499).
501
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
You can include Capacity Reservations that you own in your account, and Capacity Reservations that
are shared with you by other AWS accounts in a single resource group. You can also include Capacity
Reservations that have different attributes (instance type, platform, and Availability Zone) in a single
resource group.
When you create resource groups for Capacity Reservations, you can target instances to a group of
Capacity Reservations instead of an individual Capacity Reservation. Instances that target a group of
Capacity Reservations match with any Capacity Reservation in the group that has matching attributes
(instance type, platform, and Availability Zone) and available capacity. If the group does not have a
Capacity Reservation with matching attributes and available capacity, the instances run using On-
Demand capacity. If a matching Capacity Reservation is added to the targeted group at a later stage, the
instance is automatically matched with and moved into its reserved capacity.
To prevent unintended use of Capacity Reservations in a group, configure the Capacity Reservations in
the group to accept only instances that explicitly target the capacity reservation. To do this, set Instance
eligibility to targeted (old console) or Only instances that specify this reservation (new console) when
creating the Capacity Reservation using the Amazon EC2 console. When using the AWS CLI, specify --
instance-match-criteria targeted when creating the Capacity Reservation. Doing this ensures
that only instances that explicitly target the group, or a Capacity Reservation in the group, can run in the
group.
If a Capacity Reservation in a group is canceled or expires while it has running instances, the instances
are automatically moved to another Capacity Reservation in the group that has matching attributes
and available capacity. If there are no remaining Capacity Reservations in the group that have matching
attributes and available capacity, the instances run in On-Demand capacity. If a matching Capacity
Reservation is added to the targeted group at a later stage, the instance is automatically moved into its
reserved capacity.
Topics
• Create a Capacity Reservation group (p. 503)
• Add a Capacity Reservation to a group (p. 503)
• View Capacity Reservations in a group (p. 504)
• View the groups to which a Capacity Reservation belongs (p. 504)
• Remove a Capacity Reservation from a group (p. 505)
502
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Use the create-group AWS CLI command. For name, provide a descriptive name for the group, and for
configuration, specify two Type request parameters:
{
"GroupConfiguration": {
"Status": "UPDATE_COMPLETE",
"Configuration": [
{
"Type": "AWS::EC2::CapacityReservationPool"
},
{
"Type": "AWS::ResourceGroups::Generic",
"Parameters": [
{
"Values": [
"AWS::EC2::CapacityReservation"
],
"Name": "allowed-resource-types"
}
]
}
]
},
"Group": {
"GroupArn": "arn:aws:resource-groups:sa-east-1:123456789012:group/MyCRGroup",
"Name": "MyCRGroup"
}
}
Use the group-resources AWS CLI command. For group, specify the name of the group to which to add
the Capacity Reservations, and for resources, specify ARNs of the Capacity Reservations to add. To
503
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
add multiple Capacity Reservations, separate the ARNs with a space. To get the ARNs of the Capacity
Reservations to add, use the describe-capacity-reservations AWS CLI command and specify the IDs of
the Capacity Reservations.
For example, the following command adds two Capacity Reservations to a group named MyCRGroup.
{
"Failed": [],
"Succeeded": [
"arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/cr-1234567890abcdef1",
"arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/cr-54321abcdef567890"
]
}
Use the list-group-resources AWS CLI command. For group, specify the name of the group.
For example, the following command lists the Capacity Reservations in a group named MyCRGroup.
{
"QueryErrors": [],
"ResourceIdentifiers": [
{
"ResourceType": "AWS::EC2::CapacityReservation",
"ResourceArn": "arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/
cr-1234567890abcdef1"
},
{
"ResourceType": "AWS::EC2::CapacityReservation",
"ResourceArn": "arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/
cr-54321abcdef567890"
}
]
}
Note
The command output includes Capacity Reservations that you own and Capacity Reservations
that are shared with you.
To view the groups to which a specific Capacity Reservation has been added
504
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
For example, the following command lists the groups to which Capacity Reservation
cr-1234567890abcdef1 has been added.
{
"CapacityReservationGroups": [
{
"OwnerId": "123456789012",
"GroupArn": "arn:aws:resource-groups:sa-east-1:123456789012:group/
MyCRGroup"
}
]
}
Note
If you specify a Capacity Reservation that is shared with you, the command returns only
Capacity Reservation groups that you own.
Amazon EC2 console
To view the groups to which a specific Capacity Reservation has been added
The groups to which the Capacity Reservation has been added are listed in the Groups card.
Note
If you choose a Capacity Reservation that is shared with you, the console displays only
Capacity Reservation groups that you own.
Use the ungroup-resources AWS CLI command. For group, specify the ARN of the group from which to
remove the Capacity Reservation, and for resources specify the ARNs of the Capacity Reservations to
remove. To remove multiple Capacity Reservations, separate the ARNs with a space.
The following example removes two Capacity Reservations from a group named MyCRGroup.
{
"Failed": [],
"Succeeded": [
"arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/cr-0e154d26a16094dd",
505
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
"arn:aws:ec2:sa-east-1:123456789012:capacity-reservation/cr-54321abcdef567890"
]
}
Use the delete-group AWS CLI command. For group, provide the name of the group to delete.
{
"Group": {
"GroupArn": "arn:aws:resource-groups:sa-east-1:123456789012:group/MyCRGroup",
"Name": "MyCRGroup"
}
}
Creating a Capacity Reservation in a cluster placement group ensures that you have access to compute
capacity in your cluster placement groups when you need it, for as long as you need it. This is ideal for
reserving capacity for high-performance (HPC) workloads that require compute scaling. It allows you to
scale your cluster down while ensuring that the capacity remains available for your use so that you can
scale back up when needed.
Topics
• Limitations (p. 506)
• Work with Capacity Reservations in cluster placement groups (p. 507)
Limitations
Keep the following in mind when creating Capacity Reservations in cluster placement groups:
• You can't modify an existing Capacity Reservation that is not in a placement group to reserve capacity
in a placement group. To reserve capacity in a placement group, you must create the Capacity
Reservation in the placement group.
• After you create a Capacity Reservation in a placement group, you can't modify it to reserve capacity
outside of the placement group.
• You can increase your reserved capacity in a placement group by modifying an existing Capacity
Reservation in the placement group, or by creating additional Capacity Reservations in the placement
group. However, you increase your chances of getting an insufficient capacity error.
• You can't share Capacity Reservations that have been created in a cluster placement group.
• You can't delete a cluster placement group that has active Capacity Reservations. You must cancel all
Capacity Reservations in the cluster placement group before you can delete it.
506
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Topics
• Step 1: (Conditional) Create a cluster placement group for use with a Capacity Reservation (p. 507)
• Step 2: Create a Capacity Reservation in a cluster placement group (p. 508)
• Step 3: Launch instances into the cluster placement group (p. 509)
Step 1: (Conditional) Create a cluster placement group for use with a Capacity Reservation
Perform this step only if you need to create a new cluster placement group. To use an existing cluster
placement group, skip this step and then for Steps 2 and 3, use the ARN of that cluster placement group.
For more information about how to find the ARN of your existing cluster placement group, see describe-
placement-groups.
You can create the cluster placement group using one of the following methods.
Console
Make a note of the placement group ARN returned in the command output, because you'll need
it for the next step.
AWS CLI
Use the create-placement-group command. For --group-name, specify a descriptive name for the
placement group, and for --strategy, specify cluster.
The following example creates a placement group named MyPG that uses the cluster placement
strategy.
507
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Make a note of the placement group ARN returned in the command output, because you'll need it
for the next step.
Considerations
• The specified cluster placement group must be in the available state. If the cluster placement group
is in the pending, deleting, or deleted state, the request fails.
• The Capacity Reservation and the cluster placement group must be in the same Availability Zone. If
the request to create the Capacity Reservation specifies an Availability Zone that is different from that
of the cluster placement group, the request fails.
• You can create Capacity Reservations only for instance types that are supported by cluster placement
groups. If you specify an unsupported instance type, the request fails. For more information, see
Cluster placement group rules and limitations (p. 1306).
• If you create an open Capacity Reservation in a cluster placement group and there are existing running
instances that have matching attributes (placement group ARN, instance type, Availability Zone,
platform, and tenancy), those instances automatically run in the Capacity Reservation.
• Your request to create a Capacity Reservation could fail if one of the following is true:
• Amazon EC2 does not have sufficient capacity to fulfill the request. Either try again at a later time,
try a different Availability Zone, or try a smaller capacity. If your workload is flexible across instance
types and sizes, try different instance attributes.
• The requested quantity exceeds your On-Demand Instance limit for the selected instance family.
Increase your On-Demand Instance limit for the instance family and try again. For more information,
see On-Demand Instance quotas (p. 339).
You can create the Capacity Reservation in the cluster placement group using one of the following
methods.
Console
508
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
--instance-type instance_type \
--instance-platform platform \
--availability-zone az \
--instance-count quantity \
--placement-group-arn placement_group_ARN
You launch an instance into a Capacity Reservation in a cluster placement group in the same way that
you launch an instance into any Capacity Reservation. However, you must also specify the ARN of the
cluster placement group in which to launch the instance. For more information, see Create a Capacity
Reservation (p. 497).
Considerations
• If the Capacity Reservation is open, you do not need to specify the Capacity Reservation in the
instance launch request. If the instance has attributes (placement group ARN, instance type,
Availability Zone, platform, and tenancy) that match a Capacity Reservation in the specified placement
group, the instance automatically runs in the Capacity Reservation.
• If the Capacity Reservation accepts only targeted instance launches, you must specify the target
Capacity Reservation in addition to the cluster placement group in the request.
• If the Capacity Reservation is in a Capacity Reservation group, you must specify the target Capacity
Reservation group in addition to the cluster placement group in the request. For more information, see
Work with Capacity Reservation groups (p. 502).
You can launch an instance into a Capacity Reservation in a cluster placement group using one of the
following methods.
Console
1. Open the Launch Instance wizard by choosing Launch Instances from the Dashboard or from
the Instances screen.
2. Select an Amazon Machine Image (AMI) and an instance type.
3. Complete the Configure Instance Details page:
a. For Placement group, select Add instance to placement group, choose Add to existing
placement group, and then select the cluster placement group in which to launch the
instance.
b. For Capacity Reservation, choose one of the following options depending on the
configuration of the Capacity Reservation:
• Open — To launch the instances into any open Capacity Reservation in the cluster
placement group that has matching attributes and sufficient capacity.
• Target by ID — To launch the instances into a Capacity Reservation that accepts only
targeted instance launches.
• Target by group — To launch the instances into any Capacity Reservation with matching
attributes and available capacity in the selected Capacity Reservation group.
4. Complete the remaining steps to launch the instances.
For more information, see Launch instances into an existing Capacity Reservation (p. 497).
509
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
AWS CLI
To launch instances into an existing Capacity Reservation using the AWS CLI
Use the run-instances command. If you need to target a specific Capacity Reservation or a Capacity
Reservation group, specify the --capacity-reservation-specification parameter. For --
placement, specify the GroupName parameter and then specify the name of the placement group
that you created in the previous steps.
The following command launches an instance into a targeted Capacity Reservation in a cluster
placement group.
For more information, see Launch instances into an existing Capacity Reservation (p. 497).
You can extend a VPC from its parent AWS Region into a Local Zone by creating a new subnet in that
Local Zone. When you create a subnet in a Local Zone, your VPC is extended to that Local Zone. The
subnet in the Local Zone operates the same as the other subnets in your VPC.
By using Local Zones, you can place Capacity Reservations in multiple locations that are closer to your
users. You create and use Capacity Reservations in Local Zones in the same way that you create and use
Capacity Reservations in regular Availability Zones. The same features and instance matching behavior
apply. For more information about the pricing models that are supported in Local Zones, see AWS Local
Zones FAQs.
Considerations
1. Enable the Local Zone for use in your AWS account. For more information, see Opt in to Local
Zones (p. 1185).
2. Create a Capacity Reservation in the Local Zone. For Availability Zone, choose the Local Zone.
The Local Zone is represented by an AWS Region code followed by an identifier that indicates
the location, for example us-west-2-lax-1a. For more information, see Create a Capacity
Reservation (p. 496).
3. Create a subnet in the Local Zone. For Availability Zone, choose the Local Zone. For more
information, see Create a subnet in your VPC in the Amazon VPC User Guide.
4. Launch an instance. For Subnet, choose the subnet in the Local Zone (for example subnet-123abc
| us-west-2-lax-1a), and for Capacity Reservation, choose the specification (either open or
target it by ID) that's required for the Capacity Reservation that you created in the Local Zone. For
more information, see Launch instances into an existing Capacity Reservation (p. 497).
510
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
When you create On-Demand Capacity Reservations, you can choose the Wavelength Zone and you can
launch instances into a Capacity Reservation in a Wavelength Zone by specifying the subnet associated
with the Wavelength Zone. A Wavelength Zone is represented by an AWS Region code followed by an
identifier that indicates the location, for example us-east-1-wl1-bos-wlz-1.
Wavelength Zones are not available in every Region. For information about the Regions that support
Wavelength Zones, see Available Wavelength Zones in the AWS Wavelength Developer Guide.
Considerations
1. Enable the Wavelength Zone for use in your AWS account. For more information, see Enable
Wavelength Zones in the Amazon EC2 User Guide for Linux Instances.
2. Create a Capacity Reservation in the Wavelength Zone. For Availability Zone, choose the
Wavelength. The Wavelength is represented by an AWS Region code followed by an identifier that
indicates the location, for example us-east-1-wl1-bos-wlz-1. For more information, see Create
a Capacity Reservation (p. 496).
3. Create a subnet in the Wavelength Zone. For Availability Zone, choose the Wavelength Zone. For
more information, see Create a subnet in your VPC in the Amazon VPC User Guide.
4. Launch an instance. For Subnet, choose the subnet in the Wavelength Zone (for example
subnet-123abc | us-east-1-wl1-bos-wlz-1), and for Capacity Reservation, choose the
specification (either open or target it by ID) that's required for the Capacity Reservation that you
created in the Wavelength. For more information, see Launch instances into an existing Capacity
Reservation (p. 497).
An Outpost is a pool of AWS compute and storage capacity deployed at a customer site. AWS operates,
monitors, and manages this capacity as part of an AWS Region.
You can create Capacity Reservations on Outposts that you have created in your account. This allows you
to reserve compute capacity on an Outpost at your site. You create and use Capacity Reservations on
Outposts in the same way that you create and use Capacity Reservations in regular Availability Zones.
The same features and instance matching behavior apply.
You can also share Capacity Reservations on Outposts with other AWS accounts within your organization
using AWS Resource Access Manager. For more information about sharing Capacity Reservations, see
Work with shared Capacity Reservations (p. 512).
511
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Prerequisite
You must have an Outpost installed at your site. For more information, see Create an Outpost and order
Outpost capacity in the AWS Outposts User Guide.
Considerations
1. Create a subnet on the Outpost. For more information, see Create a subnet in the AWS Outposts User
Guide.
2. Create a Capacity Reservation on the Outpost.
In this model, the AWS account that owns the Capacity Reservation (owner) shares it with other AWS
accounts (consumers). Consumers can launch instances into Capacity Reservations that are shared with
them in the same way that they launch instances into Capacity Reservations that they own in their own
account. The Capacity Reservation owner is responsible for managing the Capacity Reservation and the
instances that they launch into it. Owners cannot modify instances that consumers launch into Capacity
Reservations that they have shared. Consumers are responsible for managing the instances that they
launch into Capacity Reservations shared with them. Consumers cannot view or modify instances owned
by other consumers or by the Capacity Reservation owner.
Contents
• Prerequisites for sharing Capacity Reservations (p. 513)
• Related services (p. 513)
• Share across Availability Zones (p. 513)
512
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Related services
Capacity Reservation sharing integrates with AWS Resource Access Manager (AWS RAM). AWS RAM
is a service that enables you to share your AWS resources with any AWS account or through AWS
Organizations. With AWS RAM, you share resources that you own by creating a resource share. A resource
share specifies the resources to share, and the consumers with whom to share them. Consumers can be
individual AWS accounts, or organizational units or an entire organization from AWS Organizations.
For more information about AWS RAM, see the AWS RAM User Guide.
To identify the location of your Capacity Reservations relative to your accounts, you must use the
Availability Zone ID (AZ ID). The AZ ID is a unique and consistent identifier for an Availability Zone across
all AWS accounts. For example, use1-az1 is an AZ ID for the us-east-1 Region and it is the same
location in every AWS account.
513
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
• If consumers have running instances that match the attributes of the Capacity Reservation, have the
CapacityReservationPreference parameter set to open, and are not yet running in reserved
capacity, they automatically use the shared Capacity Reservation.
• If consumers launch instances that have matching attributes (instance type, platform, and Availability
Zone) and have the CapacityReservationPreference parameter set to open, they automatically
launch into the shared Capacity Reservation.
To share a Capacity Reservation, you must add it to a resource share. A resource share is an AWS RAM
resource that lets you share your resources across AWS accounts. A resource share specifies the resources
to share, and the consumers with whom they are shared. When you share a Capacity Reservation using
the Amazon EC2 console, you add it to an existing resource share. To add the Capacity Reservation to a
new resource share, you must create the resource share using the AWS RAM console.
If you are part of an organization in AWS Organizations and sharing within your organization is enabled,
consumers in your organization are granted access to the shared Capacity Reservation if the prequisites
for sharing (p. 513) are met. If the Capacity Reservation is shared with external accounts, they receive
an invitation to join the resource share and are granted access to the shared Capacity Reservation after
accepting the invitation.
Important
Before launching instances into a Capacity Reservation that is shared with you, verify that you
have access to the shared Capacity Reservation by viewing it in the console or by describing
it using the describe-capacity-reservations AWS CLI command. If you can view the shared
Capacity Reservation in the console or describe it using the AWS CLI, it is available for your
use and you can launch instances into it. If you attempt to launch instances into the Capacity
Reservation and it is not accessible due to a sharing failure, the instances will launch into On-
Demand capacity.
You can share a Capacity Reservation that you own using the Amazon EC2 console, AWS RAM console, or
the AWS CLI.
To share a Capacity Reservation that you own using the Amazon EC2 console
It could take a few minutes for consumers to get access to the shared Capacity Reservation.
To share a Capacity Reservation that you own using the AWS RAM console
To share a Capacity Reservation that you own using the AWS CLI
• Instances owned by consumers that were running in the shared capacity at the time sharing stops
continue to run normally outside of the reserved capacity, and the capacity is restored to the Capacity
Reservation subject to Amazon EC2 capacity availability.
514
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
• Consumers with whom the Capacity Reservation was shared can no longer launch new instances into
the reserved capacity.
To stop sharing a Capacity Reservation that you own, you must remove it from the resource share. You
can do this using the Amazon EC2 console, AWS RAM console, or the AWS CLI.
To stop sharing a Capacity Reservation that you own using the Amazon EC2 console
To stop sharing a Capacity Reservation that you own using the AWS RAM console
To stop sharing a Capacity Reservation that you own using the AWS CLI
Owners and consumers can identify and view shared Capacity Reservations using the Amazon EC2
console and AWS CLI.
Use the describe-capacity-reservations command. The command returns the Capacity Reservations that
you own and Capacity Reservations that are shared with you. OwnerId shows the AWS account ID of the
Capacity Reservation owner.
515
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
The AWS account ID column shows the account IDs of the consumers currently using the Capacity
Reservation. The Launched instances column shows the number of instances each consumer
currently has running in the reserved capacity.
Use the get-capacity-reservation-usage command. AccountId shows the account ID of the account
using the Capacity Reservation. UsedInstanceCount shows the number of instances the consumer
currently has running in the reserved capacity.
The Capacity Reservation owner is billed for instances that they run inside the Capacity Reservation
and for unused reserved capacity. Consumers are billed for the instances that they run inside the shared
Capacity Reservation.
If the Capacity Reservation owner belongs to a different payer account and the Capacity Reservation is
covered by a Regional Reserved Instance or a Savings Plan, the Capacity Reservation owner continues
to be billed for the Regional Reserved Instance or Savings Plan. In these cases, the Capacity Reservation
owner pays for the Regional Reserved Instance or Savings Plan, and consumers are billed for the
instances that the run in the shared Capacity Reservation.
Instance limits
All Capacity Reservation usage counts toward the Capacity Reservation owner's On-Demand Instance
limits. This includes:
Instances launched into the shared capacity by consumers count towards the Capacity Reservation
owner's On-Demand Instance limit. Consumers' instance limits are a sum of their own On-Demand
Instance limits and the capacity available in the shared Capacity Reservations to which they have access.
516
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
A Capacity Reservation Fleet request contains all of the configuration information that's needed to
launch a Capacity Reservation Fleet. Using a single request, you can reserve large amounts of Amazon
EC2 capacity for your workload across multiple instance types, up to a target capacity that you specify.
After you create a Capacity Reservation Fleet, you can manage the Capacity Reservations in the fleet
collectively by modifying or canceling the Capacity Reservation Fleet.
Topics
• How Capacity Reservation Fleets work (p. 167)
• Considerations (p. 330)
• Pricing (p. 518)
• Capacity Reservation Fleet concepts (p. 518)
• Work with Capacity Reservation Fleets (p. 519)
• Example Capacity Reservation Fleet configurations (p. 525)
• Using service-linked roles for Capacity Reservation Fleet (p. 526)
The number of instances for which the Fleet reserves capacity depends on the total target
capacity (p. 518) and the instance type weights (p. 519) that you specify. The instance type for which it
reserves capacity depends on the allocation strategy (p. 518) and instance type priorities (p. 519) that
you use.
If there is insufficient capacity at the time the Fleet is created, and it is unable to immediately meet its
total target capacity, the Fleet asynchronously attempts to create Capacity Reservations until it has
reserved the requested amount of capacity.
When the Fleet reaches its total target capacity, it attempts to maintain that capacity. If a Capacity
Reservation in the Fleet is cancelled, the Fleet automatically creates one or more Capacity Reservations,
depending on your Fleet configuration, to replace the lost capacity and to maintain its total target
capacity.
The Capacity Reservations in the Fleet can't be managed individually. They must be managed
collectively by modifying the Fleet. When you modify a Fleet, the Capacity Reservations in the Fleet are
automatically updated to reflect the changes.
Currently, Capacity Reservation Fleets support the open instance matching criteria, and all Capacity
Reservations launched by a Fleet automatically use this instance matching criteria. With this criteria, new
instances and existing instances that have matching attributes (instance type, platform, and Availability
Zone) automatically run in the Capacity Reservations created by a Fleet. Capacity Reservation Fleets do
not support target instance matching criteria.
Considerations
Keep the following in mind when working with Capacity Reservation Fleets:
• A Capacity Reservation Fleet can be created, modified, viewed, and cancelled using the AWS CLI and
AWS API.
• The Capacity Reservations in a Fleet can't be managed individually. They must be managed collectively
by modifying or cancelling the Fleet.
• A Capacity Reservation Fleet can't span across Regions.
• A Capacity Reservation Fleet can't span across Availability Zones.
517
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
• Capacity Reservations created by a Capacity Reservation Fleet are automatically tagged with the
following AWS generated tag:
• Key — aws:ec2-capacity-reservation-fleet
• Value — fleet_id
You can use this tag to identify Capacity Reservations that were created by a Capacity Reservation
Fleet.
Pricing
There are no additional charges for using Capacity Reservation Fleets. You are billed for the individual
Capacity Reservations that are created by your Capacity Reservation Fleets. For more information about
how Capacity Reservations are billed, see Capacity Reservation pricing and billing (p. 494).
Topics
• Total target capacity (p. 518)
• Allocation strategy (p. 518)
• Instance type weight (p. 519)
• Instance type priority (p. 519)
The total target capacity defines the total amount of compute capacity that the Capacity Reservation
Fleet reserves. You specify the total target capacity when you create the Capacity Reservation Fleet.
After the Fleet has been created, Amazon EC2 automatically creates Capacity Reservations to reserve
capacity up to the total target capacity.
The number of instances for which the Capacity Reservation Fleet reserves capacity is determined by the
total target capacity and the instance type weight that you specify for each instance type in the Capacity
Reservation Fleet (total target capacity/instance type weight=number of instances).
You can assign a total target capacity based on units that are meaningful to your workload. For example,
if your workload requires a certain number of vCPUs, you can assign the total target capacity based on
the number of vCPUs required. If your workload requires 2048 vCPUs, specify a total target capacity of
2048 and then assign instance type weights based on the number of vCPUs provided by the instance
types in the Fleet. For an example, see Instance type weight (p. 519).
Allocation strategy
The allocation strategy for your Capacity Reservation Fleet determines how it fulfills your request for
reserved capacity from the instance type specifications in the Capacity Reservation Fleet configuration.
Currently, only the prioritized allocation strategy is supported. With this strategy, the Capacity
Reservation Fleet creates Capacity Reservations using the priorities that you have assigned to each of
the instance type specifications in the Capacity Reservation Fleet configuration. Lower priority values
indicate higher priority for use. For example, say you create a Capacity Reservation Fleet that uses the
following instance types and priorities:
• m4.16xlarge — priority = 1
• m5.16xlarge — priority = 3
• m5.24xlarge — priority = 2
518
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
The Fleet first attempts to create Capacity Reservations for m4.16xlarge. If Amazon EC2 has
insufficient m4.16xlarge capacity, the Fleet attempts to create Capacity Reservations for
m5.24xlarge. If Amazon EC2 has insufficient m5.24xlarge capacity, the Fleet creates Capacity
Reservations for m5.16xlarge.
You can assign weights based on units that are meaningful to your workload. For example, if your
workload requires a certain number of vCPUs, you can assign weights based on the number of vCPUs
provided by each instance type in the Capacity Reservation Fleet. In this case, if you create a Capacity
Reservation Fleet using m4.16xlarge and m5.24xlarge instances, you would assign weights that
correspond to the number of vCPUs for each instance as follows:
The instance type weight determines the number of instances for which the Capacity Reservation
Fleet reserves capacity. For example, if a Capacity Reservation Fleet with a total target capacity of 384
units uses the instance types and weights in the preceding example, the Fleet could reserve capacity
for 6 m4.16xlarge instances (384 total target capacity/64 instance type weight=6 instances), or 4
m5.24xlarge instances (384 / 96 = 4).
If you do not assign instance type weights, or if you assign an instance type weight of 1, the total
target capacity is based purely on instance count. For example, if a Capacity Reservation Fleet with
a total target capacity of 384 units uses the instance types in the preceding example, but omits the
weights or specifies a weight of 1 for both instance types, the Fleet could reserve capacity for either 384
m4.16xlarge instances or 384 m5.24xlarge instances.
Topics
• Before you begin (p. 519)
• Capacity Reservation Fleet states (p. 520)
• Create a Capacity Reservation Fleet (p. 520)
• View a Capacity Reservation Fleet (p. 522)
• Modify a Capacity Reservation Fleet (p. 523)
• Cancel a Capacity Reservation Fleet (p. 524)
519
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
3. Assign each instance type a priority based on your needs and preferences. For more information, see
Instance type priority (p. 519).
4. Create a capacity weighting system that makes sense for your workload. Assign a weight to each
instance type and determine your total target capacity. For more information, see Instance type
weight (p. 519) and Total target capacity (p. 518).
5. Determine whether you need the Capacity Reservation indefinitely or only for a specific period of
time.
• submitted — The Capacity Reservation Fleet request has been submitted and Amazon EC2 is
preparing to create the Capacity Reservations.
• modifying — The Capacity Reservation Fleet is being modified. The Fleet remains in this state until
the modification is complete.
• active — The Capacity Reservation Fleet has fulfilled its total target capacity and it is attempting to
maintain this capacity. The Fleet remains in this state until it is modified or deleted.
• partially_fulfilled — The Capacity Reservation Fleet has partially fulfilled its total target
capacity. There is insufficient Amazon EC2 capacity to fulfill the total target capacity. The Fleet is
attempting to asynchronously fulfill its total target capacity.
• expiring — The Capacity Reservation Fleet has reached its end date and it is in the process of
expiring. One or more of its Capacity Reservations might still be active.
• expired — The Capacity Reservation Fleet has reached its end date. The Fleet and its Capacity
Reservations are expired. The Fleet can't create new Capacity Reservations.
• cancelling — The Capacity Reservation Fleet is in the process of being cancelled. One or more of its
Capacity Reservations might still be active.
• cancelled — The Capacity Reservation Fleet has been manually cancelled. The Fleet and its Capacity
Reservations are cancelled and the Fleet can't create new Capacity Reservations.
• failed — The Capacity Reservation Fleet failed to reserve capacity for the specified instance types.
When you create a Capacity Reservation Fleet it automatically creates Capacity Reservations for the
instance types specified in the Fleet request, up to the specified total target capacity. The number of
instances for which the Capacity Reservation Fleet reserves capacity depends on the total target capacity
and instance type weights that you specify in the request. For more information, see Instance type
weight (p. 519) and Total target capacity (p. 518).
When you create the Fleet, you must specify the instance types to use and a priority for each of
those instance types. For more information, see Allocation strategy (p. 518) and Instance type
priority (p. 519).
Note
The AWSServiceRoleForEC2CapacityReservationFleet service-linked role is automatically
created in your account the first time that you create a Capacity Reservation Fleet. For more
information, see Using service-linked roles for Capacity Reservation Fleet (p. 526).
Currently, Capacity Reservation Fleets support the open instance matching criteria only.
You can create a Capacity Reservation Fleet using the command line only.
520
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
{
"InstanceType": "instance_type",
"InstancePlatform":"platform",
"Weight": instance_type_weight
"AvailabilityZone":"availability_zone",
"AvailabilityZoneId" : "az_id",
"EbsOptimized": true|false,
"Priority" : instance_type_priority
}
Expected output.
{
"Status": "status",
"TotalFulfilledCapacity": fulfilled_capacity,
"CapacityReservationFleetId": "cr_fleet_id",
"TotalTargetCapacity": capacity_units
}
Example
instanceTypeSpecification.json
[
{
"InstanceType": "m5.xlarge",
"InstancePlatform": "Linux/UNIX",
"Weight": 3.0,
"AvailabilityZone":"us-east-1a",
"EbsOptimized": true,
"Priority" : 1
}
]
Example output.
{
"Status": "submitted",
"TotalFulfilledCapacity": 0.0,
"CapacityReservationFleetId": "crf-abcdef01234567890",
"TotalTargetCapacity": 24
521
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
You can view configuration and capacity information for a Capacity Reservation Fleet at any time.
Viewing a Fleet also provides details about the individual Capacity Reservations that are inside the Fleet.
You can view a Capacity Reservation Fleet using the command line only.
Expected output
{
"CapacityReservationFleets": [
{
"Status": "status",
"EndDate": "yyyy-mm-ddThh:mm:ss.000Z",
"InstanceMatchCriteria": "open",
"Tags": [],
"CapacityReservationFleetId": "cr_fleet_id",
"Tenancy": "dedicated|default",
"InstanceTypeSpecifications": [
{
"CapacityReservationId": "cr1_id",
"AvailabilityZone": "cr1_availability_zone",
"FulfilledCapacity": cr1_used_capacity,
"Weight": cr1_instance_type_weight,
"CreateDate": "yyyy-mm-ddThh:mm:ss.000Z",
"InstancePlatform": "cr1_platform",
"TotalInstanceCount": cr1_number of instances,
"Priority": cr1_instance_type_priority,
"EbsOptimized": true|false,
"InstanceType": "cr1_instance_type"
},
{
"CapacityReservationId": "cr2_id",
"AvailabilityZone": "cr2_availability_zone",
"FulfilledCapacity": cr2_used_capacity,
"Weight": cr2_instance_type_weight,
"CreateDate": "yyyy-mm-ddThh:mm:ss.000Z",
"InstancePlatform": "cr2_platform",
"TotalInstanceCount": cr2_number of instances,
"Priority": cr2_instance_type_priority,
"EbsOptimized": true|false,
"InstanceType": "cr2_instance_type"
},
],
"TotalTargetCapacity": total_target_capacity,
"TotalFulfilledCapacity": total_target_capacity,
"CreateTime": "yyyy-mm-ddThh:mm:ss.000Z",
"AllocationStrategy": "prioritized"
}
]
}
Example
522
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Example output
{
"CapacityReservationFleets": [
{
"Status": "active",
"EndDate": "2021-12-31T23:59:59.000Z",
"InstanceMatchCriteria": "open",
"Tags": [],
"CapacityReservationFleetId": "crf-abcdef01234567890",
"Tenancy": "default",
"InstanceTypeSpecifications": [
{
"CapacityReservationId": "cr-1234567890abcdef0",
"AvailabilityZone": "us-east-1a",
"FulfilledCapacity": 5.0,
"Weight": 1.0,
"CreateDate": "2021-07-02T08:34:33.398Z",
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 5,
"Priority": 1,
"EbsOptimized": true,
"InstanceType": "m5.xlarge"
}
],
"TotalTargetCapacity": 5,
"TotalFulfilledCapacity": 5.0,
"CreateTime": "2021-07-02T08:34:33.397Z",
"AllocationStrategy": "prioritized"
}
]
}
After you modify a Fleet, its status transitions to modifying. You can't attempt additional modifications
to a Fleet while it is in the modifying state.
You can't modify the tenancy, Availability Zone, instance types, instance platforms, priorities, or weights
used by a Capacity Reservation Fleet. If you need to change any of these parameters, you might need to
cancel the existing Fleet and create a new one with the required parameters.
You can modify a Capacity Reservation Fleet using the command line only.
523
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
--total-target-capacity capacity_units \
--end-date yyyy-mm-ddThh:mm:ss.000Z \
--remove-end-date
Expected output
{
"Return": true
}
Example output
{
"Return": true
}
You can cancel a Capacity Reservation Fleet using the command line only.
Expected output
{
"SuccessfulFleetCancellations": [
{
"CurrentFleetState": "state",
"PreviousFleetState": "state",
524
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
"CapacityReservationFleetId": "cr_fleet_id_1"
},
{
"CurrentFleetState": "state",
"PreviousFleetState": "state",
"CapacityReservationFleetId": "cr_fleet_id_2"
}
],
"FailedFleetCancellations": [
{
"CapacityReservationFleetId": "cr_fleet_id_3",
"CancelCapacityReservationFleetError": [
{
"Code": "code",
"Message": "message"
}
]
}
]
}
Example output
{
"SuccessfulFleetCancellations": [
{
"CurrentFleetState": "cancelling",
"PreviousFleetState": "active",
"CapacityReservationFleetId": "crf-abcdef01234567890"
}
],
"FailedFleetCancellations": []
}
The following example creates a Capacity Reservation Fleet that uses two instance types: m5.4xlarge
and m5.12xlarge.
It uses a weighting system based on the number of vCPUs provided by the specified instance types. The
total target capacity is 480 vCPUs. The m5.4xlarge provides 16 vCPUs and gets a weight of 16, while
the m5.12xlarge provides 48 vCPUs and gets a weight of 48. This weighting system configures the
Capacity Reservation Fleet to reserve capacity for either 30 m5.4xlarge instances (480/16=30), or 10
m5.12xlarge instances (480/48=10).
The Fleet is configured to prioritize the m5.12xlarge capacity and gets priority of 1, while the
m5.4xlarge gets a lower priority of 2. This means that the fleet will attempt to reserve the
m5.12xlarge capacity first, and only attempt to reserve the m5.4xlarge capacity if Amazon EC2 has
insufficient m5.12xlarge capacity.
525
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
The Fleet reserves the capacity for Windows instances and the reservation automatically expires on
October 31, 2021 at 23:59:59 UTC.
[
{
"InstanceType": "m5.4xlarge",
"InstancePlatform":"Windows",
"Weight": 16,
"AvailabilityZone":"us-east-1a",
"EbsOptimized": true,
"Priority" : 2
},
{
"InstanceType": "m5.12xlarge",
"InstancePlatform":"Windows",
"Weight": 48,
"AvailabilityZone":"us-east-1a",
"EbsOptimized": true,
"Priority" : 1
}
]
A service-linked role makes setting up Capacity Reservation Fleet easier because you don’t have to
manually add the necessary permissions. Capacity Reservation Fleet defines the permissions of its
service-linked roles, and unless defined otherwise, only Capacity Reservation Fleet can assume its roles.
The defined permissions include the trust policy and the permissions policy, and that permissions policy
cannot be attached to any other IAM entity.
You can delete a service-linked role only after first deleting their related resources. This protects your
Capacity Reservation Fleet resources because you can't inadvertently remove permission to access the
resources.
The role uses the AWSEC2CapacityReservationFleetRolePolicy policy, which includes the following
permissions:
526
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeCapacityReservations",
"ec2:DescribeInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateCapacityReservation",
"ec2:CancelCapacityReservation",
"ec2:ModifyCapacityReservation"
],
"Resource": [
"arn:aws:ec2:*:*:capacity-reservation/*"
],
"Condition": {
"StringLike": {
"ec2:CapacityReservationFleet": "arn:aws:ec2:*:*:capacity-reservation-
fleet/crf-*"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": [
"arn:aws:ec2:*:*:capacity-reservation/*"
],
"Condition": {
"StringEquals": {
"ec2:CreateAction": "CreateCapacityReservation"
}
}
}
]
}
You must configure permissions to allow an IAM entity (such as a user, group, or role) to create, edit, or
delete a service-linked role. For more information, see Service-Linked Role Permissions in the IAM User
Guide.
You don't need to manually create a service-linked role. When you create a Capacity Reservation
Fleet using the create-capacity-reservation-fleet AWS CLI command or the
CreateCapacityReservationFleet API, the service-linked role is automatically created for you.
If you delete this service-linked role, and then need to create it again, you can use the same process to
recreate the role in your account. When you create a Capacity Reservation Fleet, Capacity Reservation
Fleet creates the service-linked role for you again.
527
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
role, you cannot change the name of the role because various entities might reference the role. However,
you can edit the description of the role using IAM. For more information, see Editing a Service-Linked
Role in the IAM User Guide.
If you no longer need to use a feature or service that requires a service-linked role, we recommend
that you delete that role. That way you don’t have an unused entity that is not actively monitored or
maintained. However, you must delete the resources for your service-linked role before you can manually
delete it.
Note
If the Capacity Reservation Fleet service is using the role when you try to delete the resources,
then the deletion might fail. If that happens, wait for a few minutes and try the operation again.
Capacity Reservation Fleet supports using service-linked roles in all of the Regions where the service is
available. For more information, see AWS Regions and Endpoints.
Topics
• Monitor Capacity Reservations using CloudWatch metrics (p. 528)
• Monitor Capacity Reservations using EventBridge (p. 530)
• Utilization notifications (p. 532)
On-Demand Capacity Reservations send metric data to CloudWatch every five minutes. Metrics are not
supported for Capacity Reservations that are active for less than five minutes.
For more information about viewing metrics in the CloudWatch console, see Using Amazon CloudWatch
Metrics. For more information about creating alarms, see Creating Amazon CloudWatch Alarms.
Contents
• Capacity Reservation usage metrics (p. 529)
• Capacity Reservation metric dimensions (p. 529)
• View CloudWatch metrics for Capacity Reservations (p. 529)
528
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Metric Description
Unit: Count
Unit: Count
Unit: Count
Unit: Percent
Dimension Description
CapacityReservationId This globally unique dimension filters the data you request for the
identified capacity reservation only.
529
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Events in EventBridge are represented as JSON objects. The fields that are unique to the event are
contained in the "detail" section of the JSON object. The "event" field contains the event name. The
"result" field contains the completed status of the action that triggered the event. For more information,
see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.
For more information, see What Is Amazon EventBridge? in the Amazon EventBridge User Guide.
Topics
• Events (p. 530)
• Create an EventBridge rule (p. 531)
Events
AWS Health sends the following events when capacity usage for a Capacity Reservation is below 20
percent.
Events
• AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION (p. 530)
• AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_SUMMARY (p. 531)
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION
The following is an example of an event that is generated when a newly created Capacity Reservation is
below 20 percent capacity usage over a 24-hour period.
{
"version": "0",
"id": "b3e00086-f271-12a1-a36c-55e8ddaa130a",
"detail-type": "AWS Health Event",
"source": "aws.health",
"account": "123456789012",
"time": "2023-03-10T12:03:38Z",
"region": "ap-south-1",
"resources": [
"cr-01234567890abcdef"
],
"detail": {
"eventArn": "arn:aws:health:ap-south-1::event/EC2/
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION/
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_cr-01234567890abcdef-6211-4d50-9286-0c9fbc243f04",
"service": "EC2",
"eventTypeCode": "AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION",
"eventTypeCategory": "accountNotification",
"startTime": "Fri, 10 Mar 2023 12:03:38 GMT",
"endTime": "Fri, 10 Mar 2023 12:03:38 GMT",
"eventDescription": [
{
"language": "en_US",
"latestDescription": "A description of the event will be provided here"
}
],
530
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
"affectedEntities": [
{
"entityValue": "cr-01234567890abcdef"
}
]
}
}
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_SUMMARY
The following is an example of an event that is generated when one or more Capacity Reservation is
below 20 percent capacity usage over a 7-day period.
{
"version": "0", "id":"7439d42b-3c7f-ad50-6a88-25e2a70977e2",
"detail-type": "AWS Health Event",
"source": "aws.health",
"account": "123456789012",
"time": "2023-03-07T06:06:01Z",
"region": "us-east-1",
"resources": [
"cr-01234567890abcdef | us-east-1b | t3.medium | Linux/UNIX | 0.0%",
"cr-09876543210fedcba | us-east-1a | t3.medium | Linux/UNIX | 0.0%"
],
"detail": {
"eventArn": "arn:aws:health:us-east-1::event/
EC2/AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_SUMMARY/
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_SUMMARY_726c1732-d6f6-4037-b9b8-bec3c2d3ba65",
"service": "EC2",
"eventTypeCode": "AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION_SUMMARY",
"eventTypeCategory": "accountNotification",
"startTime": "Tue, 7 Mar 2023 06:06:01 GMT",
"endTime": "Tue, 7 Mar 2023 06:06:01 GMT",
"eventDescription": [
{
"language": "en_US",
"latestDescription": "A description of the event will be provided here"
}
],
"affectedEntities": [
{
"entityValue": "cr-01234567890abcdef | us-east-1b | t3.medium | Linux/UNIX
| 0.0%"
},
{
"entityValue": "cr-09876543210fedcba | us-east-1a | t3.medium | Linux/UNIX
| 0.0%"
}
]
}
}
To receive email notifications when your Capacity Reservation utilization drops below
20 percent, create an Amazon SNS topic, and then create an EventBridge rule for the
AWS_EC2_ODCR_UNDERUTILIZATION_NOTIFICATION event.
531
Amazon Elastic Compute Cloud
User Guide for Windows Instances
On-Demand Capacity Reservations
Utilization notifications
AWS Health sends the following email and AWS Health Dashboard notifications when capacity utilization
for Capacity Reservations in your account drops below 20 percent.
• Individual notifications for each newly created Capacity Reservation that has been below 20 percent
utilization over the last 24-hour period.
• A summary notification for all Capacity Reservations that have been below 20 percent utilization over
the last 7-day period.
The email notifications and AWS Health Dashboard notifications are sent to the email address associated
with the AWS account that owns the Capacity Reservations. The notifications include the following
information:
532
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance lifecycle
Additionally, when capacity utilization for a Capacity Reservation in your account drops below 20 percent
over a 24-hour and 7-day period, AWS Health sends events to EventBridge. With EventBridge, you
can create rules that activate automatic actions, such as sending email notifications or triggering AWS
Lambda functions, in response to such events. For more information, see Monitor Capacity Reservations
using EventBridge (p. 530).
Instance lifecycle
An Amazon EC2 instance transitions through different states from the moment you launch it through to
its termination.
The following table provides a brief description of each instance state and indicates whether it is billed.
Note
The table indicates billing for instance usage only. Some AWS resources, such as Amazon EBS
volumes and Elastic IP addresses, incur charges regardless of the instance's state. For more
information, see Avoiding Unexpected Charges in the AWS Billing User Guide.
533
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance launch
Note
Rebooting an instance doesn't start a new instance billing period because the instance stays in
the running state.
Instance launch
When you launch an instance, it enters the pending state. The instance type that you specified at launch
determines the hardware of the host computer for your instance. We use the Amazon Machine Image
(AMI) you specified at launch to boot the instance. After the instance is ready for you, it enters the
running state. You can connect to your running instance and use it the way that you'd use a computer
sitting in front of you.
As soon as your instance transitions to the running state, you're billed for each second, with a one-
minute minimum, that you keep the instance running, even if the instance remains idle and you don't
connect to it.
For more information, see Launch your instance (p. 537) and Connect to your Windows
instance (p. 610).
When you stop your instance, it enters the stopping state, and then the stopped state. We don't
charge usage or data transfer fees for your instance after you stop it, but we do charge for the storage
534
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance hibernate (Amazon EBS-backed instances only)
for any Amazon EBS volumes. While your instance is in the stopped state, you can modify certain
attributes of the instance, including the instance type.
When you start your instance, it enters the pending state, and we move the instance to a new host
computer (though in some cases, it remains on the current host). When you stop and start your instance,
you lose any data on the instance store volumes on the previous host computer.
Your instance retains its private IPv4 address, which means that an Elastic IP address associated with the
private IPv4 address or network interface is still associated with your instance. If your instance has an
IPv6 address, it retains its IPv6 address.
Each time you transition an instance from stopped to running, we charge per second when the
instance is running, with a minimum of one minute every time you start your instance.
For more information, see Stop and start your instance (p. 580).
When you hibernate your instance, it enters the stopping state, and then the stopped state. We don't
charge usage for a hibernated instance when it is in the stopped state, but we do charge while it is in
the stopping state, unlike when you stop an instance (p. 534) without hibernating it. We don't charge
usage for data transfer fees, but we do charge for the storage for any Amazon EBS volumes, including
storage for the RAM data.
When you start your hibernated instance, it enters the pending state, and we move the instance to a
new host computer (though in some cases, it remains on the current host).
Your instance retains its private IPv4 address, which means that an Elastic IP address associated with the
private IPv4 address or network interface is still associated with your instance. If your instance has an
IPv6 address, it retains its IPv6 address.
For more information, see Hibernate your On-Demand Windows instance (p. 586).
Instance reboot
You can reboot your instance using the Amazon EC2 console, a command line tool, and the Amazon EC2
API. We recommend that you use Amazon EC2 to reboot your instance instead of running the operating
system reboot command from your instance.
Rebooting an instance is equivalent to rebooting an operating system. The instance remains on the same
host computer and maintains its public DNS name, private IP address, and any data on its instance store
volumes. It typically takes a few minutes for the reboot to complete, but the time it takes to reboot
depends on the instance configuration.
Rebooting an instance doesn't start a new instance billing period; per second billing continues without a
further one-minute minimum charge.
535
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance retirement
Instance retirement
An instance is scheduled to be retired when AWS detects the irreparable failure of the underlying
hardware hosting the instance. When an instance reaches its scheduled retirement date, it is stopped or
terminated by AWS. If your instance root device is an Amazon EBS volume, the instance is stopped, and
you can start it again at any time. If your instance root device is an instance store volume, the instance is
terminated, and cannot be used again.
Instance termination
When you've decided that you no longer need an instance, you can terminate it. As soon as the status of
an instance changes to shutting-down or terminated, you stop incurring charges for that instance.
If you enable termination protection, you can't terminate the instance using the console, CLI, or API.
After you terminate an instance, it remains visible in the console for a short while, and then the entry
is automatically deleted. You can also describe a terminated instance using the CLI and API. Resources
(such as tags) are gradually disassociated from the terminated instance, therefore may no longer be
visible on the terminated instance after a short while. You can't connect to or recover a terminated
instance.
Each Amazon EBS volume supports the DeleteOnTermination attribute, which controls whether the
volume is deleted or preserved when you terminate the instance it is attached to. The default is to delete
the root device volume and preserve any other EBS volumes.
Host The instance stays We move the instance We move the instance None
computer on the same host to a new host to a new host
computer computer (though computer (though in
in some cases, it some cases, it remains
remains on the on the current host).
current host).
Private and These addresses The instance keeps its The instance keeps its None
public IPv4 stay the same private IPv4 address. private IPv4 address.
addresses The instance gets The instance gets
536
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Elastic IP The Elastic IP The Elastic IP address The Elastic IP address The Elastic
addresses address remains remains associated remains associated IP address is
(IPv4) associated with with the instance with the instance disassociated from
the instance the instance
IPv6 The address stays The instance keeps its The instance keeps its None
address the same IPv6 address IPv6 address
Instance The data is The data is erased The data is erased The data is erased
store preserved
volumes
Root device The volume is The volume is The volume is The volume is
volume preserved preserved preserved deleted by default
RAM The RAM is erased The RAM is erased The RAM is saved The RAM is erased
(contents of to a file on the root
memory) volume
Billing The instance You stop incurring You incur charges You stop incurring
billing hour charges for an while the instance is in charges for
doesn't change. instance as soon as the stopping state, an instance
its state changes but stop incurring as soon as its
to stopping. charges when the state changes to
Each time an instance is in the shutting-down.
instance transitions stopped state. Each
from stopped to time an instance
running, we start a transitions from
new instance billing stopped to running,
period, billing a we start a new
minimum of one instance billing period,
minute every time billing a minimum
you start your of one minute every
instance. time you start your
instance.
Operating system shutdown commands always terminate an instance store-backed instance. You can
control whether operating system shutdown commands stop or terminate an Amazon EBS-backed
instance. For more information, see Change the instance initiated shutdown behavior (p. 603).
When you sign up for AWS, you can get started with Amazon EC2 for free using the AWS Free Tier. You
can use the free tier to launch and use a t2.micro instance for free for 12 months (in Regions where
537
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
t2.micro is unavailable, you can use a t3.micro instance under the free tier). If you launch an instance
that is not within the free tier, you incur the standard Amazon EC2 usage fees for the instance. For more
information, see Amazon EC2 pricing.
Method Documentation
[Amazon EC2 console] Use the launch instance Launch an instance using the old launch instance
wizard to specify the launch parameters. wizard (p. 548)
[Amazon EC2 console] Create a launch template Launch an instance from a launch
and launch the instance from the launch template (p. 554)
template.
[Amazon EC2 console] Use an existing instance as Launch an instance using parameters from an
the base. existing instance (p. 576)
[Amazon EC2 console] Use an AMI that you Launch an AWS Marketplace instance (p. 578)
purchased from the AWS Marketplace.
[AWS CLI] Use an AMI that you select. Using Amazon EC2 through the AWS CLI
[AWS Tools for Windows PowerShell] Use an AMI Amazon EC2 from the AWS Tools for Windows
that you select. PowerShell
[AWS CLI] Use EC2 Fleet to provision capacity EC2 Fleet (p. 916)
across different EC2 instance types and
Availability Zones, and across On-Demand
Instance, Reserved Instance, and Spot Instance
purchase models.
[AWS SDK] Use a language-specific AWS SDK to AWS SDK for .NET
launch an instance.
AWS SDK for C++
Note
To launch an EC2 instance into an IPv6-only subnet, you must use Instances built on the Nitro
System (p. 210).
Note
When launching an IPv6-only instance, it is possible that DHCPv6 may not immediately provide
the instance with the IPv6 DNS name server. During this initial delay, the instance may not be
able to resolve public domains.
538
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
For instances running on Amazon Linux 2, if you want to immediately update the /etc/
resolv.conf file with the IPv6 DNS name server, run the following cloud-init directive at launch:
#cloud-config
bootcmd:
- /usr/bin/sed -i -E 's,^nameserver\s+[\.[:digit:]]+$,nameserver fd00:ec2::253,' /
etc/resolv.conf
Another option is to change the configuration file and re-image your AMI so that the file has the
IPv6 DNS name server address immediately on booting.
When you launch your instance, you can launch your instance in a subnet that is associated with one of
the following resources:
After you launch your instance, you can connect to it and use it. To begin, the instance state is pending.
When the instance state is running, the instance has started booting. There might be a short time
before you can connect to the instance. Note that bare metal instance types might take longer to launch.
For more information about bare metal instances, see Instances built on the Nitro System (p. 210).
The instance receives a public DNS name that you can use to contact the instance from the internet. The
instance also receives a private DNS name that other instances within the same VPC can use to contact
the instance. For more information about connecting to your instance, see Connect to your Windows
instance (p. 610).
When you are finished with an instance, be sure to terminate it. For more information, see Terminate
your instance (p. 600).
Before you launch your instance, be sure that you are set up. For more information, see Set up to use
Amazon EC2 (p. 5).
Important
When you launch an instance that's not within the AWS Free Tier, you are charged for the time
that the instance is running, even if it remains idle.
Topics
• About the new launch instance wizard (p. 540)
• Quickly launch an instance (p. 540)
• Launch an instance using defined parameters (p. 541)
539
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Launch an instance using the old launch instance wizard (p. 548)
We're in the process of rolling out the new launch instance wizard. If it's not available in your currently
selected Region, you can select a different Region to check if it's available there.
Current improvements
Quickly get up and running with our new one-page design. See all of your settings in one location.
No need to navigate back and forth between steps to ensure your configuration is correct. Use the
Summary panel for an overview and to easily navigate the page.
• Improved AMI selector
New users – Use the Quick Start Amazon Machine Image (AMI) selector to select an operating system
so that you can quickly launch an instance.
Experienced users – The AMI selector displays your recently used AMIs and the AMIs that you own,
making it easier to select the AMIs that you care about. You can still browse the full catalog to find
new AMIs.
Work in progress
We’re working continuously to improve the experience. Here’s what we’re currently working on:
There will be many more improvements to the launch experience in the months ahead.
We’d appreciate your feedback on the new launch instance wizard. We’ll use your feedback to continue
improving the experience over the next few months. You can send us feedback directly from the EC2
console, or use the Provide feedback link at the bottom of this page.
540
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
2. In the navigation bar at the top of the screen, the current AWS Region is displayed (for example, US
East (Ohio)). Select a Region in which to launch the instance. This choice is important because some
Amazon EC2 resources can be shared between Regions, while others can't. For more information, see
Resource locations (p. 1884).
3. From the Amazon EC2 console dashboard, choose Launch instance.
4. (Optional) Under Name and tags, for Name, enter a descriptive name for your instance.
5. Under Application and OS Images (Amazon Machine Image), choose Quick Start, and then choose
the operating system (OS) for your instance.
6. Under Key pair (login), for Key pair name, choose an existing key pair or create a new one.
7. In the Summary panel, choose Launch instance.
The instance name is a tag, where the key is Name, and the value is the name that you specify. You can
tag the instance, volumes, elastic graphics, and network interfaces. For Spot Instances, you can tag the
Spot Instance request only. For information about tags, see Tag your Amazon EC2 resources (p. 1894).
• For Name, enter a descriptive name for the instance. If you don't specify a name, the instance can be
identified by its ID, which is automatically generated when you launch the instance.
• To add additional tags, choose Add additional tags. Choose Add tag, and then enter a key and value,
and select the resource type to tag. Choose Add tag again for each additional tag to add.
541
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
An Amazon Machine Image (AMI) contains the information required to create an instance. For example,
an AMI might contain the software that's required to act as a web server, such as Windows, Apache, and
your website.
You can find a suitable AMI as follows. With each option for finding an AMI, you can choose Cancel (at
top right) to return to the launch instance wizard without choosing an AMI.
Search bar
To search through all available AMIs, enter a keyword in the AMI search bar and then press Enter. To
select an AMI, choose Select.
Recents
Choose Recently launched or Currently in use, and then, from Amazon Machine Image (AMI),
select an AMI.
My AMIs
The private AMIs that you own, or private AMIs that have been shared with you.
Choose Owned by me or Shared with me, and then, from Amazon Machine Image (AMI), select an
AMI.
Quick Start
AMIs are grouped by operating system (OS) to help you get started quickly.
First select the OS that you need, and then, from Amazon Machine Image (AMI), select an AMI. To
select an AMI that is eligible for the free tier, make sure that the AMI is marked Free tier eligible.
Browse more AMIs
The AWS Marketplace is an online store where you can buy software that runs on AWS, including
AMIs. For more information about launching an instance from the AWS Marketplace, see Launch
an AWS Marketplace instance (p. 578). In Community AMIs, you can find AMIs that AWS
community members have made available for others to use. AMIs from Amazon or a verified
partner are marked Verified provider.
• To filter the list of AMIs, select one or more check boxes under Refine results on the left of the
screen. The filter options are different depending on the selected search category.
• Check the Virtualization type listed for each AMI. Notice which AMIs are the type that you need:
either hvm or paravirtual. For example, some instance types require HVM.
• Check the Boot mode listed for each AMI. Notice which AMIs use the boot mode that you need:
either legacy-bios, uefi, or uefi-preferred. For more information, see Boot modes (p. 21).
• Choose an AMI that meets your needs, and then choose Select.
542
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
If you modify the configuration of any volumes or security groups associated with the selected AMI, and
then you choose a different AMI, a window opens to warn you that some of your current settings will be
changed or removed. You can review the changes to the security groups and volumes. Furthermore, you
can either view which volumes will be added and deleted, or view only the volumes that will be added.
Instance type
The instance type defines the hardware configuration and size of the instance. Larger instance types have
more CPU and memory. For more information, see Instance types.
• For Instance type, select the instance type for the instance.
Free Tier – If your AWS account is less than 12 months old, you can use Amazon EC2 under the Free
Tier by selecting the t2.micro instance type (or the t3.micro instance type in Regions where t2.micro is
unavailable). If an instance type is eligible under the Free Tier, it is labeled Free tier eligible. For more
information about t2.micro and t3.micro, see Burstable performance instances (p. 234).
• Compare instance types: You can compare different instance types by the following attributes:
number of vCPUs, architecture, amount of memory (GiB), amount of storage (GB), storage type, and
network performance.
For Key pair name, choose an existing key pair, or choose Create new key pair to create a new one. For
more information, see Amazon EC2 key pairs and Windows instances (p. 1476).
Important
If you choose the Proceed without key pair (Not recommended) option, you won't be able to
connect to the instance unless you choose an AMI that is configured to allow users another way
to log in.
Network settings
• VPC: Choose an existing VPC for your instance. You can choose the default VPC or a VPC that you
created. For more information, see the section called “Virtual private clouds” (p. 1323).
• Subnet: You can launch an instance in a subnet associated with an Availability Zone, Local Zone,
Wavelength Zone, or Outpost.
To launch the instance in an Availability Zone, select the subnet in which to launch your instance. To
create a new subnet, choose Create new subnet to go to the Amazon VPC console. When you are
done, return to the launch instance wizard and choose the Refresh icon to load your subnet in the list.
To launch the instance in a Local Zone, select a subnet that you created in the Local Zone.
To launch an instance in an Outpost, select a subnet in a VPC that you associated with the Outpost.
• Auto-assign Public IP: Specify whether your instance receives a public IPv4 address. By default,
instances in a default subnet receive a public IPv4 address, and instances in a nondefault subnet don't.
You can select Enable or Disable to override the subnet's default setting. For more information, see
Public IPv4 addresses (p. 1190).
• Firewall (security groups): Use a security group to define firewall rules for your instance. These
rules specify which incoming network traffic is delivered to your instance. All other traffic is
ignored. For more information about security groups, see Amazon EC2 security groups for Windows
instances (p. 1488).
If you add a network interface, you must specify the same security group in the network interface.
543
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• To select an existing security group for your VPC, choose Select existing security group, and select
your security group from Common security groups.
• To create a new security group for your VPC, choose Create security group. The launch instance
wizard automatically defines the launch-wizard-x security group and provides the following check
boxes for quickly adding security group rules:
Allow SSH traffic from – Creates an inbound rule to allow you to connect to your instance over RDP
(port 3389). Specify whether the traffic comes from Anywhere, Custom, or My IP.
Allow HTTPs traffic from the internet – Creates an inbound rule that opens port 443 (HTTPS) to
allow internet traffic from anywhere. If your instance will be a web server, you'll need this rule.
Allow HTTP traffic from the internet – Creates an inbound rule that opens port 80 (HTTP) to allow
internet traffic from anywhere. If your instance will be a web server, you'll need this rule.
You can edit these rules and add rules to suit your needs.
To edit or add a rule, choose Edit (at top right). To add a rule, choose Add security group rule. For
Type, select the network traffic type. The Protocol field is automatically filled in with the protocol
to open to network traffic. For Source type, select the source type. To let the launch instance wizard
add your computer's public IP address, choose My IP. However, if you are connecting through an
ISP or from behind your firewall without a static IP address, you need to find out the range of IP
addresses used by client computers.
Warning
Rules that enable all IP addresses (0.0.0.0/0) to access your instance over SSH or RDP are
acceptable if you are briefly launching a test instance and will stop or terminate it soon, but
are unsafe for production environments. You should authorize only a specific IP address or
range of addresses to access your instance.
• Advanced network configuration – Available only if you choose a subnet.
Network interface
• Device index: The index of the network card. The primary network interface must be assigned to
network card index 0. Some instance types support multiple network cards.
• Network interface: Select New interface to let Amazon EC2 create a new interface, or select an
existing, available network interface.
• Description: (Optional) A description for the new network interface.
• Subnet: The subnet in which to create the new network interface. For the primary network interface
(eth0), this is the subnet in which the instance is launched. If you've entered an existing network
interface for eth0, the instance is launched in the subnet in which the network interface is located.
• Security groups: One or more security groups in your VPC with which to associate the network
interface.
• Primary IP: A private IPv4 address from the range of your subnet. Leave blank to let Amazon EC2
choose a private IPv4 address for you.
• Secondary IP: One or more additional private IPv4 addresses from the range of your subnet. Choose
Manually assign and enter an IP address. Choose Add IP to add another IP address. Alternatively,
choose Automatically assign to let Amazon EC2 choose one for you, and enter a value to indicate
the number of IP addresses to add.
• (IPv6-only) IPv6 IPs: An IPv6 address from the range of the subnet. Choose Manually assign and
enter an IP address. Choose Add IP to add another IP address. Alternatively, choose Automatically
assign to let Amazon EC2 choose one for you, and enter a value to indicate the number of IP
addresses to add.
• IPv4 Prefixes: The IPv4 prefixes for the network interface.
• IPv6 Prefixes: The IPv6 prefixes for the network interface.
• Delete on termination: Whether the network interface is deleted when the instance is deleted.
544
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Elastic Fabric Adapter: Indicates whether the network interface is an Elastic Fabric Adapter. For
more information, see Elastic Fabric Adapter.
Choose Add network interface to add a secondary network interface. A secondary network interface
can reside in a different subnet of the VPC, provided it's in the same Availability Zone as your instance.
For more information, see Elastic network interfaces (p. 1245). If you specify more than one network
interface, your instance cannot receive a public IPv4 address. Additionally, if you specify an existing
network interface for eth0, you cannot override the subnet's public IPv4 setting using Auto-assign
Public IP. For more information, see Assign a public IPv4 address during instance launch (p. 1193).
Configure storage
The AMI you selected includes one or more volumes of storage, including the root volume. You can
specify additional volumes to attach to the instance.
You can use the Simple or Advanced view. With the Simple view, you specify the size and type of the
volume. To specify all volume parameters, choose the Advanced view (at top right of the card).
By using the Advanced view, you can configure each volume as follows:
• Storage type: Select Amazon EBS or instance store volumes to associate with your instance.
The volume types available in the list depend on the instance type that you've chosen. For more
information, see Amazon EC2 instance store (p. 1805) and Amazon EBS volumes (p. 1517).
• Device name: Select from the list of available device names for the volume.
• Snapshot: Select the snapshot from which to restore the volume. You can search for available shared
and public snapshots by entering text into the Snapshot field.
• Size (GiB): For EBS volumes, you can specify a storage size. If you have selected an AMI and instance
that are eligible for the free tier, keep in mind that to stay within the free tier, you must stay under 30
GiB of total storage. For more information, see Constraints on the size and configuration of an EBS
volume (p. 1536).
• Volume type: For EBS volumes, select a volume type. For more information, see Amazon EBS volume
types (p. 1520).
• IOPS: If you have selected a Provisioned IOPS SSD volume type, then you can enter the number of I/O
operations per second (IOPS) that the volume can support.
• Delete on termination: For Amazon EBS volumes, choose Yes to delete the volume when the instance
is terminated, or choose No to keep the volume. For more information, see Preserve Amazon EBS
volumes on instance termination (p. 604).
• Encrypted: If the instance type supports EBS encryption, you can choose Yes to enable encryption for
the volume. If you have enabled encryption by default in this Region, encryption is enabled for you.
For more information, see Amazon EBS encryption (p. 1732).
• KMS key: If you selected Yes for Encrypted, then you must select a customer managed key to use to
encrypt the volume. If you have enabled encryption by default in this Region, the default customer
managed key is selected for you. You can select a different key or specify the ARN of any customer
managed key that you created.
• File systems: Mount an Amazon EFS or Amazon FSx file system to the instance. For more information
about mounting an Amazon EFS file system, see Use Amazon EFS with Amazon EC2 (p. 1824). For
more information about mounting an Amazon FSx file system, see Use Amazon FSx with Amazon
EC2 (p. 1824)
Advanced details
For Advanced details, expand the section to view the fields and specify any additional parameters for
the instance.
545
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Purchasing option: Choose Request Spot Instances to request Spot Instances at the Spot price,
capped at the On-Demand price, and choose Customize to change the default Spot Instance settings.
You can set your maximum price (not recommended), and change the request type, request duration,
and interruption behavior. If you do not request a Spot Instance, Amazon EC2 launches an On-Demand
Instance by default. For more information, see Create a Spot Instance request (p. 395).
• Domain join directory: Select the AWS Directory Service directory (domain) to which your Windows
instance is joined after launch. If you select a domain, you must select an IAM role with the required
permissions. For more information, see Seamlessly join a Windows EC2 instance.
• IAM instance profile: Select an AWS Identity and Access Management (IAM) instance profile to
associate with the instance. For more information, see IAM roles for Amazon EC2 (p. 1462).
• Hostname type: Select whether the guest OS hostname of the instance will include the resource name
or the IP name. For more information, see Amazon EC2 instance hostname types (p. 1204).
• DNS Hostname: Determines if the DNS queries to the resource name or the IP name (depending on
what you selected for Hostname type) will respond with the IPv4 address (A record), IPv6 address
(AAAA record), or both. For more information, see Amazon EC2 instance hostname types (p. 1204).
• Shutdown behavior: Select whether the instance should stop or terminate when shut down. For more
information, see Change the instance initiated shutdown behavior (p. 603).
• Stop - Hibernate behavior: To enable hibernation, choose Enable. This field is available only if your
instance meets the hibernation prerequisites. For more information, see Hibernate your On-Demand
Windows instance (p. 586).
• Termination protection: To prevent accidental termination, choose Enable. For more information, see
Enable termination protection (p. 602).
• Stop protection: To prevent accidental stopping, choose Enable. For more information, see Enable
stop protection (p. 583).
• Detailed CloudWatch monitoring: Choose Enable to turn on detailed monitoring of your instance
using Amazon CloudWatch. Additional charges apply. For more information, see Monitor your
instances using CloudWatch (p. 1137).
• Elastic GPU: Select an Elastic Graphics accelerator to attach to the instance. Not all instance types
support Elastic Graphics. For more information, see Amazon Elastic Graphics (p. 1089).
• Elastic inference: An elastic inference accelerator to attach to your EC2 CPU instance. For more
information, see Working with Amazon Elastic Inference in the Amazon Elastic Inference Developer
Guide.
Note
Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference
(EI), and will help current customers migrate their workloads to options that offer better
price and performance. After April 15, 2023, new customers will not be able to launch
instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2.
However, customers who have used Amazon EI at least once during the past 30-day period are
considered current customers and will be able to continue using the service.
• Credit specification: Choose Unlimited to enable applications to burst beyond the baseline for as long
as needed. This field is only valid for T instances. Additional charges may apply. For more information,
see Burstable performance instances (p. 234).
• Placement group name: Specify a placement group in which to launch the instance. You can select an
existing placement group, or create a new one. Not all instance types support launching an instance in
a placement group. For more information, see Placement groups (p. 1302).
• EBS-optimized instance: An instance that's optimized for Amazon EBS uses an optimized
configuration stack and provides additional, dedicated capacity for Amazon EBS I/O. If the instance
type supports this feature, choose Enable to enable it. Additional charges apply. For more information,
see Amazon EBS–optimized instances (p. 1752).
• Capacity Reservation: Specify whether to launch the instance into any open Capacity Reservation
(Open), a specific Capacity Reservation (Target by ID), or a Capacity Reservation group (Target
by group). To specify that a Capacity Reservation should not be used, choose None. For more
information, see Launch instances into an existing Capacity Reservation (p. 497).
546
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Tenancy: Choose whether to run your instance on shared hardware (Shared), isolated, dedicated
hardware (Dedicated), or on a Dedicated Host (Dedicated host). If you choose to launch the instance
onto a Dedicated Host, you can specify whether to launch the instance into a host resource group or
you can target a specific Dedicated Host. Additional charges may apply. For more information, see
Dedicated Instances (p. 486) and Dedicated Hosts (p. 446).
• RAM disk ID: (Only valid for paravirtual (PV) AMIs) Select a RAM disk for the instance. If you have
selected a kernel, you might need to select a specific RAM disk with the drivers to support it.
• Kernel ID: (Only valid for paravirtual (PV) AMIs) Select a kernel for the instance.
• Nitro Enclave: Allows you to create isolated execution environments, called enclaves, from Amazon
EC2 instances. Select Enable to enable the instance for AWS Nitro Enclaves. For more information, see
What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide.
• License configurations: You can launch instances against the specified license configuration to track
your license usage. For more information, see Create a license configuration in the AWS License
Manager User Guide.
• Metadata accessible: You can enable or disable access to the instance metadata. For more
information, see Configure instance metadata options for new instances (p. 824).
• Metadata transport: Enable the instance to reach the link local IMDSv2 IPv6 address
(fd00:ec2::254) to retrieve instance metadata. This option is only available if you are launching
Instances built on the Nitro System (p. 210) into an IPv6-only subnet. For more information about
retrieving instance metadata, see Retrieve instance metadata (p. 831).
• Metadata version: If you enable access to the instance metadata, you can choose to require the use of
Instance Metadata Service Version 2 when requesting instance metadata. For more information, see
Configure instance metadata options for new instances (p. 824).
• Metadata response hop limit: If you enable instance metadata, you can set the allowable number of
network hops for the metadata token. For more information, see Configure instance metadata options
for new instances (p. 824).
• Allow tags in metadata: If you select Enable, the instance will allow access to all of its tags from
its metadata. If no value is specified, then by default, access to the tags in instance metadata is not
allowed. For more information, see Allow access to tags in instance metadata (p. 1906).
• User data: You can specify user data to configure an instance during launch, or to run a configuration
script. For more information, see Run commands on your Windows instance at launch (p. 809).
Summary
Use the Summary panel to specify the number of instances to launch, to review your instance
configuration, and to launch your instances.
• Number of instances: Enter the number of instances to launch. All of the instances will launch with
the same configuration.
Tip
To ensure faster instance launches, break up large requests into smaller batches. For example,
create five separate launch requests for 100 instances each instead of one launch request for
500 instances.
• (Optional) If you specify more than one instance, to help ensure that you maintain the correct number
of instances to handle demand on your application, you can choose consider EC2 Auto Scaling to
create a launch template and an Auto Scaling group. Auto Scaling scales the number of instances in
the group according to your specifications. For more information, see the Amazon EC2 Auto Scaling
User Guide.
Note
If Amazon EC2 Auto Scaling marks an instance that is in an Auto Scaling group as unhealthy,
the instance is automatically scheduled for replacement where it is terminated and another is
launched, and you lose your data on the original instance. An instance is marked as unhealthy
if you stop or reboot the instance, or if another event marks the instance as unhealthy. For
547
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
more information, see Health checks for Auto Scaling instances in the Amazon EC2 Auto
Scaling User Guide.
• Review the details of your instance, and make any necessary changes. You can navigate directly to a
section by choosing its link in the Summary panel.
• When you're ready to launch your instance, choose Launch instance.
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
(Optional) You can create a billing alert for the instance. On the confirmation screen, under Next
Steps, choose Create billing alerts and follow the directions. Billing alerts can also be created after
you launch the instance. For more information, see Creating a billing alarm to monitor your estimated
AWS charges in the Amazon CloudWatch User Guide.
You can launch an instance using the old launch instance wizard only if your Region supports the old
launch experience. The launch instance wizard specifies all the launch parameters required for launching
an instance. Where the launch instance wizard provides a default value, you can accept the default or
specify your own value. You must specify an AMI and a key pair to launch an instance.
For the instructions to use the new launch instance wizard, see Launch an instance using the new launch
instance wizard (p. 539).
Before you launch your instance, be sure that you are set up. For more information, see Set up to use
Amazon EC2 (p. 5).
Important
When you launch an instance that's not within the AWS Free Tier, you are charged for the time
that the instance is running, even if it remains idle.
548
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
When you launch an instance, you must select a configuration, known as an Amazon Machine Image
(AMI). An AMI contains the information required to create a new instance. For example, an AMI might
contain the software required to act as a web server, such as Windows, Apache, and your website.
When you launch an instance, you can either select an AMI from the list, or you can select a Systems
Manager parameter that points to an AMI ID. For more information, see Using a Systems Manager
parameter to find an AMI .
On the Choose an Amazon Machine Image (AMI) page, use one of two options to choose an AMI. Either
search the list of AMIs (p. 549), or search by Systems Manager parameter (p. 549).
Quick Start
A selection of popular AMIs to help you get started quickly. To select an AMI that is eligible for
the free tier, choose Free tier only in the left pane. These AMIs are marked Free tier eligible.
My AMIs
The private AMIs that you own, or private AMIs that have been shared with you. To view AMIs
that are shared with you, choose Shared with me in the left pane.
AWS Marketplace
An online store where you can buy software that runs on AWS, including AMIs. For more
information about launching an instance from the AWS Marketplace, see Launch an AWS
Marketplace instance (p. 578).
Community AMIs
The AMIs that AWS community members have made available for others to use. To filter the list
of AMIs by operating system, choose the appropriate check box under Operating system. You
can also filter by architecture and root device type.
2. Check the Virtualization type listed for each AMI. Notice which AMIs are the type that you need,
either hvm or paravirtual. For example, some instance types require HVM.
3. Check the Boot mode listed for each AMI. Notice which AMIs use the boot mode that you need,
either legacy-bios or uefi. For more information, see Boot modes (p. 21).
4. Choose an AMI that meets your needs, and then choose Select.
On the Choose an Instance Type page, select the hardware configuration and size of the instance
to launch. Larger instance types have more CPU and memory. For more information, see Instance
types (p. 202).
549
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
To remain eligible for the free tier, choose the t2.micro instance type (or the t3.micro instance type in
Regions where t2.micro is unavailable). If an instance type is eligible under the Free Tier, it is labeled
Free tier eligible. For more information about t2.micro and t3.micro, see Burstable performance
instances (p. 234).
By default, the wizard displays current generation instance types, and selects the first available instance
type based on the AMI that you selected. To view previous generation instance types, choose All
generations from the filter list.
Note
To set up an instance quickly for testing purposes, choose Review and Launch to accept the
default configuration settings, and launch your instance. Otherwise, to configure your instance
further, choose Next: Configure Instance Details.
To launch the instance in an Availability Zone, select the subnet into which to launch your instance.
You can select No preference to let AWS choose a default subnet in any Availability Zone. To create a
new subnet, choose Create new subnet to go to the Amazon VPC console. When you are done, return
to the wizard and choose Refresh to load your subnet in the list.
To launch the instance in a Local Zone, select a subnet that you created in the Local Zone.
To launch an instance in an Outpost, select a subnet in a VPC that you associated with an Outpost.
• Auto-assign Public IP: Specify whether your instance receives a public IPv4 address. By default,
instances in a default subnet receive a public IPv4 address and instances in a nondefault subnet don't.
You can select Enable or Disable to override the subnet's default setting. For more information, see
Public IPv4 addresses (p. 1190).
550
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Auto-assign IPv6 IP: Specify whether your instance receives an IPv6 address from the range of the
subnet. Select Enable or Disable to override the subnet's default setting. This option is only available
if you've associated an IPv6 CIDR block with your VPC and subnet. For more information, see Add an
IPv6 CIDR block to your VPC in the Amazon VPC User Guide.
• Hostname type: Select whether the guest OS hostname of the instance will include the resource name
or the IP name. For more information, see Amazon EC2 instance hostname types (p. 1204).
• DNS Hostname: Determines if the DNS queries to the resource name or the IP name (depending on
what you selected for Hostname type) will respond with the IPv4 address (A record), IPv6 address
(AAAA record), or both. For more information, see Amazon EC2 instance hostname types (p. 1204).
• Domain join directory: Select the AWS Directory Service directory (domain) to which your Windows
instance is joined after launch. If you select a domain, you must select an IAM role with the required
permissions. For more information, see Seamlessly join a Windows EC2 instance.
• Placement group: A placement group determines the placement strategy of your instances. Select
an existing placement group, or create a new one. This option is only available if you've selected an
instance type that supports placement groups. For more information, see Placement groups (p. 1302).
• Capacity Reservation: Specify whether to launch the instance into shared capacity, any open Capacity
Reservation, a specific Capacity Reservation, or a Capacity Reservation group. For more information,
see Launch instances into an existing Capacity Reservation (p. 497).
• IAM role: Select an AWS Identity and Access Management (IAM) role to associate with the instance. For
more information, see IAM roles for Amazon EC2 (p. 1462).
• CPU options: Choose Specify CPU options to specify a custom number of vCPUs during launch.
Set the number of CPU cores and threads per core. For more information, see Optimize CPU
options (p. 762).
• Shutdown behavior: Select whether the instance should stop or terminate when shut down. For more
information, see Change the instance initiated shutdown behavior (p. 603).
• Stop - Hibernate behavior: To enable hibernation, select this check box. This option is only available
if your instance meets the hibernation prerequisites. For more information, see Hibernate your On-
Demand Windows instance (p. 586).
• Enable termination protection: To prevent accidental termination, select this check box. For more
information, see Enable termination protection (p. 602).
• Enable stop protection: To prevent accidental stopping, select this check box. For more information,
see Enable stop protection (p. 583).
• Monitoring: Select this check box to turn on detailed monitoring of your instance using Amazon
CloudWatch. Additional charges apply. For more information, see Monitor your instances using
CloudWatch (p. 1137).
• EBS-optimized instance: An Amazon EBS-optimized instance uses an optimized configuration stack
and provides additional, dedicated capacity for Amazon EBS I/O. If the instance type supports this
feature, select this check box to enable it. Additional charges apply. For more information, see Amazon
EBS–optimized instances (p. 1752).
• Tenancy: If you are launching your instance into a VPC, you can choose to run your instance on
isolated, dedicated hardware (Dedicated) or on a Dedicated Host (Dedicated host). Additional charges
may apply. For more information, see Dedicated Instances (p. 486) and Dedicated Hosts (p. 446).
• T2/T3 Unlimited: Select this check box to enable applications to burst beyond the baseline for as
long as needed. Additional charges may apply. For more information, see Burstable performance
instances (p. 234).
• Network interfaces: If you selected a specific subnet, you can specify up to two network interfaces for
your instance:
• For Network Interface, select New network interface to let AWS create a new interface, or select an
existing, available network interface.
• For Primary IP, enter a private IPv4 address from the range of your subnet, or leave Auto-assign to
let AWS choose a private IPv4 address for you.
551
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• For Secondary IP addresses, choose Add IP to assign more than one private IPv4 address to the
selected network interface.
• (IPv6-only) For IPv6 IPs, choose Add IP, and enter an IPv6 address from the range of the subnet, or
leave Auto-assign to let AWS choose one for you.
• Network Card Index: The index of the network card. The primary network interface must be
assigned to network card index 0. Some instance types support multiple network cards.
• Choose Add Device to add a secondary network interface. A secondary network interface can reside
in a different subnet of the VPC, provided it's in the same Availability Zone as your instance.
For more information, see Elastic network interfaces (p. 1245). If you specify more than one network
interface, your instance cannot receive a public IPv4 address. Additionally, if you specify an existing
network interface for eth0, you cannot override the subnet's public IPv4 setting using Auto-assign
Public IP. For more information, see Assign a public IPv4 address during instance launch (p. 1193).
• Kernel ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific
kernel.
• RAM disk ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific
RAM disk. If you have selected a kernel, you may need to select a specific RAM disk with the drivers to
support it.
• Enclave: Select Enable to enable the instance for AWS Nitro Enclaves. For more information, see What
is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide.
• Metadata accessible: You can enable or disable access to the Instance Metadata Service (IMDS). For
more information, see Use IMDSv2 (p. 818).
• Metadata transport: Enable the instance to reach the link local IMDSv2 IPv6 address
(fd00:ec2::254) to retrieve instance metadata. This option is only available if you are launching
Instances built on the Nitro System (p. 210) into an IPv6-only subnet. For more information about
retrieving instance metadata, see Retrieve instance metadata (p. 831).
• Metadata version: If you enable access to the IMDS, you can choose to require the use of Instance
Metadata Service Version 2 when requesting instance metadata. For more information, see Configure
instance metadata options for new instances (p. 824).
• Metadata token response hop limit: If you enable the IMDS, you can set the allowable number of
network hops for the metadata token. For more information, see Use IMDSv2 (p. 818).
• User data: You can specify user data to configure an instance during launch, or to run a configuration
script. To attach a file, select the As file option and browse for the file to attach.
The AMI you selected includes one or more volumes of storage, including the root device volume. On the
Add Storage page, you can specify additional volumes to attach to the instance by choosing Add New
Volume. Configure each volume as follows, and then choose Next: Add Tags.
• Type: Select instance store or Amazon EBS volumes to associate with your instance. The types of
volume available in the list depend on the instance type you've chosen. For more information, see
Amazon EC2 instance store (p. 1805) and Amazon EBS volumes (p. 1517).
• Device: Select from the list of available device names for the volume.
• Snapshot: Enter the name or ID of the snapshot from which to restore a volume. You can also search
for available shared and public snapshots by typing text into the Snapshot field. Snapshot descriptions
are case-sensitive.
• Size: For EBS volumes, you can specify a storage size. Even if you have selected an AMI and
instance that are eligible for the free tier, to stay within the free tier, you must stay under 30 GiB
of total storage. For more information, see Constraints on the size and configuration of an EBS
volume (p. 1536).
• Volume Type: For EBS volumes, select a volume type. For more information, see Amazon EBS volume
types (p. 1520).
552
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• IOPS: If you have selected a Provisioned IOPS SSD volume type, then you can enter the number of I/O
operations per second (IOPS) that the volume can support.
• Delete on Termination: For Amazon EBS volumes, select this check box to delete the volume when
the instance is terminated. For more information, see Preserve Amazon EBS volumes on instance
termination (p. 604).
• Encrypted: If the instance type supports EBS encryption, you can specify the encryption state of the
volume. If you have enabled encryption by default in this Region, the default customer managed key
is selected for you. You can select a different key or disable encryption. For more information, see
Amazon EBS encryption (p. 1732).
• To select an existing security group, choose Select an existing security group, and select your security
group. You can't edit the rules of an existing security group, but you can copy them to a new group by
choosing Copy to new. Then you can add rules as described in the next step.
• To create a new security group, choose Create a new security group. The wizard automatically defines
the launch-wizard-x security group and creates an inbound rule to allow you to connect to your
instance over RDP (port 3389).
• You can add rules to suit your needs. For example, if your instance is a web server, open ports 80
(HTTP) and 443 (HTTPS) to allow internet traffic.
To add a rule, choose Add Rule, select the protocol to open to network traffic, and then specify the
source. Choose My IP from the Source list to let the wizard add your computer's public IP address.
However, if you are connecting through an ISP or from behind your firewall without a static IP address,
you need to find out the range of IP addresses used by client computers.
Warning
Rules that enable all IP addresses (0.0.0.0/0) to access your instance over SSH or RDP are
acceptable for this short exercise, but are unsafe for production environments. You should
authorize only a specific IP address or range of addresses to access your instance.
In the Select an existing key pair or create a new key pair dialog box, you can choose an existing
key pair, or create a new one. For example, choose Choose an existing key pair, then select the key
pair you created when getting set up. For more information, see Amazon EC2 key pairs and Windows
instances (p. 1476).
Important
If you choose the Proceed without key pair option, you won't be able to connect to the instance
unless you choose an AMI that is configured to allow users another way to log in.
553
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
To launch your instance, select the acknowledgment check box, then choose Launch Instances.
(Optional) You can create a status check alarm for the instance (additional fees may apply). On the
confirmation screen, choose Create status check alarms and follow the directions. Status check alarms
can also be created after you launch the instance. For more information, see Create and edit status check
alarms (p. 1111).
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
For each launch template, you can create one or more numbered launch template versions. Each version
can have different launch parameters. When you launch an instance from a launch template, you can
use any version of the launch template. If you do not specify a version, the default version is used. You
can set any version of the launch template as the default version—by default, it's the first version of the
launch template.
The following diagram shows a launch template with three versions. The first version specifies the
instance type, AMI ID, subnet, and key pair to use to launch the instance. The second version is based
on the first version and also specifies a security group for the instance. The third version uses different
values for some of the parameters. Version 2 is set as the default version. If you launched an instance
from this launch template, the launch parameters from version 2 would be used if no other version were
specified.
Contents
• Launch template restrictions (p. 554)
• Use launch templates to control launching instances (p. 555)
• Create a launch template (p. 556)
• Modify a launch template (manage launch template versions) (p. 569)
• Delete a launch template (p. 572)
• Launch instances from a launch template (p. 572)
554
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Quotas – To view the quotas for your launch templates and launch template versions, open the Service
Quotas console or use the list-service-quotas AWS CLI command. Each AWS account can have up to a
maximum of 5,000 launch templates per Region and up to 10,000 versions per launch template. Your
accounts might have different quotas based on their age and usage history.
• Parameters are optional – Launch template parameters are optional. However, you must ensure that
your request to launch an instance includes all the required parameters. For example, if your launch
template does not include an AMI ID, you must specify both the launch template and an AMI ID when
you launch an instance.
• Parameters not validated – Launch template parameters are not fully validated when you create
the launch template. If you specify incorrect values for parameters, or if you do not use supported
parameter combinations, no instances can launch using this launch template. Ensure that you specify
the correct values for the parameters and that you use supported parameter combinations. For
example, to launch an instance in a placement group, you must specify a supported instance type.
• Tags – You can tag a launch template, but you cannot tag a launch template version.
• Immutable – Launch templates are immutable. To modify a launch template, you must create a new
version of the launch template.
• Version numbers – Launch template versions are numbered in the order in which they are created.
When you create a launch template version, you cannot specify the version number yourself.
A launch template can contain all or some of the parameters to launch an instance. When you launch an
instance using a launch template, you can override parameters that are specified in the launch template.
Or, you can specify additional parameters that are not in the launch template.
Note
You cannot remove launch template parameters during launch (for example, you cannot specify
a null value for the parameter). To remove a parameter, create a new version of the launch
template without the parameter and use that version to launch the instance.
To launch instances, users must have permissions to use the ec2:RunInstances action. Users must
also have permissions to create or use the resources that are created or associated with the instance. You
can use resource-level permissions for the ec2:RunInstances action to control the launch parameters
that users can specify. Alternatively, you can grant users permissions to launch an instance using a launch
template. This enables you to manage launch parameters in a launch template rather than in an IAM
policy, and to use a launch template as an authorization vehicle for launching instances. For example,
you can specify that users can only launch instances using a launch template, and that they can only use
a specific launch template. You can also control the launch parameters that users can override in the
launch template. For example policies, see Launch templates (p. 1437).
By default, users do not have permissions to work with launch templates. You can create a policy that
grants users permissions to create, modify, describe, and delete launch templates and launch template
versions. You can also apply resource-level permissions to some launch template actions to control a
user's ability to use specific resources for those actions. For more information, see the following example
policies: Example: Work with launch templates (p. 1448).
Take care when granting users permissions to use the ec2:CreateLaunchTemplate and
ec2:CreateLaunchTemplateVersion actions. You cannot use resource-level permissions to control
555
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
which resources users can specify in the launch template. To restrict the resources that are used to
launch an instance, ensure that you grant permissions to create launch templates and launch template
versions only to appropriate administrators.
Tasks
• Create a new launch template using parameters you define (p. 556)
• Create a launch template from an existing launch template (p. 564)
• Create a launch template from an instance (p. 565)
• Use a Systems Manager parameter instead of an AMI ID (p. 566)
You can create a launch template using the console or the AWS CLI:
• Console (p. 556)
• AWS CLI (p. 563)
Console
To create a launch template, you must specify the launch template name and at least one instance
configuration parameter.
The launch template parameters are grouped in the launch template. The following instructions take you
through each parameter group.
1. For Launch template name, enter a descriptive name for the launch template.
2. For Template version description, provide a brief description of this version of the launch template.
556
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
3. To tag (p. 1894) the launch template on creation, expand Template tags, choose Add tag, and then
enter a tag key and value pair. Choose Add tag again for each additional tag to add.
Note
To tag the resources that are created when an instance is launched, you must specify the
tags under Resource tags. For more information, see Resource tags (p. 561).
An Amazon Machine Image (AMI) contains the information required to create an instance. For example,
an AMI might contain the software that's required to act as a web server, such as Windows, Apache, and
your website.
You can find a suitable AMI as follows. With each option for finding an AMI, you can choose Cancel (at
top right) to return to the launch template without choosing an AMI.
Search bar
To search through all available AMIs, enter a keyword in the AMI search bar and then press Enter. To
select an AMI, choose Select.
Recents
Choose Recently launched or Currently in use, and then, from Amazon Machine Image (AMI),
select an AMI.
My AMIs
The private AMIs that you own, or private AMIs that have been shared with you.
Choose Owned by me or Shared with me, and then, from Amazon Machine Image (AMI), select an
AMI.
Quick Start
AMIs are grouped by operating system (OS) to help you get started quickly.
First select the OS that you need, and then, from Amazon Machine Image (AMI), select an AMI. To
select an AMI that is eligible for the free tier, make sure that the AMI is marked Free tier eligible.
Browse more AMIs
The AWS Marketplace is an online store where you can buy software that runs on AWS, including
AMIs. For more information about launching an instance from the AWS Marketplace, see Launch
an AWS Marketplace instance (p. 578). In Community AMIs, you can find AMIs that AWS
community members have made available for others to use. AMIs from Amazon or a verified
partner are marked Verified provider.
557
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• To filter the list of AMIs, select one or more check boxes under Refine results on the left of the
screen. The filter options are different depending on the selected search category.
• Check the Virtualization type listed for each AMI. Notice which AMIs are the type that you need:
either hvm or paravirtual. For example, some instance types require HVM.
• Check the Boot mode listed for each AMI. Notice which AMIs use the boot mode that you need:
either legacy-bios, uefi, or uefi-preferred. For more information, see Boot modes (p. 21).
• Choose an AMI that meets your needs, and then choose Select.
Instance type
The instance type defines the hardware configuration and size of the instance. Larger instance types have
more CPU and memory. For more information, see Instance types.
For Instance type, you can either select an instance type, or you can specify instance attributes and let
Amazon EC2 identify the instance types with those attributes.
Note
Specifying instance attributes is supported only when using Auto Scaling groups, EC2 Fleet,
and Spot Fleet to launch instances. For more information, see Creating an Auto Scaling group
using attribute-based instance type selection, Attribute-based instance type selection for EC2
Fleet (p. 940), and Attribute-based instance type selection for Spot Fleet (p. 984).
If you plan to use the launch template in the launch instance wizard (p. 539) or with the
RunInstances API, you must select an instance type.
• Instance type: Ensure that the instance type is compatible with the AMI that you've specified. For more
information, see Instance types (p. 202).
• Compare instance types: You can compare different instance types by the following attributes:
number of vCPUs, architecture, amount of memory (GiB), amount of storage (GB), storage type, and
network performance.
• Advanced: To specify instance attributes and let Amazon EC2 identify the instance types with those
attributes, choose Advanced, and then choose Specify instance type attributes.
• Number of vCPUs: Enter the minimum and maximum number of vCPUs for your compute
requirements. To indicate no limits, enter a minimum of 0, and leave the maximum blank.
• Amount of memory (MiB): Enter the minimum and maximum amount of memory, in MiB, for your
compute requirements. To indicate no limits, enter a minimum of 0, and leave the maximum blank.
• Expand Optional instance type attributes and choose Add attribute to express
your compute requirements in more detail. For information about each attribute, see
InstanceRequirementsRequest in the Amazon EC2 API Reference.
• Resulting instance types: You can preview the instance types that match the specified attributes. To
exclude instance types, choose Add attribute, and from the Attribute list, choose Excluded instance
types. From the Attribute value list, select the instance types to exclude.
For Key pair name, choose an existing key pair, or choose Create new key pair to create a new one. For
more information, see Amazon EC2 key pairs and Windows instances (p. 1476).
Network settings
• Subnet: You can launch an instance in a subnet associated with an Availability Zone, Local Zone,
Wavelength Zone, or Outpost.
558
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
To launch the instance in an Availability Zone, select the subnet in which to launch your instance. To
create a new subnet, choose Create new subnet to go to the Amazon VPC console. When you are
done, return to the wizard and choose the Refresh icon to load your subnet in the list.
To launch the instance in a Local Zone, select a subnet that you created in the Local Zone.
To launch an instance in an Outpost, select a subnet in a VPC that you associated with the Outpost.
• Firewall (security groups): Use one or more security groups to define firewall rules for your instance.
These rules specify which incoming network traffic is delivered to your instance. All other traffic is
ignored. For more information about security groups, see Amazon EC2 security groups for Windows
instances (p. 1488).
If you add a network interface, you must specify the same security groups in the network interface.
You can add rules to suit your needs. For example, if your instance will be a web server, open ports
80 (HTTP) and 443 (HTTPS) to allow internet traffic.
To add a rule, choose Add security group rule. For Type, select the network traffic type. The
Protocol field is automatically filled in with the protocol to open to network traffic. For Source type,
select the source type. To let the launch template add your computer's public IP address, choose My
IP. However, if you are connecting through an ISP or from behind your firewall without a static IP
address, you need to find out the range of IP addresses used by client computers.
Warning
Rules that enable all IP addresses (0.0.0.0/0) to access your instance over SSH or RDP are
acceptable if you are briefly launching a test instance and will stop or terminate it soon, but
are unsafe for production environments. You should authorize only a specific IP address or
range of addresses to access your instance.
• Advanced network configuration
Network interface
• Device index: The device number for the network interface, for example, eth0 for the primary
network interface. If you leave the field blank, AWS creates the primary network interface.
• Network interface: Select New interface to let Amazon EC2 create a new interface, or select an
existing, available network interface.
• Description: (Optional) A description for the new network interface.
• Subnet: The subnet in which to create the new network interface. For the primary network interface
(eth0), this is the subnet in which the instance is launched. If you've entered an existing network
interface for eth0, the instance is launched in the subnet in which the network interface is located.
• Security groups: One or more security groups in your VPC with which to associate the network
interface.
• Auto-assign public IP: Specify whether your instance receives a public IPv4 address. By default,
instances in a default subnet receive a public IPv4 address and instances in a nondefault subnet do
not. You can select Enable or Disable to override the subnet's default setting. For more information,
see Public IPv4 addresses (p. 1190).
• Primary IP: A private IPv4 address from the range of your subnet. Leave blank to let Amazon EC2
choose a private IPv4 address for you.
• Secondary IP: One or more additional private IPv4 addresses from the range of your subnet. Choose
Manually assign and enter an IP address. Choose Add IP to add another IP address. Alternatively,
559
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
choose Automatically assign to let Amazon EC2 choose one for you, and enter a value to indicate
the number of IP addresses to add.
• (IPv6-only) IPv6 IPs: An IPv6 address from the range of the subnet. Choose Manually assign and
enter an IP address. Choose Add IP to add another IP address. Alternatively, choose Automatically
assign to let Amazon EC2 choose one for you, and enter a value to indicate the number of IP
addresses to add.
• IPv4 Prefixes: The IPv4 prefixes for the network interface.
• IPv6 Prefixes: The IPv6 prefixes for the network interface.
• Delete on termination: Whether the network interface is deleted when the instance is deleted.
• Elastic Fabric Adapter: Indicates whether the network interface is an Elastic Fabric Adapter. For
more information, see Elastic Fabric Adapter.
• Network card index: The index of the network card. The primary network interface must be
assigned to network card index 0. Some instance types support multiple network cards.
Choose Add network interface to add more network interfaces. The number of network interfaces
that you can add depends on the number that is supported by the selected instance type. A secondary
network interface can reside in a different subnet of the VPC, provided it's in the same Availability
Zone as your instance.
For more information, see Elastic network interfaces (p. 1245). If you specify more than one network
interface, your instance cannot receive a public IPv4 address. Additionally, if you specify an existing
network interface for eth0, you cannot override the subnet's public IPv4 setting using Auto-assign
Public IP. For more information, see Assign a public IPv4 address during instance launch (p. 1193).
Configure storage
If you specify an AMI for the launch template, the AMI includes one or more volumes of storage,
including the root volume (Volume 1 (AMI Root)). You can specify additional volumes to attach to the
instance.
You can use the Simple or Advanced view. With the Simple view, you specify the size and type of
volume. To specify all volume parameters, choose the Advanced view (at top right of the card).
By using the Advanced view, you can configure each volume as follows:
• Storage type: The type of volume (EBS or ephemeral) to associate with your instance. The instance
store (ephemeral) volume type is only available if you select an instance type that supports it. For
more information, see Amazon EC2 instance store (p. 1805) and Amazon EBS volumes (p. 1517).
• Device name: Select from the list of available device names for the volume.
• Snapshot: Select the snapshot from which to create the volume. You can search for available shared
and public snapshots by entering text into the Snapshot field.
• Size (GiB): For EBS volumes, you can specify a storage size. If you have selected an AMI and instance
that are eligible for the free tier, keep in mind that to stay within the free tier, you must stay under 30
GiB of total storage. For more information, see Constraints on the size and configuration of an EBS
volume (p. 1536).
• Volume type: For EBS volumes, select a volume type. For more information, see Amazon EBS volume
types (p. 1520).
• IOPS: If you have selected a Provisioned IOPS SSD (io1 and io2) or General Purpose SSD (gp3)
volume type, then you can enter the number of I/O operations per second (IOPS) that the volume can
support. This is required for io1, io2, and gp3 volumes. It is not supported for gp2, st1, sc1, or standard
volumes. If you omit this paramater for the launch template, you must specify a value for it when you
launch an instance from the launch template.
560
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Delete on termination: For Amazon EBS volumes, choose Yes to delete the volume when the instance
is terminated, or choose No to keep the volume. For more information, see Preserve Amazon EBS
volumes on instance termination (p. 604).
• Encrypted: If the instance type supports EBS encryption, you can choose Yes to enable encryption for
the volume. If you have enabled encryption by default in this Region, encryption is enabled for you.
For more information, see Amazon EBS encryption (p. 1732).
• KMS key: If you selected Yes for Encrypted, then you must select a customer managed key to use to
encrypt the volume. If you have enabled encryption by default in this Region, the default customer
managed key is selected for you. You can select a different key or specify the ARN of any customer
managed key that you created.
Resource tags
To tag (p. 1894) the resources that are created when an instance is launched, under Resource tags,
choose Add tag, and then enter a tag key and value pair. For Resource types, specify the resources to
tag on creation. You can specify the same tag for all the resources, or specify different tags for different
resources. Choose Add tag again for each additional tag to add.
You can specify tags for the following resources that are created when a launch template is used:
• Instances
• Volumes
• Elastic graphics
• Spot Instance requests
• Network interfaces
Note
To tag the launch template itself, you must specify the tags under Template tags. For more
information, see Launch template name, description, and tags (p. 556).
Advanced details
For Advanced details, expand the section to view the fields and specify any additional parameters for
the instance.
• Purchasing option: Choose Request Spot Instances to request Spot Instances at the Spot price,
capped at the On-Demand price, and choose Customize to change the default Spot Instance settings.
You can set your maximum price (not recommended), and change the request type, request duration,
and interruption behavior. If you do not request a Spot Instance, EC2 launches an On-Demand Instance
by default. For more information, see Spot Instances (p. 382).
• IAM instance profile: Select an AWS Identity and Access Management (IAM) instance profile to
associate with the instance. For more information, see IAM roles for Amazon EC2 (p. 1462).
• Hostname type: Select whether the guest OS hostname of the instance will include the resource name
or the IP name. For more information, see Amazon EC2 instance hostname types (p. 1204).
• DNS Hostname: Determines if the DNS queries to the resource name or the IP name (depending on
what you selected for Hostname type) will respond with the IPv4 address (A record), IPv6 address
(AAAA record), or both. For more information, see Amazon EC2 instance hostname types (p. 1204).
• Shutdown behavior: Select whether the instance should stop or terminate when shut down. For more
information, see Change the instance initiated shutdown behavior (p. 603).
• Stop - Hibernate behavior: To enable hibernation, choose Enable. This field is only valid for instances
that meet the hibernation prerequisites. For more information, see Hibernate your On-Demand
Windows instance (p. 586).
• Termination protection: To prevent accidental termination, choose Enable. For more information, see
Enable termination protection (p. 602).
561
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Stop protection: To prevent accidental stopping, choose Enable. For more information, see Enable
stop protection (p. 583).
• Detailed CloudWatch monitoring: Choose Enable to enable detailed monitoring of the instance using
Amazon CloudWatch. Additional charges apply. For more information, see Monitor your instances
using CloudWatch (p. 1137).
• Elastic GPU: Select an Elastic Graphics accelerator to attach to the instance. Not all instance types
support Elastic Graphics. For more information, see Amazon Elastic Graphics (p. 1089).
• Elastic inference: An elastic inference accelerator to attach to your EC2 CPU instance. For more
information, see Working with Amazon Elastic Inference in the Amazon Elastic Inference Developer
Guide.
Note
Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference
(EI), and will help current customers migrate their workloads to options that offer better
price and performance. After April 15, 2023, new customers will not be able to launch
instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2.
However, customers who have used Amazon EI at least once during the past 30-day period are
considered current customers and will be able to continue using the service.
• Credit specification: Choose Unlimited to enable applications to burst beyond the baseline for as long
as needed. This field is only valid for T instances. Additional charges may apply. For more information,
see Burstable performance instances (p. 234).
• Placement group name: Specify a placement group in which to launch the instance. You can select an
existing placement group, or create a new one. Not all instance types can be launched in a placement
group. For more information, see Placement groups (p. 1302).
• EBS-optimized instance: Select Enable to provide additional, dedicated capacity for Amazon EBS I/
O. Not all instance types support this feature. Additional charges apply. For more information, see
Amazon EBS–optimized instances (p. 1752).
• Capacity Reservation: Specify whether to launch the instance into any open Capacity Reservation
(Open), a specific Capacity Reservation (Target by ID), or a Capacity Reservation group (Target
by group). To specify that a Capacity Reservation should not be used, choose None. For more
information, see Launch instances into an existing Capacity Reservation (p. 497).
• Tenancy: Choose whether to run your instance on shared hardware (Shared), isolated, dedicated
hardware (Dedicated), or on a Dedicated Host (Dedicated host). If you choose to launch the instance
onto a Dedicated Host, you can specify whether to launch the instance into a host resource group or
you can target a specific Dedicated Host. Additional charges may apply. For more information, see
Dedicated Instances (p. 486) and Dedicated Hosts (p. 446).
• RAM disk ID: (Only valid for paravirtual (PV) AMIs) Select a RAM disk for the instance. If you have
selected a kernel, you might need to select a specific RAM disk with the drivers to support it.
• Kernel ID: (Only valid for paravirtual (PV) AMIs) Select a kernel for the instance.
• Nitro Enclave: Allows you to create isolated execution environments, called enclaves, from Amazon
EC2 instances. Select Enable to enable the instance for AWS Nitro Enclaves. For more information, see
What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide.
• License configurations: You can launch instances against the specified license configuration to track
your license usage. For more information, see Create a license configuration in the AWS License
Manager User Guide.
• Specify CPU options: Choose Specify CPU options to specify a custom number of vCPUs during
launch. Set the number of CPU cores and threads per core. For more information, see Optimize CPU
options (p. 762).
• Metadata transport: You can enable or disable the access method to the Instance Metadata Service
(IMDS) that's available for this EC2 instance based on the IP address type (IPv4, IPv6, or IPv4 and IPv6)
of the instance. For more information, see Retrieve instance metadata (p. 831).
• Metadata accessible: You can enable or disable access to the IMDS. For more information, see
Configure instance metadata options for new instances (p. 824).
562
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
• Metadata version: If you enable access to the IMDS, you can choose to require the use of Instance
Metadata Service Version 2 when requesting instance metadata. For more information, see Configure
instance metadata options for new instances (p. 824).
• Metadata response hop limit: If you enable the IMDS, you can set the allowable number of network
hops for the metadata token. For more information, see Configure instance metadata options for new
instances (p. 824).
• Allow tags in metadata: If you select Enable, the instance will allow access to all of its instance's
tags from its metadata. If you do not include this setting in the template, by default, access to the
tags in instance metadata is not allowed. For more information, see Allow access to tags in instance
metadata (p. 1906).
• User data: You can specify user data to configure an instance during launch, or to run a configuration
script. For more information, see Run commands on your Windows instance at launch (p. 809).
Summary
Use the Summary panel to review your launch template configuration and to create your launch
template.
• Review the details of your launch template, and make any necessary changes. You can navigate
directly to a section by choosing its link in the Summary panel.
• When you're ready to create your launch template, choose Create launch template.
AWS CLI
To create a launch template, you must specify the launch template name and at least one instance
configuration parameter.
• Use the create-launch-template command. The following example creates a launch template that
specifies the following:
The following is an example JSON file that contains the launch template data for the instance
configuration.
563
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
"NetworkInterfaces": [{
"AssociatePublicIpAddress": true,
"DeviceIndex": 0,
"Ipv6AddressCount": 1,
"SubnetId": "subnet-7b16de0c"
}],
"ImageId": "ami-8c1be5f6",
"InstanceType": "r4.4xlarge",
"TagSpecifications": [{
"ResourceType": "instance",
"Tags": [{
"Key":"Name",
"Value":"webserver"
}]
}],
"CpuOptions": {
"CoreCount":4,
"ThreadsPerCore":2
}
}
{
"LaunchTemplate": {
"LatestVersionNumber": 1,
"LaunchTemplateId": "lt-01238c059e3466abc",
"LaunchTemplateName": "TemplateForWebServer",
"DefaultVersionNumber": 1,
"CreatedBy": "arn:aws:iam::123456789012:root",
"CreateTime": "2017-11-27T09:13:24.000Z"
}
}
You can clone an existing launch template and then adjust the parameters to create a new launch
template. However, you can only do this when using the Amazon EC2 console; the AWS CLI does not
support cloning a template.
Console
564
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Console
AWS CLI
You can use the AWS CLI to create a launch template from an existing instance by first getting
the launch template data from an instance, and then creating a launch template using the launch
template data.
• Use the get-launch-template-data command and specify the instance ID. You can use the output
as a base to create a new launch template or launch template version. By default, the output
includes a top-level LaunchTemplateData object, which cannot be specified in your launch
template data. Use the --query option to exclude this object.
{
"Monitoring": {},
"ImageId": "ami-8c1be5f6",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": true
}
}
],
"EbsOptimized": false,
"Placement": {
"Tenancy": "default",
"GroupName": "",
"AvailabilityZone": "us-east-1a"
},
"InstanceType": "t2.micro",
"NetworkInterfaces": [
{
"Description": "",
"NetworkInterfaceId": "eni-35306abc",
"PrivateIpAddresses": [
{
565
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
"Primary": true,
"PrivateIpAddress": "10.0.0.72"
}
],
"SubnetId": "subnet-7b16de0c",
"Groups": [
"sg-7c227019"
],
"Ipv6Addresses": [
{
"Ipv6Address": "2001:db8:1234:1a00::123"
}
],
"PrivateIpAddress": "10.0.0.72"
}
]
}
• Use the create-launch-template command to create a launch template using the output from
the previous procedure. For more information about creating a launch template using the AWS
CLI, see Create a new launch template using parameters you define (p. 556).
Instead of specifying an AMI ID in your launch templates, you can specify an AWS Systems Manager
parameter. If the AMI ID changes, you can update the AMI ID in one place by updating the Systems
Manager parameter in the Systems Manager Parameter Store. By using a Systems Manager parameter, all
your launch templates can be updated in a single action.
A Systems Manager parameter is a user-defined key-value pair that you create in the Systems Manager
Parameter Store. The Parameter Store provides a central place to store your application configuration
values. For more information, see AWS Systems Manager Parameter Store in the AWS Systems Manager
User Guide.
In the following diagram, the golden-ami parameter is first mapped to the original AMI ami-
aabbccddeeffgghhi in the Parameter Store. In the launch template, the value for the AMI ID is
golden-ami. When an instance is launched using this launch template, the AMI ID resolves to ami-
aabbccddeeffgghhi. Later, the AMI is updated resulting in a new AMI ID. In the Parameter Store, the
golden-ami parameter is mapped to the new ami-00112233445566778. The launch template remains
unchanged. When an instance is launched using this launch template, the AMI ID resolves to the new
ami-00112233445566778.
566
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Launch templates require that user-defined Systems Manager parameters adhere to the following
format when used in place of an AMI ID:
For more information about creating a valid parameter for an AMI ID, see Creating Systems Manager
parameters in the AWS Systems Manager User Guide.
To use a Systems Manager parameter in place of an AMI ID in a launch template, you must use one of the
following formats when specifying the parameter in the launch template:
• resolve:ssm:parameter-name
• resolve:ssm:parameter-name:version-number – The version number itself is a default label
• resolve:ssm:parameter-name:label
Parameter versions
Systems Manager parameters are versioned resources. When you update a parameter, you create new,
successive versions of the parameter. Systems Manager supports parameter labels that you can map to
specific versions of a parameter.
For example, the golden-ami parameter can have three versions: 1, 2, and 3. You can create a
parameter label beta that maps to version 2, and a parameter label prod that maps to version 3.
In a launch template, you can specify version 3 of the golden-ami parameter by using either of the
following formats:
• resolve:ssm:golden-ami:3
• resolve:ssm:golden-ami:prod
Specifying the version or label is optional. If a version or label is not specified, the latest version of the
parameter is used.
You can specify a Systems Manager parameter in a launch template instead of an AMI ID when you
create a launch template or a new version of a launch template.
567
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Console
a. For AMI ID or Systems Manager parameter string, enter the Systems Manager parameter
name using one of the following formats:
• resolve:ssm:parameter-name
• resolve:ssm:parameter-name:version-number
• resolve:ssm:parameter-name:label
b. Choose Save.
7. Specify any other launch template parameters as needed, and then choose Create launch
template.
For more information, see Create a new launch template using parameters you define (p. 556).
AWS CLI
• Use the create-launch-template command to create the launch template. To specify the AMI to
use, enter the Systems Manager parameter name using one of the following formats:
• resolve:ssm:parameter-name
• resolve:ssm:parameter-name:version-number
• resolve:ssm:parameter-name:label
The following example creates a launch template that specifies the following:
568
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
The following is an example JSON file that contains the launch template data for the instance
configuration. The value for ImageId is the Systems Manager parameter name, entered in the
required format resolve:ssm:golden-ami.
{"LaunchTemplateData": {
"ImageId": "resolve:ssm:golden-ami",
"InstanceType": "m5.4xlarge",
"TagSpecifications": [{
"ResourceType": "instance",
"Tags": [{
"Key":"Name",
"Value":"webserver"
}]
}]
}
}
Limitations
• Currently, EC2 Fleets and Spot Fleets do not support using a launch template that has a Systems
Manager parameter specified in place of an AMI ID. For EC2 Fleets and Spot Fleets, if you specify an
AMI in the launch template, you must specify the AMI ID.
• There are also limitations for Auto Scaling groups that use a launch template that specifies a Systems
Manager parameter instead of an AMI ID. For more information, see Limitations in the Amazon EC2
Auto Scaling User Guide.
You can create different versions of a launch template, set the default version, describe a launch
template version, and delete versions that you no longer require.
Tasks
• Create a launch template version (p. 569)
• Set the default launch template version (p. 570)
• Describe a launch template version (p. 570)
• Delete a launch template version (p. 571)
When you create a launch template version, you can specify new launch parameters or use an existing
version as the base for the new version. For more information about the launch parameters, see Create a
launch template (p. 556).
Console
569
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
4. For Template version description, enter a description for this version of the launch template.
5. (Optional) Expand Source template and select a version of the launch template to use as a
base for the new launch template version. The new launch template version inherits the launch
parameters from this launch template version.
6. Modify the launch parameters as required, and choose Create launch template.
AWS CLI
• Use the create-launch-template-version command. You can specify a source version on which to
base the new version. The new version inherits the launch parameters from this version, and you
can override parameters using --launch-template-data. The following example creates a
new version based on version 1 of the launch template and specifies a different AMI ID.
You can set the default version for the launch template. When you launch an instance from a launch
template and do not specify a version, the instance is launched using the parameters of the default
version.
Console
AWS CLI
• Use the modify-launch-template command and specify the version that you want to set as the
default.
Using the console, you can view all the versions of the selected launch template, or get a list of the
launch templates whose latest or default version matches a specific version number. Using the AWS CLI,
570
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
you can describe all versions, individual versions, or a range of versions of a specified launch template.
You can also describe all the latest versions or all the default versions of all the launch templates in your
account.
Console
AWS CLI
• Use the describe-launch-template-versions command and specify the version numbers. In the
following example, versions 1 and 3 are specified.
To describe all the latest and default launch template versions in your account
If you no longer require a launch template version, you can delete it. You cannot replace the version
number after you delete it. You cannot delete the default version of the launch template; you must first
assign a different version as the default. To delete all the launch template versions in a single action, see
Delete a launch template (p. 572).
Console
571
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
AWS CLI
• Use the delete-launch-template-versions command and specify the version numbers to delete.
Console
AWS CLI
• Use the delete-launch-template (AWS CLI) command and specify the launch template.
Topics
• Launch an instance from a launch template (p. 572)
• Use launch templates with Amazon EC2 Auto Scaling (p. 575)
• Use launch templates with EC2 Fleet (p. 576)
• Use launch templates with Spot Fleet (p. 576)
You can use the parameters contained in a launch template to launch an instance. You have the option to
override or add launch parameters before you launch the instance.
572
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Instances that are launched using a launch template are automatically assigned two tags with the keys
aws:ec2launchtemplate:id and aws:ec2launchtemplate:version. You cannot remove or edit
these tags.
Console
AWS CLI
• Use the run-instances command and specify the --launch-template parameter. Optionally
specify the launch template version to use. If you don't specify the version, the default version is
used.
• To override a launch template parameter, specify the parameter in the run-instances command.
The following example overrides the instance type that's specified in the launch template (if any).
• If you specify a nested parameter that's part of a complex structure, the instance is launched using
the complex structure as specified in the launch template plus any additional nested parameters
that you specify.
In the following example, the instance is launched with the tag Owner=TeamA as well as any other
tags that are specified in the launch template. If the launch template has an existing tag with a
key of Owner, the value is replaced with TeamA.
In the following example, the instance is launched with a volume with the device name /dev/
xvdb as well as any other block device mappings that are specified in the launch template. If the
launch template has an existing volume defined for /dev/xvdb, its values are replaced with the
specified values.
573
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
PowerShell
To launch an instance from a launch template using the AWS Tools for PowerShell
• Use the New-EC2Instance command and specify the -LaunchTemplate parameter. Optionally
specify the launch template version to use. If you don't specify the version, the default version is
used.
Import-Module AWS.Tools.EC2
New-EC2Instance `
-LaunchTemplate (
New-Object -TypeName Amazon.EC2.Model.LaunchTemplateSpecification -Property
@{
LaunchTemplateId = 'lt-0abcd290751193123';
Version = '4'
}
)
Import-Module AWS.Tools.EC2
New-EC2Instance `
-InstanceType t4g.small `
-LaunchTemplate (
New-Object -TypeName Amazon.EC2.Model.LaunchTemplateSpecification -Property
@{
LaunchTemplateId = 'lt-0abcd290751193123';
Version = '4'
}
)
• If you specify a nested parameter that's part of a complex structure, the instance is launched using
the complex structure as specified in the launch template plus any additional nested parameters
that you specify.
In the following example, the instance is launched with the tag Owner=TeamA as well as any other
tags that are specified in the launch template. If the launch template has an existing tag with a
key of Owner, the value is replaced with TeamA.
Import-Module AWS.Tools.EC2
New-EC2Instance `
-InstanceType t4g.small `
-LaunchTemplate (
New-Object -TypeName Amazon.EC2.Model.LaunchTemplateSpecification -Property
@{
LaunchTemplateId = 'lt-0abcd290751193123';
Version = '4'
}
) `
-TagSpecification (
New-Object -TypeName Amazon.EC2.Model.TagSpecification -Property @{
ResourceType = 'instance';
Tags = @(
@{key = "Owner"; value = "TeamA" },
@{key = "Department"; value = "Operations" }
)
}
574
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
In the following example, the instance is launched with a volume with the device name /dev/
xvdb as well as any other block device mappings that are specified in the launch template. If the
launch template has an existing volume defined for /dev/xvdb, its values are replaced with the
specified values.
Import-Module AWS.Tools.EC2
New-EC2Instance `
-InstanceType t4g.small `
-LaunchTemplate (
New-Object -TypeName Amazon.EC2.Model.LaunchTemplateSpecification -Property
@{
LaunchTemplateId = 'lt-0abcd290751193123';
Version = '4'
}
) `
-BlockDeviceMapping (
New-Object -TypeName Amazon.EC2.Model.BlockDeviceMapping -Property @{
DeviceName = '/dev/xvdb';
EBS = (
New-Object -TypeName Amazon.EC2.Model.EbsBlockDevice -Property @{
VolumeSize = 25;
VolumeType = 'gp3'
}
)
}
)
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
Before you can create an Auto Scaling group using a launch template, you must create a launch template
that includes the parameters required to launch an instance in an Auto Scaling group, such as the ID
of the AMI. The console provides guidance to help you create a template that you can use with Auto
Scaling.
To create a launch template to use with Auto Scaling using the console
575
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
To create or update an Amazon EC2 Auto Scaling group with a launch template using the
AWS CLI
You can create an EC2 Fleet request and specify a launch template in the instance configuration. When
Amazon EC2 fulfills the EC2 Fleet request, it uses the launch parameters defined in the associated launch
template. You can override some of the parameters that are specified in the launch template.
To create an EC2 Fleet with a launch template using the AWS CLI
• Use the create-fleet command. Use the --launch-template-configs parameter to specify the
launch template and any overrides for the launch template.
You can create a Spot Fleet request and specify a launch template in the instance configuration. When
Amazon EC2 fulfills the Spot Fleet request, it uses the launch parameters defined in the associated
launch template. You can override some of the parameters that are specified in the launch template.
For more information, see Create a Spot Fleet request (p. 1012).
To create a Spot Fleet request with a launch template using the console
To create a Spot Fleet request with a launch template using the AWS CLI
• Use the request-spot-fleet command. Use the LaunchTemplateConfigs parameter to specify the
launch template and any overrides for the launch template.
576
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Note
The Launch more like this option does not clone your selected instance; it only replicates some
configuration details. To create a copy of your instance, first create an AMI from it, then launch
more instances from the AMI.
Alternatively, create a launch template (p. 554) to store the launch parameters for your
instances.
The following configuration details are copied from the selected instance into the launch instance
wizard:
• AMI ID
• Instance type
• Availability Zone, or the VPC and subnet in which the selected instance is located
• Public IPv4 address. If the selected instance currently has a public IPv4 address, the new instance
receives a public IPv4 address - regardless of the selected instance's default public IPv4 address
setting. For more information about public IPv4 addresses, see Public IPv4 addresses (p. 1190).
• Placement group, if applicable
• IAM role associated with the instance, if applicable
• Shutdown behavior setting (stop or terminate)
• Termination protection setting (true or false)
• CloudWatch monitoring (enabled or disabled)
• Amazon EBS-optimization setting (true or false)
• Tenancy setting, if launching into a VPC (shared or dedicated)
• Kernel ID and RAM disk ID, if applicable
• User data, if specified
• Tags associated with the instance, if applicable
• Security groups associated with the instance
• Association information. If the selected instance is associated with a configuration file, the same file
is automatically associated with the new instance. If the configuration file includes a joined domain
configuration, the new instance is joined to the same domain. For more information about joining
a domain, see Seamlessly Join a Windows EC2 Instance in the AWS Directory Service Administration
Guide.
The following configuration details are not copied from your selected instance. Instead, the wizard
applies their default settings or behavior:
• Number of network interfaces: The default is one network interface, which is the primary network
interface (eth0).
• Storage: The default storage configuration is determined by the AMI and the instance type.
When you are ready to launch your instance, choose Launch instance.
577
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
5. If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
New console
To launch an instance from the AWS Marketplace using the launch wizard
578
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch
Important
Check the vendor's usage instructions carefully, as you might need to use a specific user
name to connect to your instance. For information about accessing your subscription
details, see Manage your AWS Marketplace subscriptions (p. 142).
13. If the instance fails to launch or the state immediately goes to terminated instead of
running, see Troubleshoot instance launch issues (p. 1923).
Old console
To launch an instance from the AWS Marketplace using the launch wizard
The wizard creates a new security group according to the vendor's specifications for the product.
The security group may include rules that allow all IPv4 addresses (0.0.0.0/0) access on SSH
(port 22) on Linux or RDP (port 3389) on Windows. We recommend that you adjust these rules
to allow only a specific address or range of addresses to access your instance over those ports.
579
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
Important
Check the vendor's usage instructions carefully, as you may need to use a specific user
name to log in to the instance. For more information about accessing your subscription
details, see Manage your AWS Marketplace subscriptions (p. 142).
10. If the instance fails to launch or the state immediately goes to terminated instead of
running, see Troubleshoot instance launch issues (p. 1923).
Launch an AWS Marketplace AMI instance using the API and CLI
To launch instances from AWS Marketplace products using the API or command line tools, first ensure
that you are subscribed to the product. You can then launch an instance with the product's AMI ID using
the following methods:
Method Documentation
AWS CLI Use the run-instances command, or see the following topic for more
information: Launching an Instance.
AWS Tools for Windows Use the New-EC2Instance command, or see the following topic for
PowerShell more information: Launch an Amazon EC2 Instance Using Windows
PowerShell
When you stop an instance, we shut it down. We don't charge usage for a stopped instance, or data
transfer fees, but we do charge for the storage for any Amazon EBS volumes. Each time you start a
stopped instance we charge a minimum of one minute for usage. After one minute, we charge only for
the seconds you use. For example, if you run an instance for 20 seconds and then stop it, we charge for
a full one minute. If you run an instance for 3 minutes and 40 seconds, we charge for exactly 3 minutes
and 40 seconds of usage.
While the instance is stopped, you can treat its root volume like any other volume, and modify it (for
example, repair file system problems or update software). You just detach the volume from the stopped
instance, attach it to a running instance, make your changes, detach it from the running instance, and
then reattach it to the stopped instance. Make sure that you reattach it using the storage device name
that's specified as the root device in the block device mapping for the instance.
If you decide that you no longer need an instance, you can terminate it. As soon as the state of an
instance changes to shutting-down or terminated, we stop charging for that instance. For more
information, see Terminate your instance (p. 600). If you'd rather hibernate the instance, see Hibernate
your On-Demand Windows instance (p. 586). For more information, see Differences between reboot,
stop, hibernate, and terminate (p. 536).
Contents
• Overview (p. 581)
• What happens when you stop an instance (p. 581)
• What happens when you start an instance (p. 582)
• Stop and start your instances (p. 582)
• Stop and start your instances on a schedule (p. 583)
580
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
Overview
You can modify the following attributes of an instance only when it is stopped:
• Instance type
• User data
• Kernel
• RAM disk
If you try to modify these attributes while the instance is running, Amazon EC2 returns the
IncorrectInstanceState error.
By default, when you initiate a shutdown from an Amazon EBS-backed instance, the instance stops. You
can change this behavior so that it terminates instead. For more information, see Change the instance
initiated shutdown behavior (p. 603).
581
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
• Data stored in the Amazon EBS volumes. The EBS volumes remain attached to the instance.
• Private IPv4 addresses.
• IPv6 addresses.
• Elastic IP addresses associated with the instance. Note that when the instance is stopped, we start
charging you for the associated Elastic IP addresses (p. 1233).
For more information, see Differences between reboot, stop, hibernate, and terminate (p. 536).
• In most cases, the instance is migrated to a new underlying host computer (though in some cases, it
remains on the current host).
• Amazon EC2 assigns a new public IPv4 address to the instance if the instance is configured to receive a
public IPv4 address. (To retain a public IPv4 address that never changes, you can associate an Elastic IP
address (p. 1233) with your instance.)
For more information, see Differences between reboot, stop, hibernate, and terminate (p. 536).
Console
1. When you stop an instance, the data on any instance store volumes is erased. Before you stop an
instance, verify that you've copied any data that you need from your instance store volumes to
persistent storage, such as Amazon EBS or Amazon S3.
2. In the navigation pane, choose Instances and select the instance.
3. Choose Instance state, Stop instance. If this option is disabled, either the instance is already
stopped or its root device is an instance store volume.
4. When prompted for confirmation, choose Stop. It can take a few minutes for the instance to
stop.
5. (Optional) While your instance is stopped, you can modify certain instance attributes. For more
information, see modify-stopped-instance.
6. To start the stopped instance, select the instance, and choose Instance state, Start instance.
7. It can take a few minutes for the instance to enter the running state.
582
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
Command line
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
You can use AWS Fault Injection Simulator to test how your application responds when your instance is
stopped and started. For more information, see the AWS Fault Injection Simulator User Guide.
You can use Instance Scheduler on AWS to automate the starting and stopping of EC2 instances. For
more information, see How do I use Instance Scheduler with CloudFormation to schedule EC2 instances?
Note that additional charges apply.
You can use Lambda and an EventBridge rule to stop and start your instances on a schedule. For more
information, see How do I stop and start Amazon EC2 instances at regular intervals using Lambda?
The DisableApiStop attribute controls whether the instance can be stopped using the Amazon EC2
console, AWS CLI, or API. You can set the value of this attribute when you launch the instance, while the
instance is running, or while the instance is stopped.
The DisableApiStop attribute does not prevent you from stopping an instance by initiating shutdown
from the instance (using an operating system command for system shutdown).
Considerations
• Enabling stop protection does not prevent AWS from stopping the instance when the instance has a
scheduled event (p. 1114) that stops the instance.
• Stop protection not only prevents your instance from being accidentally stopped, but also from
accidental termination when using the console, AWS CLI, or API. However, it does not automatically
change the DisableApiTermination attribute. Note that when the DisableApiStop attribute
is set to false, the DisableApiTermination attribute is used to determine if the instance can be
terminated using the console, AWS CLI, or API.
• Enabling stop protection does not prevent Amazon EC2 Auto Scaling from terminating an instance
when the instance is unhealthy or during scale-in events.
• You cannot enable stop protection for instance store-backed instances.
583
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
Console
To enable stop protection, under Advanced details, for Stop protection, choose Enable.
AWS CLI
Use the run-instances AWS CLI command to launch the instance, and specify the disable-api-
stop parameter.
Console
AWS CLI
Use the modify-instance-attribute AWS CLI command and specify the disable-api-stop
parameter.
584
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Stop and start
Console
AWS CLI
Use the modify-instance-attribute AWS CLI command and specify the no-disable-api-stop
parameter.
• To change the instance type, see Change the instance type (p. 331).
• To change the user data for your instance, see Work with instance user data (p. 840).
• To enable or disable EBS–optimization for your instance, see Modifying EBS–Optimization (p. 1773).
• To change the DeleteOnTermination attribute of the root volume for your instance, see Update
the block device mapping of a running instance (p. 1841). You are not required to stop the instance to
change this attribute.
You can use one of the following commands. For more information about these command line interfaces
see Access Amazon EC2 (p. 3).
585
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
You can hibernate an instance only if it's enabled for hibernation (p. 590) and it meets the hibernation
prerequisites (p. 587).
If an instance or application takes a long time to bootstrap and build a memory footprint in order to
become fully productive, you can use hibernation to pre-warm the instance. To pre-warm the instance,
you:
You're not charged for instance usage for a hibernated instance when it is in the stopped state or for
data transfer when the contents of the RAM are transferred to the EBS root volume. You are charged for
storage of any EBS volumes, including storage for the RAM contents.
If you no longer need an instance, you can terminate it at any time, including when it is in a stopped
(hibernated) state. For more information, see Terminate your instance (p. 600).
Note
For information about using hibernation on Linux instances, see Hibernate your Linux instance in
the Amazon EC2 User Guide for Linux Instances.
This topic describes how to hibernate On-Demand Instances (including those that may be
covered by a Reserved Instance or a Capacity Reservation). For information about hibernating
Spot Instances, see Hibernate interrupted Spot Instances (p. 424).
Contents
• Overview of hibernation (p. 587)
• Hibernation prerequisites (p. 587)
• Limitations (p. 590)
586
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
Overview of hibernation
The following diagram shows a basic overview of the hibernation process.
• When you initiate hibernation, the instance moves to the stopping state. Amazon EC2 signals
the operating system to perform hibernation (suspend-to-disk). The hibernation freezes all of the
processes, saves the contents of the RAM to the EBS root volume, and then performs a regular
shutdown.
• After the shutdown is complete, the instance moves to the stopped state.
• Any EBS volumes remain attached to the instance, and their data persists, including the saved contents
of the RAM.
• Any Amazon EC2 instance store volumes remain attached to the instance, but the data on the instance
store volumes is lost.
• In most cases, the instance is migrated to a new underlying host computer when it's started. This is
also what happens when you stop and start an instance.
• When you start the instance, the instance boots up and the operating system reads in the contents of
the RAM from the EBS root volume, before unfreezing processes to resume its state.
• The instance retains its private IPv4 addresses and any IPv6 addresses. When you start the instance,
the instance continues to retain its private IPv4 addresses and any IPv6 addresses.
• Amazon EC2 releases the public IPv4 address. When you start the instance, Amazon EC2 assigns a new
public IPv4 address to the instance.
• The instance retains its associated Elastic IP addresses. You're charged for any Elastic IP addresses that
are associated with a hibernated instance. With EC2-Classic, an Elastic IP address is disassociated from
your instance when you hibernate it. For more information, see EC2-Classic (p. 1369).
• When you hibernate a ClassicLink instance, it's unlinked from the VPC to which it was linked. You must
link the instance to the VPC again after starting it. For more information, see ClassicLink (p. 1374).
For information about how hibernation differs from reboot, stop, and terminate, see Differences between
reboot, stop, hibernate, and terminate (p. 536).
Hibernation prerequisites
To hibernate an On-Demand Instance, the following prerequisites must be in place:
• Supported Windows AMIs (p. 588)
587
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
For information about the supported Linux AMIs, see Supported Linux AMIs in the Amazon EC2 User
Guide for Linux Instances.
To see the available instance types that support hibernation in a specific Region
The available instance types vary by Region. To see the available instance types that support hibernation
in a Region, use the describe-instance-types command with the --region parameter. Include the --
filters parameter to scope the results to the instance types that support hibernation and the --
query parameter to scope the output to the value of InstanceType.
Example output
c3.2xlarge
c3.4xlarge
c3.8xlarge
c3.large
c3.xlarge
c4.2xlarge
c4.4xlarge
c4.8xlarge
588
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
...
Instance size
Not supported for bare metal instances.
If you choose a Provisioned IOPS SSD volume type, you must provision the EBS volume with the
appropriate IOPS to achieve optimum performance for hibernation. For more information, see Amazon
EBS volume types (p. 1520).
Use one of the following three options to ensure that the root volume is an encrypted EBS volume:
• EBS encryption by default – You can enable EBS encryption by default to ensure that all new
EBS volumes created in your AWS account are encrypted. This way, you can enable hibernation for
your instances without specifying encryption intent at instance launch. For more information, see
Encryption by default (p. 1735).
• EBS "single-step" encryption – You can launch encrypted EBS-backed EC2 instances from an
unencrypted AMI and also enable hibernation at the same time. For more information, see Use
encryption with EBS-backed AMIs (p. 185).
• Encrypted AMI – You can enable EBS encryption by using an encrypted AMI to launch your instance.
If your AMI does not have an encrypted root snapshot, you can copy it to a new AMI and request
encryption. For more information, see Encrypt an unencrypted image during copy (p. 188) and Copy an
AMI (p. 160).
589
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
Purchasing options
This feature is available for On-Demand Instances, including those that have a Reserved Instance billing
discount applied to them. It is not available for Spot Instances. For information about hibernating a Spot
Instance, see Hibernate interrupted Spot Instances (p. 424).
Limitations
• When you hibernate an instance, the data on any instance store volumes is lost.
• You can't hibernate an instance that has more than 16 GB of RAM.
• If you create a snapshot or AMI from an instance that is hibernated or has hibernation enabled, you
might not be able to connect to a new instance that is launched from the AMI or from an AMI that was
created from the snapshot.
• You can't change the instance type or size of an instance when hibernation is enabled.
• You can't hibernate an instance that is in an Auto Scaling group or used by Amazon ECS. If your
instance is in an Auto Scaling group and you try to hibernate it, the Amazon EC2 Auto Scaling service
marks the stopped instance as unhealthy, and might terminate it and launch a replacement instance.
For more information, see Health Checks for Auto Scaling Instances in the Amazon EC2 Auto Scaling
User Guide.
• You can't hibernate an instance that is configured to boot in UEFI mode.
• If you hibernate an instance that was launched into a Capacity Reservation, the Capacity Reservation
does not ensure that the hibernated instance can resume after you try to start it.
• You can’t hibernate an instance that uses a kernel below 5.10 if Federal Information Processing
Standard (FIPS) mode is enabled.
• We do not support keeping an instance hibernated for more than 60 days. To keep the instance for
longer than 60 days, you must start the hibernated instance, stop the instance, and start it.
• We constantly update our platform with upgrades and security patches, which can conflict with
existing hibernated instances. We notify you about critical updates that require a start for hibernated
instances so that we can perform a shutdown or a reboot to apply the necessary upgrades and security
patches.
New console
1. Follow the procedure to launch an instance (p. 540), but don't launch the instance until you've
completed the following steps to enable hibernation.
2. To enable hibernation, configure the following fields in the launch instance wizard:
a. Under Application and OS Images (Amazon Machine Image), select an AMI that supports
hibernation. For more information, see Supported Windows AMIs (p. 588).
b. Under Instance type, select a supported instance type. For more information, see
Supported instance families (p. 588).
c. Under Configure storage, choose Advanced (at the right), and specify the following
information for the root volume:
590
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
• For Size (GiB), enter the EBS root volume size. The volume must be large enough to store
the RAM contents and accommodate your expected usage.
• For Volume type, select a supported EBS volume type: General Purpose SSD (gp2 and
gp3) or Provisioned IOPS SSD (io1 and io2).
• For Encrypted, choose Yes. If you enabled encryption by default in this AWS Region, Yes
is selected.
• For KMS key, select the encryption key for the volume. If you enabled encryption by
default in this AWS Region, the default encryption key is selected.
For more information about the prerequisites for the root volume, see Hibernation
prerequisites (p. 587).
d. Expand Advanced details, and for Stop - Hibernate behavior, choose Enable.
3. In the Summary panel, review your instance configuration, and then choose Launch instance.
For more information, see Launch an instance using the new launch instance wizard (p. 539).
Old console
1. Follow the Launch an instance using the old launch instance wizard (p. 548) procedure.
2. On the Choose an Amazon Machine Image (AMI) page, select an AMI that
supports hibernation. For more information about supported AMIs, see Hibernation
prerequisites (p. 587).
3. On the Choose an Instance Type page, select a supported instance type, and choose Next:
Configure Instance Details. For information about supported instance types, see Hibernation
prerequisites (p. 587).
4. On the Configure Instance Details page, for Stop - Hibernate Behavior, select the Enable
hibernation as an additional stop behavior check box.
5. On the Add Storage page, for the root volume, specify the following information:
• For Size (GiB), enter the EBS root volume size. The volume must be large enough to store the
RAM contents and accommodate your expected usage.
• For Volume Type, select a supported EBS volume type, General Purpose SSD (gp2 and gp3) or
Provisioned IOPS SSD (io1 and io2).
• For Encryption, select the encryption key for the volume. If you enabled encryption by
default in this AWS Region, the default encryption key is selected.
For more information about the prerequisites for the root volume, see Hibernation
prerequisites (p. 587).
6. Continue as prompted by the wizard. When you've finished reviewing your options on the
Review Instance Launch page, choose Launch. For more information, see Launch an instance
using the old launch instance wizard (p. 548).
AWS CLI
Use the run-instances command to launch an instance. Specify the EBS root volume parameters
using the --block-device-mappings file://mapping.json parameter, and enable
hibernation using the --hibernation-options Configured=true parameter.
591
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
[
{
"DeviceName": "/dev/xvda",
"Ebs": {
"VolumeSize": 30,
"VolumeType": "gp2",
"Encrypted": true
}
}
]
Note
The value for DeviceName must match the root device name that's associated with the
AMI. To find the root device name, use the describe-images command.
If you enabled encryption by default in this AWS Region, you can omit "Encrypted":
true.
PowerShell
Use the New-EC2Instance command to launch an instance. Specify the EBS root
volume by first defining the block device mapping, and then adding it to the command
using the -BlockDeviceMappings parameter. Enable hibernation using the -
HibernationOptions_Configured $true parameter.
PS C:\> New-EC2Instance `
-ImageId ami-0abcdef1234567890 `
-InstanceType m5.large `
-BlockDeviceMappings $ebs_encrypt `
-HibernationOptions_Configured $true `
-MinCount 1 `
-MaxCount 1 `
-KeyName MyKeyPair
Note
The value for DeviceName must match the root device name associated with the AMI. To
find the root device name, use the Get-EC2Image command.
592
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
If you enabled encryption by default in this AWS Region, you can omit Encrypted =
$true from the block device mapping.
Console
AWS CLI
The following field in the output indicates that the instance is enabled for hibernation.
"HibernationOptions": {
"Configured": true
}
PowerShell
To view if an instance is enabled for hibernation using the AWS Tools for Windows PowerShell
Get-EC2Instance `
-Filter @{ Name="hibernation-options.configured"; Value="true"}
The output lists the EC2 instances that are enabled for hibernation.
Hibernate an instance
You can hibernate an instance if the instance is enabled for hibernation (p. 590) and meets the
hibernation prerequisites (p. 587). If an instance cannot hibernate successfully, a normal shutdown
occurs.
Console
593
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
AWS CLI
PowerShell
To hibernate an Amazon EBS-backed instance using the AWS Tools for Windows PowerShell
Use the Stop-EC2Instance command and specify the -Hibernate $true parameter.
Stop-EC2Instance `
-InstanceId i-1234567890abcdef0 `
-Hibernate $true
Console
AWS CLI
Use the describe-instances command and specify the state-reason-code filter to see the
instances on which hibernation was initiated.
The following field in the output indicates that hibernation was initiated on the instance.
"StateReason": {
"Code": "Client.UserInitiatedHibernate"
594
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
PowerShell
To view if hibernation was initiated on an instance using the AWS Tools for Windows PowerShell
Use the Get-EC2Instance command and specify the state-reason-code filter to see the instances
on which hibernation was initiated.
Get-EC2Instance `
-Filter @{Name="state-reason-code";Value="Client.UserInitiatedHibernate"}
The output lists the EC2 instances on which hibernation was initiated.
Console
AWS CLI
PowerShell
To start a hibernated instance using the AWS Tools for Windows PowerShell
Start-EC2Instance `
-InstanceId i-1234567890abcdef0
Troubleshoot hibernation
Use this information to help diagnose and fix issues that you might encounter when hibernating an
instance.
595
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Hibernate
You must wait for about five minutes after launch before hibernating.
Takes too long to transition from stopping to stopped, and memory state not
restored after start
If it takes a long time for your hibernating instance to transition from the stopping state to stopped,
and if the memory state is not restored after you start, this could indicate that hibernation was not
properly configured.
Check the EC2 launch log and look for messages that are related to hibernation. To access the EC2
launch log, connect (p. 610) to the instance and open the C:\ProgramData\Amazon\EC2-Windows
\Launch\Log\Ec2Launch.log file in a text editor.
Note
By default, Windows hides files and folders under C:\ProgramData. To view EC2 Launch
directories and files, enter the path in Windows Explorer or change the folder properties to show
hidden files and folders.
Find the log lines for hibernation. If the log lines indicate a failure or the log lines are missing, there was
most likely a failure configuring hibernation at launch.
For example, the following message indicates that hibernation failed to configure: Message: Failed
to enable hibernation.
If the log line contains HibernationEnabled: true, hibernation was successfully configured.
Check the EC2 config log and look for messages that are related to hibernation. To access the EC2 config
log, connect (p. 610) to the instance and open the C:\Program Files\Amazon\Ec2ConfigService
\Logs\Ec2ConfigLog.txt file in a text editor. Find the log lines for SetHibernateOnSleep. If
the log lines indicate a failure or the log lines are missing, there was most likely a failure configuring
hibernation at launch.
For example, the following message indicates that the instance root volume is not large enough:
SetHibernateOnSleep: Failed to enable hibernation: Hibernation failed with the
following error: There is not enough space on the disk.
If you do not see any logs from these processes, your AMI might not support hibernation. For
information about supported AMIs, see Hibernation prerequisites (p. 587).
Instance size
If you’re using a T3 or T3a instance with less than 1 GB of RAM, try increasing the size of the instance to
one that has at least 1 GB of RAM.
596
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Reboot
Rebooting an instance doesn't start a new instance billing period (with a minimum one-minute charge),
unlike stopping and starting (p. 580) your instance.
We might schedule your instance for a reboot for necessary maintenance, such as to apply updates that
require a reboot. No action is required on your part; we recommend that you wait for the reboot to occur
within its scheduled window. For more information, see Scheduled events for your instances (p. 1114).
We recommend that you use the Amazon EC2 console, a command line tool, or the Amazon EC2 API to
reboot your instance instead of running the operating system reboot command from your instance. If
you use the Amazon EC2 console, a command line tool, or the Amazon EC2 API to reboot your instance,
we perform a hard reboot if the instance does not cleanly shut down within a few minutes. If you use
AWS CloudTrail, then using Amazon EC2 to reboot your instance also creates an API record of when your
instance was rebooted.
If Windows is installing updates on your instance, we recommend that you do not reboot or shut down
your instance using the Amazon EC2 console or the command line until all the updates are installed.
When you use the Amazon EC2 console or the command line to reboot or shut down your instance, there
is a risk that your instance will be hard rebooted. A hard reboot while updates are being installed could
throw your instance into an unstable state.
Console
Alternatively, select the instance and choose Actions, Manage instance state. In the screen that
opens, choose Reboot, and then Change state.
4. Choose Reboot when prompted for confirmation.
Command line
To reboot an instance
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
597
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Retire
You can use AWS Fault Injection Simulator to test how your application responds when your instance is
rebooted. For more information, see the AWS Fault Injection Simulator User Guide.
Instance retirement
An instance is scheduled to be retired when AWS detects irreparable failure of the underlying hardware
that hosts the instance. When an instance reaches its scheduled retirement date, it is stopped by AWS. If
your instance root device is an Amazon EBS volume, the instance is stopped, and you can start it again at
any time. Starting the stopped instance migrates it to new hardware.
For more information about the types of instance events, see Scheduled events for your
instances (p. 1114).
Contents
• Identify instances scheduled for retirement (p. 598)
• Actions to take for instances scheduled for retirement (p. 599)
Email notification
If your instance is scheduled for retirement, you receive an email prior to the event with the instance ID
and retirement date.
The email is sent to the primary account holder and the operations contact. For more information, see
Adding, changing, or removing alternate contacts in the AWS Billing User Guide.
Console identification
If you use an email account that you do not check regularly for instance retirement notifications, you can
use the Amazon EC2 console or the command line to determine if any of your instances are scheduled for
retirement.
598
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Retire
3. If you have an instance with a scheduled event listed, select its link below the Region name to go to
the Events page.
4. The Events page lists all resources that have events associated with them. To view instances that are
scheduled for retirement, select Instance resources from the first filter list, and then Instance stop
or retirement from the second filter list.
5. If the filter results show that an instance is scheduled for retirement, select it, and note the date and
time in the Start time field in the details pane. This is your instance retirement date.
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
When you are notified that your instance is scheduled for retirement, we recommend that you take the
following action as soon as possible:
• Check if your instance is reachable by either connecting (p. 610) to or pinging your instance.
• If your instance is reachable, you should plan to stop/start your instance at an appropriate time before
the scheduled retirement date, when the impact is minimal. For more information about stopping
and starting your instance, and what to expect when your instance is stopped, such as the effect on
public, private, and Elastic IP addresses that are associated with your instance, see Stop and start your
instance (p. 580). Note that data on instance store volumes is lost when you stop and start your
instance.
• If your instance is unreachable, you should take immediate action and perform a stop/start (p. 580)
to recover your instance.
• Alternatively, if you want to terminate (p. 600) your instance, plan to do so as soon as possible so
that you stop incurring charges for the instance.
599
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
Create an EBS-backed AMI from your instance so that you have a backup. To ensure data integrity,
stop the instance before you create the AMI. You can wait for the scheduled retirement date when the
instance is stopped, or stop the instance yourself before the retirement date. You can start the instance
again at any time. For more information, see Create a custom Windows AMI (p. 143).
After you create an AMI from your instance, you can use the AMI to launch a replacement instance. From
the Amazon EC2 console, select your new AMI and then choose Actions, Launch. Follow the wizard to
launch your instance. For more information about each step in the wizard, see Launch an instance using
the new launch instance wizard (p. 539).
You can't connect to or start an instance after you've terminated it. However, you can launch additional
instances using the same AMI. If you'd rather stop and start your instance, or hibernate it, see Stop and
start your instance (p. 580) or Hibernate your On-Demand Windows instance (p. 586). For more
information, see Differences between reboot, stop, hibernate, and terminate (p. 536).
Contents
• Instance termination (p. 600)
• Terminating multiple instances with termination protection across Availability Zones (p. 601)
• What happens when you terminate an instance (p. 601)
• Terminate an instance (p. 602)
• Enable termination protection (p. 602)
• Change the instance initiated shutdown behavior (p. 603)
• Preserve Amazon EBS volumes on instance termination (p. 604)
Instance termination
After you terminate an instance, it remains visible in the console for a short while, and then the entry
is automatically deleted. You cannot delete the terminated instance entry yourself. After an instance is
terminated, resources such as tags and volumes are gradually disassociated from the instance and may
no longer be visible on the terminated instance after a short while.
When an instance terminates, the data on any instance store volumes associated with that instance is
deleted.
By default, Amazon EBS root device volumes are automatically deleted when the instance terminates.
However, by default, any additional EBS volumes that you attach at launch, or any EBS volumes that
you attach to an existing instance persist even after the instance terminates. This behavior is controlled
by the volume's DeleteOnTermination attribute, which you can modify. For more information, see
Preserve Amazon EBS volumes on instance termination (p. 604).
You can prevent an instance from being terminated accidentally by someone using the AWS
Management Console, the CLI, and the API. This feature is available for both Amazon EC2 instance store-
backed and Amazon EBS-backed instances. Each instance has a DisableApiTermination attribute
with the default value of false (the instance can be terminated through Amazon EC2). You can modify
this instance attribute while the instance is running or stopped (in the case of Amazon EBS-backed
instances). For more information, see Enable termination protection (p. 602).
600
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
You can control whether an instance should stop or terminate when shutdown is initiated from the
instance using an operating system command for system shutdown. For more information, see Change
the instance initiated shutdown behavior (p. 603).
If you run a script on instance termination, your instance might have an abnormal termination, because
we have no way to ensure that shutdown scripts run. Amazon EC2 attempts to shut an instance down
cleanly and run any system shutdown scripts; however, certain events (such as hardware failure) may
prevent these system shutdown scripts from running.
• The specified instances that are in the same Availability Zone as the protected instance are not
terminated.
• The specified instances that are in different Availability Zones, where no other specified instances are
protected, are successfully terminated.
Instance B Disabled
Instance D Disabled
If you attempt to terminate all of these instances in the same request, the request reports failure with
the following results:
• Instance A and Instance B are successfully terminated because none of the specified instances in us-
east-1a are enabled for termination protection.
• Instance C and Instance D fail to terminate because at least one of the specified instances in us-
east-1b (Instance C) is enabled for termination protection.
• The API request will send a button press event to the guest.
• Various system services will be stopped as a result of the button press event. systemd handles a
graceful shutdown of the system. Graceful shutdown is triggered by the ACPI shutdown button press
event from the hypervisor.
• ACPI shutdown will be initiated.
• The instance will shut down when the graceful shutdown process exits. There is no configurable OS
shutdown time.
601
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
Terminate an instance
You can terminate an instance using the AWS Management Console or the command line.
By default, when you initiate a shutdown from an Amazon EBS-backed instance (using the shutdown or
poweroff commands), the instance stops. The halt command does not initiate a shutdown. If used, the
instance does not terminate; instead, it places the CPU into HLT and the instance remains running.
Console
To terminate an instance
1. Before you terminate an instance, verify that you won't lose any data by checking that your
Amazon EBS volumes won't be deleted on termination and that you've copied any data that you
need from your instance store volumes to persistent storage, such as Amazon EBS or Amazon
S3.
2. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
3. In the navigation pane, choose Instances.
4. Select the instance, and choose Instance state, Terminate instance.
5. Choose Terminate when prompted for confirmation.
Command line
To terminate an instance
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
You can use AWS Fault Injection Simulator to test how your application responds when your instance is
terminated. For more information, see the AWS Fault Injection Simulator User Guide.
The DisableApiTermination attribute does not prevent you from terminating an instance by
initiating shutdown from the instance (using an operating system command for system shutdown) when
the InstanceInitiatedShutdownBehavior attribute is set. For more information, see Change the
instance initiated shutdown behavior (p. 603).
Limitations
You can't enable termination protection for Spot Instances—a Spot Instance is terminated when the
Spot price exceeds the amount you're willing to pay for Spot Instances. However, you can prepare
602
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
your application to handle Spot Instance interruptions. For more information, see Spot Instance
interruptions (p. 421).
The DisableApiTermination attribute does not prevent Amazon EC2 Auto Scaling from terminating
an instance. For instances in an Auto Scaling group, use the following Amazon EC2 Auto Scaling features
instead of Amazon EC2 termination protection:
• To prevent instances that are part of an Auto Scaling group from terminating on scale in, use instance
scale-in protection. For more information, see Using instance scale-in protection in the Amazon EC2
Auto Scaling User Guide.
• To prevent Amazon EC2 Auto Scaling from terminating unhealthy instances, suspend the
ReplaceUnhealthy process. For more information, see Suspending and Resuming Scaling Processes
in the Amazon EC2 Auto Scaling User Guide.
• To specify which instances Amazon EC2 Auto Scaling should terminate first, choose a termination
policy. For more information, see Customizing the Termination Policy in the Amazon EC2 Auto Scaling
User Guide.
1. Select the instance, and choose Actions, Instance Settings, Change Termination Protection.
2. Choose Yes, Enable.
1. Select the instance, and choose Actions, Instance Settings, Change Termination Protection.
2. Choose Yes, Disable.
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
You can update the InstanceInitiatedShutdownBehavior attribute using the Amazon EC2 console
or the command line. The InstanceInitiatedShutdownBehavior attribute only applies when you
603
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
perform a shutdown from the operating system of the instance itself; it does not apply when you stop an
instance using the StopInstances API or the Amazon EC2 console.
Console
Command line
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
The default value for the DeleteOnTermination attribute differs depending on whether the volume is
the root volume of the instance or a non-root volume attached to the instance.
Root volume
By default, the DeleteOnTermination attribute for the root volume of an instance is set to true.
Therefore, the default is to delete the root volume of the instance when the instance terminates. The
DeleteOnTermination attribute can be set by the creator of an AMI as well as by the person who
launches an instance. When the attribute is changed by the creator of an AMI or by the person who
launches an instance, the new setting overrides the original AMI default setting. We recommend that
you verify the default setting for the DeleteOnTermination attribute after you launch an instance
with an AMI.
Non-root volume
By default, when you attach a non-root EBS volume to an instance (p. 1542), its
DeleteOnTermination attribute is set to false. Therefore, the default is to preserve these
volumes. After the instance terminates, you can take a snapshot of the preserved volume or attach
it to another instance. You must delete a volume to avoid incurring further charges. For more
information, see Delete an Amazon EBS volume (p. 1567).
To verify the value of the DeleteOnTermination attribute for an EBS volume that is in use, look at the
instance's block device mapping. For more information, see View the EBS volumes in an instance block
device mapping (p. 1842).
604
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Terminate
You can change the value of the DeleteOnTermination attribute for a volume when you launch the
instance or while the instance is running.
Examples
• Change the root volume to persist at launch using the console (p. 605)
• Change the root volume to persist at launch using the command line (p. 605)
• Change the root volume of a running instance to persist using the command line (p. 606)
To change the root volume of an instance to persist at launch using the console
In the new console experience, you can verify the setting by viewing details for the root device volume
on the instance's details pane. On the Storage tab, under Block devices, scroll right to view the Delete
on termination setting for the volume. By default, Delete on termination is Yes. If you change the
default behavior, Delete on termination is No.
In the old console experience, you can verify the setting by viewing details for the root device volume
on the instance's details pane. Next to Block devices, choose the entry for the root device volume. By
default, Delete on termination is True. If you change the default behavior, Delete on termination is
False.
Change the root volume to persist at launch using the command line
When you launch an EBS-backed instance, you can use one of the following commands to change the
root device volume to persist. For more information about these command line interfaces, see Access
Amazon EC2 (p. 3).
In the block device mappings for the volumes that you want to persist, include --
DeleteOnTermination, and specify false.
For example, to persist a volume add the following option to your run-instances command:
--block-device-mappings file://mapping.json
In mapping.json, specify the device name, for example /dev/sda1 or /dev/xvda, and for --
DeleteOnTermination, specify false.
[
{
605
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover
"DeviceName": "device_name",
"Ebs": {
"DeleteOnTermination": false
}
}
]
Change the root volume of a running instance to persist using the command line
You can use one of the following commands to change the root device volume of a running EBS-backed
instance to persist. For more information about these command line interfaces, see Access Amazon
EC2 (p. 3).
In mapping.json, specify the device name, for example /dev/sda1 or /dev/xvda, and for --
DeleteOnTermination, specify false.
[
{
"DeviceName": "device_name",
"Ebs": {
"DeleteOnTermination": false
}
}
]
A recovered instance is identical to the original instance, including the instance ID, private IP addresses,
Elastic IP addresses, and all instance metadata. If the impaired instance has a public IPv4 address, the
instance retains the public IPv4 address after recovery. If the impaired instance is in a placement group,
the recovered instance runs in the placement group. During instance recovery, the instance is migrated as
part of an instance reboot, and any data that is in-memory is lost.
Topics
• Simplified automatic recovery based on instance configuration (p. 607)
606
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover
When a simplified automatic recovery event succeeds, you are notified by an AWS Health Dashboard
event. When a simplified automatic recovery event fails, you are notified by an AWS Health Dashboard
event and by email. You can also use Amazon EventBridge rules to monitor for simplified automatic
recovery events using the following event codes:
Topics
• Requirements (p. 607)
• Limitations (p. 607)
• Set the recovery behavior (p. 608)
Requirements
Simplified automatic recovery is supported by an instance if the instance has the following
characteristics:
Limitations
• Instances with instance store volumes and metal instance types are not supported by simplified
automatic recovery.
607
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover
• Simplified automatic recovery is not initiated for instances in an Auto Scaling group. If your instance
is part of an Auto Scaling group with health checks enabled, then the instance is replaced when it
becomes impaired.
• Simplified automatic recovery applies to unplanned events only. It does not apply to scheduled events.
• Terminated or stopped instances cannot be recovered.
Console
To set the automatic recovery behavior to default for a running or stopped instance
AWS CLI
608
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recover
To set the automatic recovery behavior to default for a running or stopped instance
When the StatusCheckFailed_System alarm is triggered, and the recovery action is initiated, you're
notified by the Amazon SNS topic that you selected when you created the alarm and associated the
recovery action. When the recovery action is complete, information is published to the Amazon SNS
topic you configured for the alarm. Anyone who is subscribed to this Amazon SNS topic receives an email
notification that includes the status of the recovery attempt and any further instructions. As a last step
in the recovery action, the recovered instance reboots.
You can use Amazon CloudWatch alarms to recover an instance even if simplified automatic recovery is
not disabled. For information about creating an Amazon CloudWatch alarm to recover an instance, see
Add recover actions to Amazon CloudWatch alarms (p. 1164).
• General purpose: M3
• Compute optimized: C3
• Memory optimized: R3 | X1 | X1e | X2idn | X2iedn
Important
If the instance has instance store volumes attached, the data is lost during recovery.
Amazon CloudWatch action based recovery does not support recovery for instances with Amazon EC2
Dedicated Hosts tenancy and metal instances.
You can use the AWS Management Console or the AWS CLI to view the instance types that support
Amazon CloudWatch action based recovery.
Console
To view the instance types that support Amazon CloudWatch action based recovery
609
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect
3. In the filter bar, enter Auto Recovery support: true. Alternatively, as you enter the characters
and the filter name appears, you can select it.
The Instance types table displays all the instance types that support Amazon CloudWatch
action based recovery.
AWS CLI
To view the instance types that support Amazon CloudWatch action based recovery
• During Service Health Dashboard events, simplified automatic recovery might not recover your
instance. You might not receive recovery failure notifications for such events. Any ongoing
Service Health Dashboard events might also prevent CloudWatch action based recovery from
successfully recovering an instance. For the latest service availability information, see http://
status.aws.amazon.com/.
• Temporary, insufficient capacity of replacement hardware.
• The instance has reached the maximum daily allowance of three recovery attempts.
The automatic recovery process attempts to recover your instance for up to three separate failures per
day. If the instance system status check failure persists, we recommend that you manually stop and start
the instance. Data on instance store volumes is lost when the instance is stopped. For more information,
see Stop and start your instance (p. 580).
Your instance might subsequently be retired if automatic recovery fails and a hardware degradation is
determined to be the root cause for the original system status check failure.
Connect
This section of the Amazon EC2 User Guide for Windows Instances provides information to help you
connect to your Windows instance after you have launched it. It also provides information to help you
connect your Windows instance to another AWS resource.
Topics
• Connect to your Windows instance (p. 610)
• Connect your EC2 instance to an AWS resource (p. 625)
610
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
your instance in the same way you use a computer sitting in front of you (local computer). It is available
on most editions of Windows and is also available for Mac OS.
The license for the Windows Server operating system allows two simultaneous remote connections
for administrative purposes. The license for Windows Server is included in the price of your Windows
instance. If you require more than two simultaneous remote connections, you must purchase a Remote
Desktop Services (RDS) license. If you attempt a third connection, an error occurs.
If you need to connect to your instance in order to troubleshoot boot, network configuration, and other
issues for instances built on the AWS Nitro System, you can use the EC2 Serial Console for Windows
instances (p. 1980).
For information about connecting to a Linux instance, see Connect to your Linux instance in the Amazon
EC2 User Guide for Linux Instances.
Contents
• Prerequisites (p. 611)
• Connect to your Windows instance using RDP (p. 612)
• Connect to your Windows instance using Fleet Manager (p. 618)
• Connect to a Windows instance using its IPv6 address (p. 619)
• Connect to a Windows instance using Session Manager (p. 620)
• Configure your accounts (p. 621)
• Transfer files to Windows instances (p. 621)
Prerequisites
To connect using RDP
Get the fully-qualified path to the location on your computer of the .pem file for the key pair that you
specified when you launched the instance. For more information, see Identify the public key specified
at launch. If you can't find your private key file, see I've lost my private key. How can I connect to my
Windows instance?
• Enable inbound RDP traffic from your IP address to your instance
Ensure that the security group associated with your instance allows incoming RDP traffic (port 3389)
from your IP address. The default security group does not allow incoming RDP traffic by default. For
more information, see Authorize inbound traffic for your Windows instances (p. 1473).
Note
You do not need to specifically allow incoming RDP traffic from your IP address if you use
Fleet Manager to connect. Fleet Manager handles that for you.
For prerequisites, see Connect using Remote Desktop in the AWS Systems Manager User Guide.
611
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
The name of the administrator account depends on the language of the operating system. For
example, for English, it's Administrator, for French it's Administrateur, and for Portuguese it's
Administrador. For more information, see Localized Names for Administrator Account in Windows in
the Microsoft TechNet Wiki.
If you've joined your instance to a domain, you can connect to your instance using domain credentials
you've defined in AWS Directory Service. On the Remote Desktop login screen, instead of using the local
computer name and the generated password, use the fully-qualified user name for the administrator (for
example, corp.example.com\Admin), and the password for this account.
If you receive an error while attempting to connect to your instance, see Remote Desktop can't connect
to the remote computer (p. 1927).
New console
612
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
4. Choose Browse and navigate to the private key (.pem) file you created when you launched the
instance. Select the file and choose Open to copy the entire contents of the file to this window.
5. Choose Decrypt Password. The console displays the default administrator password for the
instance under Password, replacing the Get password link shown previously. Save the password
in a safe place. This password is required to connect to the instance.
613
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
6. Choose Download remote desktop file. Your browser prompts you to either open or save the
RDP shortcut file. When you have finished downloading the file, choose Cancel to return to the
Instances page.
• If you opened the RDP file, you'll see the Remote Desktop Connection dialog box.
• If you saved the RDP file, navigate to your downloads directory, and open the RDP file to
display the dialog box.
7. You may get a warning that the publisher of the remote connection is unknown. Choose
Connect to continue to connect to your instance.
614
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
8. The administrator account is chosen by default. Copy and paste the password that you saved
previously.
Tip
If you receive a "Password Failed" error, try entering the password manually. Copying
and pasting content can corrupt it.
9. Due to the nature of self-signed certificates, you may get a warning that the security certificate
could not be authenticated. Use the following steps to verify the identity of the remote
computer, or simply choose Yes (Windows) or Continue (Mac OS X) if you trust the certificate.
615
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
a. If you are using Remote Desktop Connection on a Windows computer, choose View
certificate. If you are using Microsoft Remote Desktop on a Mac, choose Show Certificate.
b. Choose the Details tab, and scroll down to Thumbprint (Windows) or SHA1 Fingerprints
(Mac OS X). This is the unique identifier for the remote computer's security certificate.
c. In the Amazon EC2 console, select the instance, choose Actions, Monitor and troubleshoot,
Get system log.
d. In the system log output, look for RDPCERTIFICATE-THUMBPRINT. If this value matches
the thumbprint or fingerprint of the certificate, you have verified the identity of the remote
computer.
e. If you are using Remote Desktop Connection on a Windows computer, return to the
Certificate dialog box and choose OK. If you are using Microsoft Remote Desktop on a
Mac, return to the Verify Certificate and choose Continue.
f. [Windows] Choose Yes in the Remote Desktop Connection window to connect to your
instance.
[Mac OS X] Log in as prompted, using the default administrator account and the default
administrator password that you recorded or copied previously. Note that you might need
to switch spaces to see the login screen. For more information, see Add spaces and switch
between them.
616
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
Old console
1. In the Amazon EC2 console, select the instance, and then choose Connect.
2. In the Connect To Your Instance dialog box, choose Get Password (it will take a few minutes
after the instance is launched before the password is available).
3. Choose Browse and navigate to the private key (.pem) file you created when you launched
the instance. Select the file and choose Open to copy the entire contents of the file into the
Contents field.
4. Choose Decrypt Password. The console displays the default administrator password for the
instance in the Connect To Your Instance dialog box, replacing the link to Get Password shown
previously with the actual password.
5. Record the default administrator password, or copy it to the clipboard. You need this password
to connect to the instance.
6. Choose Download Remote Desktop File. Your browser prompts you to either open or save
the .rdp file. Either option is fine. When you have finished, you can choose Close to dismiss the
Connect To Your Instance dialog box.
• If you opened the .rdp file, you'll see the Remote Desktop Connection dialog box.
• If you saved the .rdp file, navigate to your downloads directory, and open the .rdp file to
display the dialog box.
7. You may get a warning that the publisher of the remote connection is unknown. You can
continue to connect to your instance.
8. When prompted, log in to the instance, using the administrator account for the operating
system and the password that you recorded or copied previously. If your Remote Desktop
Connection already has an administrator account set up, you might have to choose the Use
another account option and type the user name and password manually.
Note
Sometimes copying and pasting content can corrupt data. If you encounter a "Password
Failed" error when you log in, try typing in the password manually.
9. Due to the nature of self-signed certificates, you may get a warning that the security certificate
could not be authenticated. Use the following steps to verify the identity of the remote
computer, or simply choose Yes or Continue to continue if you trust the certificate.
a. If you are using Remote Desktop Connection from a Windows PC, choose View certificate.
If you are using Microsoft Remote Desktop on a Mac, choose Show Certificate.
b. Choose the Details tab, and scroll down to the Thumbprint entry on a Windows PC, or the
SHA1 Fingerprints entry on a Mac. This is the unique identifier for the remote computer's
security certificate.
c. In the Amazon EC2 console, select the instance, choose Actions, and then choose Get
System Log.
d. In the system log output, look for an entry labeled RDPCERTIFICATE-THUMBPRINT. If this
value matches the thumbprint or fingerprint of the certificate, you have verified the identity
of the remote computer.
e. If you are using Remote Desktop Connection from a Windows PC, return to the Certificate
dialog box and choose OK. If you are using Microsoft Remote Desktop on a Mac, return to
the Verify Certificate and choose Continue.
f. [Windows] Choose Yes in the Remote Desktop Connection window to connect to your
instance.
[Mac OS] Log in as prompted, using the default administrator account and the default
administrator password that you recorded or copied previously. Note that you might
617
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
need to switch spaces to see the login screen. For more information about spaces, see
support.apple.com/en-us/HT204100.
g. If you receive an error while attempting to connect to your instance, see Remote Desktop
can't connect to the remote computer (p. 1927).
For more information about connecting to Windows instances from the Fleet Manager Remote Desktop
page, see Connect using Remote Desktop in the AWS Systems Manager User Guide.
618
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
1. Get the initial administrator password for your instance, as described in Connect to your Windows
instance using RDP (p. 612). This password is required to connect to your instance.
2. [Windows] Open the RDP client on your Windows computer, choose Show Options, and do the
following:
619
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
[Mac OS X] Open the RDP client on your computer and do the following:
• Choose New.
• For PC Name, enter the IPv6 address of your Windows instance.
• For User name, enter Administrator.
• Close the dialog box. Under My Desktops, select the connection, and choose Start.
• When prompted, enter the password that you saved previously.
3. Due to the nature of self-signed certificates, you may get a warning that the security certificate
could not be authenticated. If you trust the certificate, you can choose Yes or Continue. Otherwise,
you can verify the identity of the remote computer, as described in Connect to your Windows
instance using RDP (p. 612).
Before attempting to connect to an instance using Session Manager, ensure that the necessary setup
steps have been completed. For more information, see Setting up Session Manager.
To connect to a Windows instance using Session Manager on the Amazon EC2 console
620
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
Tip
If you receive an error that you’re not authorized to perform one or more Systems Manager
actions (ssm:command-name), then you must update your policies to allow you to start
sessions from the Amazon EC2 console. For more information and instructions, see
Quickstart default IAM policies for Session Manager in the AWS Systems Manager User
Guide.
• Change the administrator password from the default value. You can change the password while you
are logged on to the instance itself, just as you would on any computer running Windows Server.
• Create another user with administrator privileges on the instance. This is a safeguard in case you forget
the administrator password or have a problem with the administrator account. The new user must
have permission to access the instance remotely. Open System Properties by right-clicking on the This
PC icon on your Windows desktop or File Explorer and selecting Properties. Choose Remote settings,
and choose Select Users to add the user to the Remote Desktop Users group.
621
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
the local file sharing feature of the Microsoft Remote Desktop Connection software. You can access local
files on hard disk drives, DVD drives, portable media drives, and mapped network drives.
To access your local files from your Windows instances, you must enable the local file sharing feature
by mapping the remote session drive to your local drive. The steps are slightly different depending on
whether your local computer operating system is Windows or macOS X.
Windows
To map the remote session drive to your local drive on your local Windows computer
a. Under Connection settings, choose Open..., and browse to the RDP shortcut file that you
downloaded from the Amazon EC2 console. The file contains the Public IPv4 DNS host
name, which identifies the instance, and the Administrator user name.
b. Select the file and choose Open. The Computer and User name fields are populated with
the values from the RDP shortcut file.
c. Choose Save.
4. Choose the Local Resources tab.
5. Under Local devices and resources, choose More...
6. Open Drives and select the local drive to map to your Windows instance.
622
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
7. Choose OK.
macOS X
To map the remote session drive to your local folder on your local macOS X computer
623
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect to your instance
5. Choose the + icon at bottom left, browse to the folder to map, and choose Open. Repeat this
step for every folder to map.
6. Choose Save.
7. Choose Connect to connect to your Windows instance. You'll be prompted for the password.
8. On the instance, in File Explorer, expand This PC, and find the shared folder from which you can
access your local files. In the following screenshot, the Desktop folder on the local computer
was mapped to the remote session drive on the instance.
For more information on making local devices available to a remote session on a Mac computer, see
Get started with the macOS client.
624
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
This section describes how to automatically connect an Amazon EC2 instance to an Amazon RDS
database.
For more information, see How the connection is automatically configured (p. 627). For a detailed
walkthrough, which includes other ways to connect an EC2 instance and an RDS database, see Tutorial:
Connect an Amazon EC2 instance to an Amazon RDS database (p. 628).
Topics
• Costs (p. 625)
• Prerequisites (p. 625)
• Automatically connect an instance and a database (p. 625)
• How the connection is automatically configured (p. 627)
Costs
While there is no charge to automatically connect your EC2 instance to an RDS database, you are charged
for the underlying services. Data transfer fees will apply if your EC2 instance and RDS database are in
different Availability Zones. For information about data transfer fees, see Data Transfer on the Amazon
EC2 On-Demand Pricing page.
Prerequisites
Before you can automatically connect an EC2 instance to an RDS database, check the following:
• The EC2 instances must be in the Running state. You can't connect an EC2 instance if it's in another
state.
• The EC2 instances and the RDS database must be in the same virtual private cloud (VPC). The
automatic connection feature is not supported if an EC2 instance and RDS database are in different
VPCs.
To view an animation of these steps, see View an animation: Automatically connect a newly-launched
EC2 instance to an RDS database (p. 626).
To automatically connect a newly-launched EC2 instance to an RDS database using the EC2
console
625
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
2. From the console dashboard, choose Launch instances, and then follow the steps to launch an
instance (p. 540).
3. On the instance launch confirmation page, choose Connect an RDS database.
4. In the Connect RDS Database dialog box, do the following:
Use the following steps to automatically connect an existing EC2 instance to an RDS database.
To view an animation of these steps, see View an animation: Automatically connect an existing EC2
instance to an RDS database (p. 627).
To automatically connect an existing EC2 instance to an RDS database using the EC2 console
If Connect RDS database is not available, check that the EC2 instances are in the Running state and
that they are in the same VPC.
626
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
For information about how to use the Amazon RDS console to automatically connect an EC2 instance to
an RDS database, see Configure automatic network connectivity with an EC2 instance in the Amazon RDS
User Guide.
The security groups are automatically created and added to the EC2 instance and RDS database, as
follows:
• Amazon EC2 creates a security group called ec2-rds-x and adds it to the EC2 instance. It has one
outbound rule that allows traffic to the database by specifying rds-ec2-x (the database security group)
as its destination.
• Amazon RDS creates a security group called rds-ec2-x and adds it to the database. It has one inbound
rule that allows traffic from the EC2 instance by specifying ec2-rds-x (the EC2 instance security group)
as its source.
The security groups reference each other as the destination and source, and only allow traffic on the
database port. You can reuse these security groups so that any database with the rds-ec2-x security
group can talk to any EC2 instance with the ec2-rds-x security group.
627
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
The security group names follow a pattern. For the security groups created by Amazon EC2, the pattern
is ec2-rds-x, and for the security groups created by Amazon RDS, the pattern is rds-ec2-x. x is a number,
which increases by 1 each time a new security group is automatically created.
There are different options for configuring the connection. In this tutorial, we explore the following three
options:
• Option 1: Automatically connect your EC2 instance to your RDS database using the EC2
console (p. 630)
Use the automatic connection feature in the EC2 console to automatically configure the connection
between your EC2 instance and your RDS database to allow traffic between the EC2 instance and the
RDS database.
• Option 2: Automatically connect your EC2 instance to your RDS database using the RDS
console (p. 638)
Use the automatic connection feature in the RDS console to automatically configure the connection
between your EC2 instance and your RDS database to allow traffic between the EC2 instance and the
RDS database.
• Option 3: Manually connect your EC2 instance to your RDS database by mimicking the automatic
connection feature (p. 645)
Configure the connection between your EC2 instance to your RDS database by manually configuring
and assigning the security groups to reproduce the configuration that is automatically created by the
automatic connection feature in Option 1 and Option 2.
Context
As context for why you'd want to configure a connection between your EC2 instance and an RDS
database, let's consider the following scenario: Your website presents a form to your users to fill in. You
need to capture the form data in a database. You can host your website on an EC2 instance that's been
configured as a web server, and you can capture the form data in an RDS database. The EC2 instance
and the RDS database need to be connected to each other so that the form data can go from the EC2
instance to the RDS database. This tutorial explains how to configure that connection. Note that this is
just one example of a use case for connecting an EC2 instance and an RDS database.
Architecture
The following diagram shows the resources that are created and the architectural configuration that
results from completing all the steps in this tutorial.
628
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
• You'll create an EC2 instance and an RDS database in the same AWS Region, VPC, and Availability
Zone.
• You'll create the EC2 instance in a public subnet.
• You'll create the RDS database in a private subnet.
When you use the RDS console to create the RDS database and automatically connect the EC2
instance, the VPC, DB subnet group, and public access settings for the database are automatically
selected. The RDS database is automatically created in a private subnet within the same VPC as the
EC2 instance.
• Internet users can connect to the EC2 instance by using SSH or HTTP/HTTPS via an Internet gateway.
• Internet users cannot connect directly to the RDS database; only the EC2 instance is connected to the
RDS database.
• When you use the automatic connection feature to allow traffic between the EC2 instance and the RDS
database, the following security groups are automatically created and added:
• Security group ec2-rds-x is created and added to the EC2 instance. It has one outbound rule that
references the rds-ec2-x security group as its destination. This allows traffic from the EC2 instance
to reach the RDS database with the rds-ec2-x security group.
• Security group rds-ec2-x is created and added to the RDS database. It has one inbound rule that
references the ec2-rds-x security group as its source. This allows traffic from the EC2 instance with
the ec2-rds-x security group to reach the RDS database.
By using separate security groups (one for the EC2 instance, and one for the RDS database), you have
better control over the security of the instance and the database. If you were to use the same security
group on both the instance and the database, and then modified the security group to suit, say, only
the database, the modification would affect both the instance and the database. In other words, if you
were to use one security group, you could unintentionally modify the security of a resource (either the
instance or the database) because you'd forgotten that the security group was attached to it.
The security groups that are automatically created also respect least privilege as they only allow the
mutual connection for this workload on the database port by creating a workload-specific security
group pair.
629
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Considerations
Consider the following when you complete the tasks in this tutorial:
• Two consoles – You will use the following two consoles for this tutorial:
• Amazon EC2 console – You will use the EC2 console to launch instances, to automatically connect an
EC2 instance to an RDS database, and for the manual option to configure the connection by creating
the security groups.
• Amazon RDS console – You will use the RDS console to create an RDS database and to automatically
connect an EC2 instance to an RDS database.
• One VPC – To use the automatic connection feature, your EC2 instance and your RDS database must
be in the same VPC.
If you were to manually configure the connection between your EC2 instance and your RDS database,
you could launch your EC2 instance in one VPC and your RDS database in another VPC; however, you’d
need to set up additional routing and VPC configuration. This scenario is not covered in this tutorial.
• One AWS Region – The EC2 instance and RDS database must be located in the same Region.
• Two security groups – The connectivity between the EC2 instance and the RDS database is configured
by two security groups—a security group for your EC2 instance, and a security group for your RDS
database.
When you use the automatic connection feature in the EC2 console or RDS console to configure the
connectivity (Option 1 and Option 2 of this tutorial), the security groups are automatically created and
assigned to the EC2 instance and RDS database.
If you do not use the automatic connection feature, you'll need to manually create and assign the
security groups. You do this in Option 3 of this tutorial.
You can complete the entire tutorial in one sitting, or you can complete it one task at a time.
Costs
By completing this tutorial, you might incur costs for the AWS resources that you create.
You can use Amazon EC2 under the free tier provided your AWS account is less than 12 months old and
you configure your resources according to the free tier requirements.
If your EC2 instance and your RDS database are in different Availability Zones, you will incur data
transfer fees. To avoid incurring these fees, the EC2 instance and the RDS database must be in the same
Availability Zone. For information about data transfer fees, see Data Transfer on the Amazon EC2 On-
Demand Pricing page.
To prevent incurring costs after you've completed the tutorial, make sure to delete the resources if they
are no longer needed. For the steps to delete the resources, see Clean up (p. 652).
Option 1: Automatically connect your EC2 instance to your RDS database using
the EC2 console
Objective
The objective of Option 1 is to explore the automatic connection feature in the EC2 console that
automatically configures the connection between your EC2 instance and RDS database to allow traffic
630
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
from the EC2 instance to the RDS database. In Option 3, you'll learn how to manually configure the
connection.
• An RDS database that is in the same VPC as the EC2 instance. You can either use an existing RDS
database or follow the steps in Task 1 to create a new RDS database.
• An EC2 instance that is in the same VPC as the RDS database. You can either use an existing EC2
instance or follow the steps in Task 2 to create a new EC2 instance.
• Permissions to call the following operations:
• ec2:AssociateRouteTable
• ec2:AuthorizeSecurityGroupEgress
• ec2:CreateRouteTable
• ec2:CreateSecurityGroup
• ec2:CreateSubnet
• ec2:DescribeInstances
• ec2:DescribeNetworkInterfaces
• ec2:DescribeRouteTables
• ec2:DescribeSecurityGroups
• ec2:DescribeSubnets
• ec2:ModifyNetworkInterfaceAttribute
• ec2:RevokeSecurityGroupEgress
Task objective
The objective of this task is to create an RDS database so that you can complete Task 3 where you
configure the connection between your EC2 instance and your RDS database. If you have an RDS
database that you can use, you can skip this task.
Important
If you use an existing RDS database, make sure that it is in the same VPC as your EC2 instance so
that you can use the automatic connection feature.
To view an animation of these steps, see View an animation: Create an RDS database (p. 633).
631
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Important
In a production environment, you should configure your database to meet your specific needs.
a. For DB instance identifier, enter a name for the database. For this tutorial, enter tutorial-
database-1.
b. For Master username, leave the default name, which is admin.
c. For Master password, enter a password that you can remember for this tutorial, and then, for
Confirm password, enter the password again.
8. Under Instance configuration, for DB instance class, leave the default, which is db.t3.micro. If your
account is less than 12 months, you can use this database class for free. Other restrictions apply. For
more information, see AWS Free Tier.
9. Under Connectivity, for Compute resource, choose Don't connect to an EC2 compute resource
because you'll connect the EC2 instance and the RDS database later in Task 3.
(Later, in Option 2 of this tutorial, you'll try out the automatic connection feature in the RDS console
by choosing Connect to an EC2 compute resource.)
10. For Virtual private cloud (VPC), choose a VPC. The VPC must have a DB subnet group. To use the
automatic connection feature, your EC2 instance and RDS database must be in the same VPC.
11. Keep all the default values for the other fields on this page.
12. Choose Create database.
On the Databases screen, the Status of the new database is Creating until the database is ready
to use. When the status changes to Available, you can connect to the database. Depending on the
database class and the amount of storage, it can take up to 20 minutes before the new database is
available.
632
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
You're now ready for Task 2: Launch an EC2 instance – optional (p. 633).
Task objective
The objective of this task is to launch an EC2 instance so that you can complete Task 3 where you
configure the connection between your EC2 instance and your Amazon RDS database. If you have an EC2
instance that you can use, you can skip this task.
Important
If you use an existing EC2 instance, make sure that it is in the same VPC as your RDS database so
that you can use the automatic connection feature.
Use the following steps to launch an EC2 instance for this tutorial.
To view an animation of these steps, see View an animation: Launch an EC2 instance (p. 635).
633
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Important
In a production environment, you should configure your instance to meet your specific needs.
a. For Network and Subnet, if you haven’t made changes to your default VPC or subnets, you can
keep the default settings.
If you have made changes to your default VPC or subnets, check the following:
i. The instance must be in the same VPC as the RDS database to use the automatic
connection feature. By default you have only one VPC.
ii. The VPC that you’re launching your instance into must have an internet gateway attached
to it so that you can access your web server from the internet. Your default VPC is
automatically set up with an internet gateway.
iii. To ensure that your instance receives a public IP address, for Auto-assign public IP,
check that Enable is selected. If Disable is selected, choose Edit (to the right of Network
Settings), and then, for Auto-assign public IP, choose Enable.
b. To connect to your instance by using SSH, you need a security group rule that authorizes SSH
(Linux) or RDP (Windows) traffic from your computer’s public IPv4 address. By default, when you
launch an instance, a new security group is created with a rule that allows inbound SSH traffic
from anywhere.
634
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
To make sure that only your IP address can connect to your instance, under Firewall (security
groups), from the drop-down list next to the Allow SSH traffic from check box, choose My IP.
c. To allow traffic from the internet to your instance, select the following check boxes:
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
For more information about launching an instance, see Launch an instance using the new launch instance
wizard (p. 539).
You're now ready for Task 3: Automatically connect your EC2 instance to your RDS database (p. 635).
Task objective
The objective of this task is to use the automatic connection feature in the EC2 console to automatically
configure the connection between your EC2 instance and your RDS database.
Use the following steps to connect your EC2 instance and RDS database using the automatic feature in
the EC2 console.
635
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
To view an animation of these steps, see View an animation: Automatically connect a newly-launched
EC2 instance to an RDS database (p. 636).
To automatically connect an EC2 instance to an RDS database using the EC2 console
1. On the instance launch confirmation page (it should be open from the previous task), choose
Connect an RDS database.
If Connect RDS database is not available, check that the EC2 instance is in the Running state.
2. For Database role, choose Instance. Instance in this case refers to the database instance.
3. For RDS database, choose the RDS database that you created in Task 1.
Note
The EC2 instance and the RDS database must be in the same VPC in order to connect to
each other.
4. Choose Connect.
You're now ready for Task 4: Verify the connection configuration (p. 637).
636
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Task objective
The objective of this task is to verify that the two security groups were created and assigned to the
instance and database.
When you use the automatic connection feature in the EC2 console to configure the connectivity, the
security groups are automatically created and assigned to the instance and database, as follows:
• Security group rds-ec2-x is created and added to the RDS database. It has one inbound rule that
references the ec2-rds-x security group as its source. This allows traffic from the EC2 instance with the
ec2-rds-x security group to reach the RDS database.
• Security group ec2-rds-x is created and added to the EC2 instance. It has one outbound rule that
references the rds-ec2-x security group as its destination. This allows traffic from the EC2 instance to
reach the RDS database with the rds-ec2-x security group.
To view an animation of these steps, see View an animation: Verify the connection
configuration (p. 638).
• Type: MYSQL/Aurora
• Port range: 3306
• Source: sg-0987654321example / ec2-rds-x – This is the security group that is assigned to the
EC2 instance that you verified in the preceding steps.
• Description: Rule to allow connections from EC2 instances with sg-1234567890example
attached
9. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
10. In the navigation pane, choose Instances.
11. Choose the EC2 instance that you selected to connect to the RDS database in the previous task, and
choose the Security tab.
12. Under Security details, Security groups, verify that a security group called ec2-rds-x is in the list. x
is a number.
13. Choose the ec2-rds-x security group to open it.
14. Choose the Outbound rules tab.
15. Verify that the following security group rule exists, as follows:
• Type: MYSQL/Aurora
637
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
By verifying that these security groups and security group rules exist and that they are assigned to the
RDS database and EC2 instance as described in this procedure, you can verify that the connection was
automatically configured by using the automatic connection feature.
You have completed Option 1 of this tutorial. You can now either complete Option 2, which teaches
you how to use the RDS console to automatically connect an EC2 instance to an RDS database, or you
can complete Option 3, which teaches you how to manually configure the security groups that were
automatically created in Option 1.
Option 2: Automatically connect your EC2 instance to your RDS database using
the RDS console
Objective
The objective of Option 2 is to explore the automatic connect feature in the RDS console that
automatically configures the connection between your EC2 instance and RDS database to allow traffic
from the EC2 instance to the RDS database. In Option 3, you'll learn how to manually configure the
connection.
638
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
• An EC2 instance that is in the same VPC as the RDS database. You can either use an existing EC2
instance or follow the steps in Task 1 to create a new instance.
• Permissions to call the following operations:
• ec2:AssociateRouteTable
• ec2:AuthorizeSecurityGroupEgress
• ec2:CreateRouteTable
• ec2:CreateSecurityGroup
• ec2:CreateSubnet
• ec2:DescribeInstances
• ec2:DescribeNetworkInterfaces
• ec2:DescribeRouteTables
• ec2:DescribeSecurityGroups
• ec2:DescribeSubnets
• ec2:ModifyNetworkInterfaceAttribute
• ec2:RevokeSecurityGroupEgress
Task objective
The objective of this task is to launch an EC2 instance so that you can complete Task 2 where you
configure the connection between your EC2 instance and your Amazon RDS database. If you have an EC2
instance that you can use, you can skip this task.
Use the following steps to launch an EC2 instance for this tutorial.
To view an animation of these steps, see View an animation: Launch an EC2 instance (p. 641).
639
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Important
In a production environment, you should configure your instance to meet your specific needs.
a. For Network and Subnet, if you haven’t made changes to your default VPC or subnets, you can
keep the default settings.
If you have made changes to your default VPC or subnets, check the following:
i. The instance must be in the same VPC as the RDS database to use the automatic
connection configuration. By default you have only one VPC.
ii. The VPC that you’re launching your instance into must have an internet gateway attached
to it so that you can access your web server from the internet. Your default VPC is
automatically set up with an internet gateway.
iii. To ensure that your instance receives a public IP address, for Auto-assign public IP,
check that Enable is selected. If Disable is selected, choose Edit (to the right of Network
Settings), and then, for Auto-assign public IP, choose Enable.
b. To connect to your instance by using SSH, you need a security group rule that authorizes SSH
(Linux) or RDP (Windows) traffic from your computer’s public IPv4 address. By default, when you
launch an instance, a new security group is created with a rule that allows inbound SSH traffic
from anywhere.
To make sure that only your IP address can connect to your instance, under Firewall (security
groups), from the drop-down list next to the Allow SSH traffic from check box, choose My IP.
c. To allow traffic from the internet to your instance, select the following check boxes:
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
640
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
For more information about launching an instance, see Launch an instance using the new launch instance
wizard (p. 539).
You're now ready for Task 2: Create an RDS database and automatically connect it to your EC2
instance (p. 641).
Task 2: Create an RDS database and automatically connect it to your EC2 instance
Task objective
The objective of this task is to create an RDS database and use the automatic connection feature in
the RDS console to automatically configure the connection between your EC2 instance and your RDS
database.
Use the following steps to create an RDS database and connect it to your EC2 instance using the
automatic feature in the RDS console.
To view an animation of these steps, see View an animation: Create an RDS database and automatically
connect it to an EC2 instance (p. 643).
DB instance configuration
641
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
Important
In a production environment, you should configure your instance to meet your specific needs.
a. For DB instance identifier, enter a name for the database. For this tutorial, enter tutorial-
database.
b. For Master username, leave the default name, which is admin.
c. For Master password, enter a password that you can remember for this tutorial, and then, for
Confirm password, enter the password again.
8. Under Instance configuration, for DB instance class, leave the default, which is db.t3.micro. If your
account is less than 12 months, you can use this instance for free. Other restrictions apply. For more
information, see AWS Free Tier.
9. Under Connectivity, for Compute resource, choose Connect to an EC2 compute resource. This is
the automatic connection feature in the RDS console .
10. For EC2 instance, choose the EC2 instance that you want to connect to. For the purposes of this
tutorial, you can either choose the instance that you created in the previous task, which you named
tutorial-instance, or choose another existing instance. If you don't see your instance in the list,
choose the refresh icon to the right of Connectivity.
When you use the automatic connection feature, a security group is added to this EC2 instance,
and another security group is added to the RDS database. The security groups are automatically
configure to allow traffic between the EC2 instance and the RDS database. In the next task, you'll
verify that the security groups were created and assigned to the EC2 instance and RDS database.
11. Choose Create database.
On the Databases screen, the Status of the new database is Creating until the database is ready
to use. When the status changes to Available, you can connect to the database. Depending on the
database class and the amount of storage, it can take up to 20 minutes before the new database is
available.
To learn more, see Configure automatic network connectivity with an EC2 instance in the Amazon RDS
User Guide.
642
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
View an animation: Create an RDS database and automatically connect it to an EC2 instance
You're now ready for Task 3: Verify the connection configuration (p. 643).
Task objective
The objective of this task is to verify that the two security groups were created and assigned to the
instance and the database.
When you use the automatic connection feature in the RDS console to configure the connectivity, the
security groups are automatically created and assigned to the instance and database, as follows:
• Security group rds-ec2-x is created and added to the RDS database. It has one inbound rule that
references the ec2-rds-x security group as its source. This allows traffic from the EC2 instance with the
ec2-rds-x security group to reach the RDS database.
• Security group ec2-rds-x is created and added to the EC2 instance. It has one outbound rule that
references the rds-ec2-x security group as its destination. This allows traffic from the EC2 instance to
reach the RDS database with the rds-ec2-x security group.
643
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
To view an animation of these steps, see View an animation: Verify the connection
configuration (p. 645).
• Type: MYSQL/Aurora
• Port range: 3306
• Destination: sg-1234567890example / rds-ec2-x
• Description: Rule to allow connections to database-tutorial from any instances this security
group is attached to
8. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.
9. In the navigation page, choose Databases.
10. Choose the RDS database that you created for this tutorial.
11. On the Connectivity & security tab, under Security, VPC security groups, verify that a security
group called rds-ec2-x is displayed.
12. Choose the rds-ec2-x security group. The Security Groups screen in EC2 console opens.
13. Choose the rds-ec2-x security group open it.
14. Choose the Inbound rules tab.
15. Verify that the following security group rule exists, as follows:
• Type: MYSQL/Aurora
• Port range: 3306
• Source: sg-0987654321example / ec2-rds-x – This is the security group that is assigned to the
EC2 instance that you verified in the preceding steps.
• Description: Rule to allow connections from EC2 instances with sg-1234567890example
attached
By verifying that these security groups and security group rules exist and that they are assigned
to the EC2 instance and RDS database as described in this procedure, you can verify that the
connection was automatically configured by using the automatic connection feature.
644
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
You have completed Option 2 of this tutorial. You can now either complete Option 3, which teaches you
how to manually configure the security groups that were automatically created in Option 2.
The objective of Option 3 is to learn how to manually configure the connection between an EC2 instance
and an RDS database by manually reproducing the configuration of the automatic connection feature.
• An EC2 instance that is in the same VPC as the RDS database. You can either use an existing EC2
instance or follow the steps in Task 1 to create a new instance.
• An RDS database that is in the same VPC as the EC2 instance. You can either use an existing RDS
database or follow the steps in Task 2 to create a new database.
• Permissions to call the following operations. If you have completed Option 1 of this tutorial, you
already have these permissions.
• ec2:AssociateRouteTable
• ec2:AuthorizeSecurityGroupEgress
• ec2:CreateRouteTable
• ec2:CreateSecurityGroup
• ec2:CreateSubnet
645
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
• ec2:DescribeInstances
• ec2:DescribeNetworkInterfaces
• ec2:DescribeRouteTables
• ec2:DescribeSecurityGroups
• ec2:DescribeSubnets
• ec2:ModifyNetworkInterfaceAttribute
• ec2:RevokeSecurityGroupEgress
Task objective
The objective of this task is to launch an EC2 instance so that you can complete Task 3 where you
configure the connection between your EC2 instance and your Amazon RDS database.
Use the following steps to launch an EC2 instance for this tutorial.
To view an animation of these steps, see View an animation: Launch an EC2 instance (p. 648).
Important
In a production environment, you should configure your instance to meet your specific needs.
1. Sign in to the AWS Management Console and open the Amazon EC2 console at https://
console.aws.amazon.com/ec2/.
646
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
a. For Network and Subnet, if you haven’t made changes to your default VPC or subnets, you can
keep the default settings.
If you have made changes to your default VPC or subnets, check the following:
i. The instance must be in the same VPC as the RDS database. By default you have only one
VPC.
ii. The VPC that you’re launching your instance into must have an internet gateway attached
to it so that you can access your web server from the internet. Your default VPC is
automatically set up with an internet gateway.
iii. To ensure that your instance receives a public IP address, for Auto-assign public IP,
check that Enable is selected. If Disable is selected, choose Edit (to the right of Network
Settings), and then, for Auto-assign public IP, choose Enable.
b. To connect to your instance by using SSH, you need a security group rule that authorizes SSH
(Linux) or RDP (Windows) traffic from your computer’s public IPv4 address. By default, when you
launch an instance, a new security group is created with a rule that allows inbound SSH traffic
from anywhere.
To make sure that only your IP address can connect to your instance, under Firewall (security
groups), from the drop-down list next to the Allow SSH traffic from check box, choose My IP.
c. To allow traffic from the internet to your instance, select the following check boxes:
If the instance fails to launch or the state immediately goes to terminated instead of running, see
Troubleshoot instance launch issues (p. 1923).
For more information about launching an instance, see Launch an instance using the new launch instance
wizard (p. 539).
647
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
You are now ready for Task 2: Create an RDS database – optional (p. 648).
Task objective
The objective of this task is to create an RDS database. You'll use this instance in Task 3 when you
connect it to your EC2 instance.
Use the following steps to create an RDS database for Option 3 of this tutorial.
To view an animation of these steps, see View an animation: Create a DB instance (p. 650).
Important
In a production environment, you should configure your instance to meet your specific needs.
648
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
On the Databases screen, the Status of the new DB instance is Creating until the DB instance is
ready to use. When the status changes to Available, you can connect to the DB instance. Depending
on the DB instance class and the amount of storage, it can take up to 20 minutes before the new
instance is available.
649
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
You are now ready for Task 3: Manually connect your EC2 instance to your RDS database by creating
security groups and assigning them to the instances (p. 650).
Task 3: Manually connect your EC2 instance to your RDS database by creating security groups
and assigning them to the instances
Task objective
The objective of this task is to reproduce the connection configuration of the automatic connection
feature by performing the following manually: You create two new security groups, and then add a
security group each to the EC2 instance and the RDS database.
Steps to create new security groups and add them to the instances
Use the following steps to connect an EC2 instance to your RDS database by creating two new security
groups. You then add a security group each to the EC2 instance and the RDS database.
To create two new security groups and assign one each to the EC2 instance and RDS database
650
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connect your instance to a resource
c. For Security group name, enter a descriptive name for the security group. For this tutorial,
enter ec2-rds-manual-configuration.
d. For Description, enter a brief description. For this tutorial, enter EC2 instance security
group to allow EC2 instance to securely connect to RDS database.
e. Choose Create security group. You'll come back to this security group to add an outbound rule
after you've created the RDS database security group.
3. Now, create the security group to add to the RDS database, as follows:
You have now completed the manual steps that mimic the automatic steps that occur when you use
the automatic connection feature.
651
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure instances
You have completed Option 3 of this tutorial. If you've completed Options 1, 2, and 3, and you no
longer need the resources that were created in this tutorial, you should delete them to prevent incurring
unnecessary costs. For more information, see Clean up (p. 652).
Clean up
Now that you have completed the tutorial, it is good practice to clean up (delete) any resources you
no longer want to use. Cleaning up AWS resources prevents your account from incurring any further
charges.
Topics
• Terminate your EC2 instance (p. 652)
• Delete your RDS database (p. 652)
If you launched an EC2 instance specifically for this tutorial, you can terminate it to stop incurring any
charges associated with it.
If you created an RDS database specifically for this tutorial, you can delete it to stop incurring any
charges associated with it.
After you have successfully launched and logged into your instance, you can make changes to it so that
it's configured to meet the needs of a specific application. The following are some common tasks to help
you get started.
Contents
• Configure a Windows instance using EC2Launch v2 (p. 653)
• Configure a Windows instance using EC2Launch (p. 702)
• Configure a Windows instance using the EC2Config service (p. 712)
652
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
EC2Launch v2 performs tasks during instance startup and runs if an instance is stopped and later started,
or restarted. EC2Launch v2 can also perform tasks on demand. Some of these tasks are automatically
enabled, while others must be enabled manually. The EC2Launch v2 service supports all EC2Config and
EC2Launch features.
This service uses a configuration file to control its operation. You can update the configuration file using
either a graphical tool or by directly editing it as a single .yml file (agent-config.yml). The service
binaries are located in the %ProgramFiles%\Amazon\EC2Launch directory.
EC2Launch v2 publishes Windows event logs to help you troubleshoot errors and set triggers. For more
information, see Windows event logs (p. 693).
653
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
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.
Note
In order to use EC2Launch with IMDSv2, the version must be 1.3.2002730 or later.
Overview topics
• Compare Amazon EC2 launch services (p. 654)
• EC2Launch v2 concepts (p. 655)
• EC2Launch v2 tasks (p. 656)
• Telemetry (p. 657)
Windows 2022
654
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Number of Event 2 0 30
Viewer event types
EC2Launch v2 concepts
The following concepts are useful to understand when considering EC2Launch v2.
Task
A task can be invoked to perform an action on an instance. For a list of available tasks for EC2Launch
v2, see EC2Launch v2 tasks (p. 656). For task configuration schema and details, see EC2Launch v2 task
configuration (p. 675). Tasks can be configured in the agent-config.yml file or through user data.
Stage
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 agent-config.yml, you must specify a list of
stages, and a list of tasks within each stage.
Stage 1: Boot
Stage 2: Network
Stage 3: PreReady
After the PreReady stage completes, the service sends the Windows is ready message to the
Amazon EC2 console.
The following scripts run after Amazon EC2 sends the Windows is ready message, before the
PostReady stage begins:
• YAML user data version 1.1
• XML user data scripts
Stage 4: PostReady
YAML user data version 1.0 runs after the PostReady stage completes.
For example stages and tasks, see Example: agent-config.yml (p. 676).
When you use user data, you must specify a list of tasks. The stage is implied. For example tasks, see
Example: user data (p. 677).
The service runs the list of tasks in the order that you specify in agent-config.yml and in user data.
Stages run sequentially. The next stage starts after the previous stage completes. Tasks are also run
sequentially.
Frequency
Task frequency determines when tasks should run, depending on the boot context. Most tasks have only
one allowed frequency. You can specify a frequency for executeScript tasks.
You will see the following frequencies in the EC2Launch v2 task configuration (p. 675).
655
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
• 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
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 (p. 809).
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 (p. 675).
• Set non-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.
656
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Telemetry
Telemetry is additional information that helps AWS to better understand your requirements, diagnose
issues, and deliver features to improve your experience with AWS services.
EC2Launch v2 version 2.0.592 and later collect telemetry, such as usage metrics and errors. This data
is collected from the Amazon EC2 instance on which EC2Launch v2 runs. This includes all Windows AMIs
owned by AWS.
• Usage information — agent commands, install method, and scheduled run frequency.
• Errors and diagnostic information — agent installation and run error codes.
Telemetry is enabled by default. You can disable telemetry collection at any time. If telemetry is enabled,
EC2Launch v2 sends telemetry data without additional customer notifications.
Telemetry visibility
When telemetry is enabled, it appears in the Amazon EC2 console output as follows:
To disable telemetry for a single instance, you can either set a system environment variable, or use the
MSI to modify the installation.
To disable telemetry by setting a system environment variable, run the following command as an
administrator:
setx /M EC2LAUNCH_TELEMETRY 0
To disable telemetry using the MSI, run the following command after you download the MSI (p. 657):
657
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Download
To install the latest version of EC2Launch v2, download the installer from the following locations:
Warning
AmazonEC2Launch.msi uninstalls previous versions of the EC2 launch services, such as
EC2Launch (v1) and EC2Config.
Note
The 32-bit installation link will be deprecated. We recommend that you use the 64-
bit installation link to install EC2Launch v2. If you require a 32-bit launch agent, use
EC2Config (p. 712).
• 64Bit — https://s3.amazonaws.com/amazon-ec2launch-v2/windows/amd64/latest/
AmazonEC2Launch.msi
• 32Bit — https://s3.amazonaws.com/amazon-ec2launch-v2/windows/386/latest/
AmazonEC2Launch.msi
You can install the AWSEC2Launch-Agent package from AWS SSM Distributor. For instructions on how
to install a package from SSM Distributor, see Install or update packages in the AWS SSM User Guide.
You can install the ec2launch-v2-windows component when you build a custom image with EC2
Image Builder. For instructions on how to build a custom image with EC2 Image Builder, see Create an
image pipeline using the EC2 Image Builder console wizard in the EC2 Image Builder User Guide.
AmazonEC2Launch.msi uninstalls previous versions of the EC2 launch services, such as EC2Launch (v1)
and EC2Config.
To install the latest version of EC2Launch v2 using PowerShell, run the following commands from a
PowerShell window:
mkdir $env:USERPROFILE\Desktop\EC2Launchv2
64Bit
$Url = "https://s3.amazonaws.com/amazon-ec2launch-v2/windows/amd64/latest/
AmazonEC2Launch.msi"
32Bit
Note
The 32-bit installation link will be deprecated. We recommend that you use the 64-
bit installation link to install EC2Launch v2. If you require a 32-bit launch agent, use
EC2Config (p. 712).
$Url = "https://s3.amazonaws.com/amazon-ec2launch-v2/windows/386/latest/
AmazonEC2Launch.msi"
658
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
The installation wizard will open. Verify the installation by checking C:\ProgramData\Amazon
\EC2Launch.
EC2Launch v2 is preinstalled by default on Windows Server 2022 AMIs and UEFI AMIs:
• Windows_Server-2022-English-Full-Base
• Windows_Server-2022-English-Core-Base
• Windows_Server-2022-English-Full-Containers
• Windows Server 2022 AMIs with all other languages
• Windows Server 2022 AMIs with SQL installed
EC2Launch v2 is also preinstalled on the following Windows Server AMIs. You can find these AMIs from
the Amazon EC2 console, or by using the AWS Command Line Interface and using the following search
prefix: EC2LaunchV2-
• EC2LaunchV2-Windows_Server-2019-English-Full-Base
• EC2LaunchV2-Windows_Server-2016-English-Full-Base
• EC2LaunchV2-Windows_Server-2012_R2_RTM-English-Full-Base
• EC2LaunchV2-Windows_Server-2019-English-Core-Base
• EC2LaunchV2-Windows_Server-2016-English-Core-Base
• EC2LaunchV2-Windows_Server-2019-English-Full-ContainersLatest
• EC2LaunchV2-Windows_Server-2012_RTM-English-Full-Base
Installation options
When you install or upgrade EC2Launch v2, your existing configuration, located at %ProgramData%/
Amazon/EC2Launch/config/agent-config.yml, is not replaced. Perform a clean installation to
overwrite an existing configuration to use the latest version.
You can perform a clean installation using the EC2Launch v2 interface or the command line.
When you install EC2Launch v2, choose the Default Configuration option under Basic Install.
659
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
To perform a clean installation of EC2Launch v2 using the command line, run the following Windows
command:
msiexec /i "C:\Users\Administrator\Desktop\EC2Launchv2\AmazonEC2Launch.msi"
ADDLOCAL="Basic,Clean" /q
Migrate to EC2Launch v2
The EC2Launch migration tool upgrades the installed launch agent (EC2Config and EC2Launch
v1) by uninstalling it and installing EC2Launch v2. Applicable configurations from previous launch
services are automatically migrated to the new service. The migration tool does not detect any
scheduled tasks linked to EC2Launch v1 scripts; therefore, it does not automatically set up those tasks
in EC2Launch v2. To configure these tasks, edit the agent-config.yml (p. 675) file, or use the
EC2Launch v2 settings dialog box (p. 663). For example, if an instance has a scheduled task that runs
InitializeDisks.ps1, then after you run the migration tool, you must specify the volumes you want
to initialize in the EC2Launch v2 settings dialog box. See Step 6 of the procedure to Change settings
using the EC2Launch v2 settings dialog box (p. 663).
You can download the migration tool or install with an SSM RunCommand document.
• 64Bit — https://s3.amazonaws.com/amazon-ec2launch-v2-utils/MigrationTool/windows/amd64/
latest/EC2LaunchMigrationTool.zip
• 32Bit — https://s3.amazonaws.com/amazon-ec2launch-v2-utils/MigrationTool/windows/386/latest/
EC2LaunchMigrationTool.zip
Note
You must run the EC2Launch v2 migration tool as an Administrator. EC2Launch v2 is installed as
a service after you run the migration tool. It does not run immediately. By default, it runs during
instance startup and runs if an instance is stopped and later started, or restarted.
Use the AWSEC2Launch-RunMigration SSM document to migrate to the latest EC2Launch v2 version
with SSM Run Command. The document does not require any parameters. For more information about
using SSM Run Command, see AWS Systems Manager Run Command.
The migration tool applies the following configurations from EC2Config to EC2Launch v2.
The migration tool applies the following configurations from EC2Launch v1 to EC2Launch v2.
660
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
EC2Launch v2 runs once on boot and runs all of the configured tasks. After executing tasks, the service
enters a stopped state. When you restart the service, the service will run all of the configured tasks again
and return to a stopped state.
To apply updated settings to your instance, you can stop and restart the service. If you are manually
installing EC2Launch v2, you must first stop the service first.
If you don’t need to update the configuration settings, create your own AMI, or use AWS Systems
Manager, you can delete and uninstall the service. Deleting a service removes its registry subkey.
Uninstalling a service removes the files, the registry subkeys, and any shortcuts to the service.
sc delete EC2Launch
To uninstall EC2Launch v2
661
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
In the list of installed programs, look for Amazon EC2Launch. Its version number appears in the Version
column.
For information about the EC2Launch v2 versions included in the Windows AMIs, see AWS Windows
AMIs (p. 34).
For the latest version of EC2Launch v2, see EC2Launch v2 version history (p. 698).
For the latest version of the EC2Launch v2 migration tool, see EC2Launch v2 migration tool version
history (p. 701).
You can receive notifications when new versions of the EC2Launch v2 service are released. For more
information, see Subscribe to EC2Launch v2 service notifications (p. 662).
1. Sign in to the AWS Management Console and open the Amazon SNS console at https://
console.aws.amazon.com/sns/v3/home.
2. In the navigation bar, change the Region to US East (N. Virginia), if necessary. You must select this
Region because the SNS notifications that you are subscribing to were created in this Region.
3. In the navigation pane, choose Subscriptions.
4. Choose Create subscription.
5. In the Create subscription dialog box, do the following:
a. For Topic ARN, use the following Amazon Resource Name (ARN): arn:aws:sns:us-
east-1:309726204594:amazon-ec2launch-v2.
b. For Protocol, choose Email.
c. For Endpoint, enter an email address that you can use to receive the notifications.
d. Choose Create subscription.
6. You'll receive an email asking you to confirm your subscription. Open the email and follow the
directions to complete your subscription.
662
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Whenever a new version of the EC2Launch v2 service is released, we send notifications to subscribers. If
you no longer want to receive these notifications, use the following procedure to unsubscribe.
EC2Launch v2 settings
This section contains information about how to configure settings for EC2Launch v2.
Topics include:
• Change settings using the EC2Launch v2 settings dialog box (p. 663)
• EC2Launch v2 directory structure (p. 669)
• Configure EC2Launch v2 using the CLI (p. 670)
• EC2Launch v2 task configuration (p. 675)
• EC2Launch v2 exit codes and reboots (p. 688)
• EC2Launch v2 and Sysprep (p. 689)
663
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
3. On the General tab of the EC2Launch settings dialog box, you can enable or disable the following
settings.
664
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
If this setting is enabled (it is disabled by default), the current host name is compared to the
desired host name at each boot. If the host names do not match, the host name is reset, and
the system then optionally reboots to pick up the new host name. If a custom host name is not
specified, it is generated using the hexadecimal-formatted private IPv4 address, for example,
ip-AC1F4E6. To prevent your existing host name from being modified, do not enable this
setting.
b. Extend Boot Volume
This setting dynamically extends Disk 0/Volume 0 to include any unpartitioned space. This
can be useful when the instance is booted from a root device volume that has a custom size.
c. Set Administrator Account
When enabled, you can set the username and password attributes for the administrator account
that is created on your local machine. If this feature is not enabled, an administrator account
is not created on the system following Sysprep. Provide a password in adminPassword only if
adminPasswordtype is Specify.
i. Random
EC2Launch generates a password and encrypts it using the user's key. The system disables
this setting after the instance is launched so that this password persists if the instance is
rebooted or stopped and started.
ii. Specify
EC2Launch uses the password that you specify in adminPassword. If the password does
not meet the system requirements, EC2Launch generates a random password instead. The
password is stored in agent-config.yml as clear text and is deleted after Sysprep sets
the administrator password. EC2Launch encrypts the password using the user's key.
iii. DoNothing
EC2Launch uses the password that you specify in the unattend.xml file. If you don't specify
a password in unattend.xml, the administrator account is disabled.
d. Start SSM Service
When selected, the Systems Manager service is enabled to start following Sysprep. EC2Launch
v2 performs all of the tasks described earlier (p. 656), and the SSM Agent processes requests
for Systems Manager capabilities, such as Run Command and State Manager.
You can use Run Command to upgrade your existing instances to use the latest version of the
EC2Launch v2 service and SSM Agent. For more information, see Update SSM Agent by using
Run Command in the AWS Systems Manager User Guide.
e. Optimize ENA
When selected, ENA settings are configured to ensure that ENA Receive Side Scaling and Receive
Queue Depth settings are optimized for AWS. For more information, see Configure RSS CPU
affinity (p. 1299).
f. Enable SSH
This setting enables OpenSSH for later Windows versions to allow for remote system
administration.
g. Enable Jumbo Frames
665
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Select to enable Jumbo Frames. Jumbo Frames can have unintended effects on your network
communications, so ensure you understand how Jumbo Frames will impact your system before
enabling. For more information about Jumbo Frames, see Jumbo frames (9001 MTU) (p. 1320).
h. Prepare for Imaging
Select whether you want your EC2 instance to shut down with or without Sysprep. When you
want to run Sysprep with EC2Launch v2, choose Shutdown with Sysprep.
4. On the DNS Suffix tab, you can select whether you want to add a DNS suffix list for DNS resolution
of servers running in EC2, without providing the fully qualified domain name. DNS suffixes can
contain the variables $REGION and $AZ. Only suffixes that do not already exist will be added to the
list.
5. On the Wallpaper tab, you can configure your instance wallpaper with a background image, and
specify instance details for the wallpaper to display. Amazon EC2 generates the details each time
you log in.
• Display instance details on wallpaper – This checkbox activates or deactivates instance detail
display on the wallpaper.
• Image path (.jpg) – Specify the path to the image to use as the wallpaper background.
• Select attributes to display on wallpaper – Select the check boxes for the instance details that
you want to appear on the wallpaper. Clear the check boxes for previously selected instance
details that you want to remove from the wallpaper.
• Display Instance Tags on wallpaper – Select one of the following settings to display instance tags
on the wallpaper:
• None – Don't display any instance tags on the wallpaper.
• Show all – Display all instance tags on the wallpaper.
• Show filtered – Display specified instance tags on the wallpaper. When you select this setting,
you can add instance tags that you want to display on your wallpaper in the Instance tag filter
box.
Note
You must enable tags in metadata to show tags on the wallpaper. For more
information about instance tags and metadata, see Work with instance tags in instance
metadata (p. 1906).
666
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
6. On the Volumes tab, select whether you want to initialize the volumes that are attached to the
instance. Enabling sets drive letters for any additional volumes and extends them to use available
space. If you select All, all of the storage volumes are initialized. If you select Devices, only devices
that are specified in the list are initialized. You must enter the device for each device to be initialized.
Use the devices listed on the EC2 console, for example, xvdb or /dev/nvme0n1. The dropdown list
displays the storage volumes that are attached to the instance. To enter a device that is not attached
to the instance, enter it in the text field.
Name, Letter, and Partition are optional fields. If no value is specified for Partition, storage
volumes larger than 2 TB are initialized with the GPT partition type, and those smaller than 2 TB
are initialized with the MBR partition type. If devices are configured, and a non-NTFS device either
contains a partition table, or the first 4 KB of the disk contain data, then the disk is skipped and the
action logged.
667
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
668
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
The following is an example configuration YAML file created from the settings entered in the EC2Launch
dialog.
version: 1.0
config:
- stage: boot
tasks:
- task: extendRootPartition
- stage: preReady
tasks:
- task: activateWindows
inputs:
activation:
type: amazon
- task: setDnsSuffix
inputs:
suffixes:
- $REGION.ec2-utilities.amazonaws.com
- task: setAdminAccount
inputs:
password:
type: random
- task: setWallpaper
inputs:
path: C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg
attributes:
- hostName
- instanceId
- privateIpAddress
- publicIpAddress
- instanceSize
- availabilityZone
- architecture
- memory
- network
- stage: postReady
tasks:
- task: startSsm
Note
By default, Windows hides files and folders under C:\ProgramData. To view EC2Launch v2
directories and files, you must either enter the path in Windows Explorer or change the folder
properties to show hidden files and folders.
• settings
• EC2LaunchSettingsUI.exe — user interface for modifying the agent-config.yml file
• YamlDotNet.dll — DLL for supporting some operations in the user interface
• tools
• ebsnvme-id.exe — tool for examining the metadata of the EBS volumes on the instance
669
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
• config — Configuration
The service configuration file is stored in this directory as agent-config.yml. This file can be
updated to modify, add, or remove default tasks run by the service. Permission to create files in this
directory is restricted to the administrator account to prevent privilege escalation.
• log — Instance logs
Logs for the service (agent.log), console (console.log), performance (bench.log), and errors
(error.log) are stored in this directory. Log files are appended to on subsequent executions of the
service.
• state — Service state data
The state that the service uses to determine which tasks should run is stored here. There is a .run-
once file that indicates whether the service has already run after Sysprep (so tasks with a frequency
of once will be skipped on the next run). This subdirectory includes a state.json and previous-
state.json to track the status of each task.
• sysprep — Sysprep
This directory contains files that are used to determine which operations to perform by Sysprep when
it creates a customized Windows AMI that can be reused.
Commands
• collect-logs (p. 671)
• get-agent-config (p. 671)
• list-volumes (p. 672)
• reset (p. 672)
• run (p. 672)
• status (p. 673)
• sysprep (p. 673)
• validate (p. 674)
• version (p. 674)
• wallpaper (p. 674)
670
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
collect-logs
Collects log files for EC2Launch, zips the files, and places them in a specified directory.
Example
Usage
Flags
-h, --help
get-agent-config
Prints agent-config.yml in the format specified (JSON or YAML). If no format is specified, agent-
config.yml is printed in the format previously specified.
Example
Example 2
The following PowerShell commands show how to edit and save the agent-config file in JSON format.
Usage
Flags
-h, --help
671
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
list-volumes
Lists all of the storage volumes attached to the instance, including ephemeral and EBS volumes.
Example
ec2launch list-volumes
Usage
ec2launch list-volumes
Flags
-h, --help
reset
Deletes the .run-once file so that tasks specified to run once will run on the next execution; optionally
deletes the service and sysprep logs.
Example
ec2launch reset -c
Usage
Flags
-b, --block
blocks the reset command until the service stops. If the reset command is run with the --block flag as
part of the executeScript task, the detach argument must be set to true. For more information, see
Example 4 under executeScript (p. 681).
-c, --clean
-h, --help
run
Example
ec2launch run
Usage
672
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Flags
-h, --help
status
Gets the status of the EC2Launch v2 agent. Optionally blocks the process until the agent is finished. The
process exit code determines the agent state:
This is the agent state after running the reset (p. 672) command.
Example:
ec2launch status -b
Usage
Flags
-b,--block
-h,--help
sysprep
Resets the agent state, updates unattend.xml, disables RDP, and runs Sysprep.
Example:
ec2launch sysprep
Usage
Flags
-b,--block
673
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
blocks the sysprep command until the agent stops. If the reset command is run with the --block flag
as part of the executeScript task, the detach argument must be set to true. For more information,
see Example 4 under executeScript (p. 681).
-c,--clean
-h,--help
-s,--shutdown
validate
Validates the agent-config file C:\ProgramData\Amazon\EC2Launch\config\agent-
config.yml.
Example
ec2launch validate
Usage
Flags
-h , --help
version
Gets the executable version.
Example
ec2launch version
Usage
Flags
-h, --help
wallpaper
Sets new wallpaper to the wallpaper path that is provided (.jpg file), and displays the selected instance
details.
Syntax
ec2launch wallpaper ^
674
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
--path="C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg" ^
--all-tags ^
--
attributes=hostName,instanceId,privateIpAddress,publicIpAddress,instanceSize,availabilityZone,architect
Inputs
Parameters
(Optional) Base64 encoded JSON array of instance tag names to display on the wallpaper. You can
use this tag or the --all-tags, but not both.
--attributes attribute-string-1, attribute-string-n
Flags
--all-tags
(Optional) Displays all of the instance tags on the wallpaper. You can use this tag or the --
allowed-tags, but not both.
[--help | -h]
Schema: agent-config.yml
The structure of the agent-config.yml file is shown below. Note that a task cannot be repeated in the
same stage. For task properties, see the task descriptions that follow.
JSON
{
"version": "1.0",
"config": [
{
"stage": "string",
"tasks": [
675
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
{
"task": "string",
"inputs": {
...
}
},
...
]
},
...
]
}
YAML
version: 1.0
config:
- stage: string
tasks:
- task: string
inputs:
...
...
...
Example: agent-config.yml
The following example shows settings for the agent-config.yml configuration file.
#version: 1.0
config:
- stage: boot
tasks:
- task: extendRootPartition
- stage: preReady
tasks:
- task: activateWindows
inputs:
activation:
type: amazon
- task: setDnsSuffix
inputs:
suffixes:
- $REGION.ec2-utilities.amazonaws.com
- task: setAdminAccount
inputs:
password:
type: random
- task: setWallpaper
inputs:
path: C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg
attributes:
- hostName
- instanceId
- privateIpAddress
- publicIpAddress
- instanceSize
- availabilityZone
- architecture
- memory
- network
- stage: postReady
tasks:
676
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
- task: startSsm
The following JSON and YAML examples show the document structure for user data. Amazon EC2 parses
each task named in the tasks array that you specify in the document. Each task has its own set of
properties and requirements. For details, see the Task definitions (p. 678).
Note
A task must only appear once in user data tasks array.
JSON
{
"version": "1.1",
"tasks": [
{
"task": "string",
"inputs": {
...
},
},
...
]
}
The following table lists changes for user data, and cross-references them to the EC2Launch v2 agent
version that applies.
1.1 • User data tasks run before the PostReady stage in the agent EC2Launch
config file. v2 version
• Runs user data before starting the Systems Manager Agent (same 2.0.1245
behavior as EC2Launch v1 and EC2Config).*
For more information about user data, see Run commands on your Windows instance at
launch (p. 809).
version: 1.1
677
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
tasks:
- task: executeScript
inputs:
- frequency: always
type: powershell
runAs: localSystem
content: |-
New-Item -Path 'C:\PowerShellTest.txt' -ItemType File
The following format is compatible with the previous version of this service. It is run as an
executeScript task in the UserData stage. To mimic the behavior of the previous version, it will be
set to run as a detached process.
<powershell>
$file = $env:SystemRoot + "\Temp" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
</powershell>
<persist>true</persist>
Task definitions
Each task has its own set of properties and requirements. For details, see the individual tasks that you
want to include in your document.
Tasks
• activateWindows (p. 678)
• enableJumboFrames (p. 679)
• enableOpenSsh (p. 679)
• executeProgram (p. 679)
• executeScript (p. 681)
• extendRootPartition (p. 684)
• initializeVolume (p. 684)
• optimizeEna (p. 685)
• setAdminAccount (p. 685)
• setDnsSuffix (p. 685)
• setHostName (p. 686)
• setWallpaper (p. 686)
• startSsm (p. 687)
• sysprep (p. 688)
• writeFile (p. 688)
activateWindows
Activates Windows against a set of AWS KMS servers. Activation is skipped if the instance is detected as
Bring-Your-Own-License (BYOL).
Frequency — once
AllowedStages — [PreReady]
Inputs —
activation: (map)
678
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Example
task: activateWindows
inputs:
activation:
type: amazon
enableJumboFrames
Enables Jumbo Frames, which increase the maximum transmission unit (MTU) of the network adapter.
For more information, see Jumbo frames (9001 MTU) (p. 1320).
Frequency — always
Inputs — none
Example
task: enableJumboFrames
enableOpenSsh
Enables Windows OpenSSH and adds the public key for the instance to the authorized keys folder.
Frequency — once
Inputs — none
Example
The following example shows how to enable OpenSSH on an instance, and to add the public key for
the instance to the authorized keys folder. This configuration works only on instances running Windows
Server 2019 and later versions.
task: enableOpenSsh
executeProgram
Stages: You can run the executeProgram task during the PreReady, PostReady, and UserData
stages.
Inputs
679
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
path (string)
Output
All of the tasks write logfile entries to the agent.log file. Additional output from the
executeProgram task is stored separately in a dynamically named folder, as follows:
%LocalAppData%\Temp\EC2Launch#########\outputfilename.tmp
The exact path to the output files is included in the agent.log file, for example:
Contains the path for the executable, and all of the input parameters that the
executeProgram task passes to it when it runs.
Output.tmp
Contains runtime output from the program that the executeProgram task runs.
Err.tmp
Contains runtime error messages from the program that the executeProgram task runs.
Examples
The following examples show how to run an executable file from a local directory on an instance
with the executeProgram task.
This example shows an executeProgram task that runs a setup executable in quiet mode.
task: executeProgram
inputs:
- frequency: always
path: C:\Users\Administrator\Desktop\setup.exe
arguments: ['-quiet']
This example shows an executeProgram task that runs a VLC executable file with two arguments
passed as input parameters.
680
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
task: executeProgram
inputs:
- frequency: always
path: C:\vlc-3.0.11-win64.exe
arguments: ['/L=1033','/S']
runAs: localSystem
executeScript
Stages: You can run the executeScript task during the PreReady, PostReady, and UserData stages.
Inputs
(Optional) A list of string arguments to pass to the shell. This parameter isn't supported for
type: batch.
content (string)
(Optional) The EC2Launch agent defaults to run scripts one at a time (detach: false). To run
the script concurrently with other tasks, set the value to true (detach: true).
Note
Script exit codes (including 3010) have no effect when detach is set to true.
Output
All of the tasks write logfile entries to the agent.log file. Additional output from script that the
executeScript task runs is stored separately in a dynamically named folder, as follows:
%LocalAppData%\Temp\EC2Launch#########\outputfilename.ext
681
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
The exact path to the output files is included in the agent.log file, for example:
Contains the script that the executeScript task ran. The file extention depends on the type of
script you specified in the type parameter for the executeScript task, as follows:
• If the type is batch, then the file extension is .bat.
• If the type is powershell, then the file extension is .ps1.
Output.tmp
Contains runtime output from the script that the executeScript task runs.
Err.tmp
Contains runtime error messages from the script that the executeScript task runs.
Examples
The following examples show how to run an inline script with the executeScript task.
This example shows an executeScript task that runs a PowerShell script to create a "Hello world"
text file on the C: drive.
task: executeScript
inputs:
- frequency: always
type: powershell
runAs: admin
content: |-
New-Item -Path 'C:\PowerShellTest.txt' -ItemType File
Set-Content 'C:\PowerShellTest.txt' "Hello world"
This example shows that the executeScript task can run more than one script, and the script type
doesn't necessarily need to match.
The first script (type: powershell) writes a summary of the processes that are currently running
on the instance to a text file located on the C: drive.
The second script (batch) writes the system information to the Output.tmp file.
task: executeScript
inputs:
- frequency: always
type: powershell
content: |
Get-Process | Out-File -FilePath C:\Process.txt
682
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
runAs: localSystem
- frequency: always
type: batch
content: |
systeminfo
This example shows an executeScript task that runs an idempotent script to perform the
following system configuration with a reboot between each step:
• Rename the computer.
• Join the computer to the domain.
• Enable Telnet.
The script ensures that each operation runs one time only. This prevents a reboot loop and makes
the script idempotent.
task: executeScript
inputs:
- frequency: always
type: powershell
runAs: localSystem
content: |-
$name = $env:ComputerName
if ($name -ne $desiredName) {
Rename-Computer -NewName $desiredName
exit 3010
}
$domain = Get-ADDomain
if ($domain -ne $desiredDomain)
{
Add-Computer -DomainName $desiredDomain
exit 3010
}
$telnet = Get-WindowsFeature -Name Telnet-Client
if (-not $telnet.Installed)
{
Install-WindowsFeature -Name "Telnet-Client"
exit 3010
}
Example 4: Reset the launch agent state with a blocking CLI command
This example shows an executeScript task that runs a blocking CLI command to reset the launch
agent.
To ensure that the agent finishes any tasks that are currently running before your script runs a
reset or sysprep CLI command, you must include the --block flag (-b in this example). To
prevent a potential deadlock error on the command, you must also set the detach argument for
this task to true. If Amazon EC2 detects a potential deadlock, caused by using the --block flag in
a non-detached script, it exits the command with an error.
task: executeScript
inputs:
- frequency: always
type: powershell
runAs: localSystem
detach: true
content: |-
& 'C:\Program Files\Amazon\EC2Launch\ec2launch.exe' reset -c -b
683
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
extendRootPartition
Extends the root volume to use all of the available space on the disk.
Frequency — once
AllowedStages — [Boot]
Inputs — none
Example
task: extendRootParitition
initializeVolume
Initializes volumes attached to the instance so that they are activated and partitioned. Any volumes that
are detected as not empty are not initialized. A volume is considered empty if the first 4 KiB of a volume
are empty, or if a volume does not have a Windows-recognizable drive layout. The volume letter field
is always applied when this task runs, regardless of whether the drive is already initialized.
Frequency — always
Inputs —
device: device identifier used when creating the instance; some examples are xvdb, xvdf, or /dev/
nvme0n1
Example 1
The following example shows inputs for the InitializeVolume task to set selected volumes to be
initialized.
task: initializeVolume
inputs:
initialize: devices
devices:
- device: xvdb
name: MyVolumeOne
letter: D
partition: mbr
- device: /dev/nvme0n1
name: MyVolumeTwo
letter: E
partition: gpt
Example 2
684
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
The following example shows how to initialize EBS volumes that are attached to an instance. This
configuration will initialize all empty EBS volumes that are attached to the instance. If a volume is not
empty, then it will not be initialized.
task: initializeVolume
inputs:
initialize: all
optimizeEna
Optimizes ENA settings based on the current instance type; might reboot the instance.
Frequency — always
Inputs — none
Example
task: optimizeEna
setAdminAccount
Sets attributes for the default administrator account that is created on the local machine.
Frequency — once
AllowedStages — [PreReady]
Inputs —
password: (map)
type: (string) strategy to set the password, either as static, random, or doNothing
Example
task: setAdminAccount
inputs:
name: Administrator
password:
type: random
setDnsSuffix
Adds DNS suffixes to the list of search suffixes. Only suffixes that do not already exist are added to the
list.
Frequency — always
AllowedStages — [PreReady]
Inputs —
suffixes: (list of strings) list of one or more valid DNS suffixes; valid substitution variables are $REGION
and $AZ
685
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Example
task: setDnsSuffix
inputs:
suffixes:
- $REGION.ec2-utilities.amazonaws.com
setHostName
Sets the hostname of the computer to a custom string or, if hostName is not specified, the private IPv4
address.
Frequency — always
Inputs —
reboot: (boolean) denotes whether a reboot is permitted when the hostname is changed
Example
task: setHostName
inputs:
reboot: true
setWallpaper
Creates the setwallpaper.lnk shortcut file in the startup folder of each existing user except for
Default User. This shortcut file runs when the user logs in for the first time after instance boot. It sets
up the instance with a custom wallpaper that displays the instance attributes.
$env:SystemDrive/Users/<user>/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/
Startup/setwallpaper.lnk
Note
When you remove the setWallpaper task, it does not delete this shortcut file. For
more information, see setWallpaper task is not enabled but the wallpaper resets at
reboot (p. 691).
Stages: You can configure wallpaper during the PreReady, and UserData stages.
Frequency: always
Wallpaper configuration
Inputs
Input parameters that you provide, and attributes that you can set to configure your wallpaper:
686
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
(Optional) You can add one or more of the following attributes to your wallpaper:
• architecture
• availabilityZone
• hostName
• instanceId
• instanceSize
• memory
• network
• privateIpAddress
• publicIpAddress
instanceTags
(Optional) You can use exactly one of the following options for this setting.
• AllTags (string) – Add all instance tags to your wallpaper.
instanceTags: AllTags
• instanceTags (list of strings) – Specify a list of instance tag names to add to your wallpaper.
For example:
instanceTags:
- Tag 1
- Tag 2
path (string)
(Required) The filename path of the local .jpg format image file to use for your wallpaper image.
Example
The following example shows wallpaper configuration inputs that set the file path for the wallpaper
background image, along with instance tags named Tag 1 and Tag 2, and attributes that include the
host name, instance ID, and private and public IP addresses for the instance.
task: setWallpaper
inputs:
path: C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg
attributes:
- hostName
- instanceId
- privateIpAddress
- publicIpAddress
instanceTags:
- Tag 1
- Tag 2
Note
You must enable tags in metadata to show tags on the wallpaper. For more information about
instance tags and metadata, see Work with instance tags in instance metadata (p. 1906).
startSsm
687
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Frequency — always
Inputs — none
Example
task: startSsm
sysprep
Resets the service state, updates unattend.xml, disables RDP, and runs Sysprep. This task runs only
after all other tasks are completed.
Frequency — once
AllowedStages — [UserData]
Inputs —
Example
task: sysprep
inputs:
clean: true
shutdown: true
writeFile
Inputs —
Example
task: writeFile
inputs:
- frequency: once
destination: C:\Users\Administrator\Desktop\booted.txt
content: Windows Has Booted
688
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
if a script includes three commands and the first command fails but the following ones succeed, the run
status is reported as success because the final command succeeded.
If you want a script to reboot an instance, then you must specify exit 3010 in your script, even when
the reboot is the last step in your script. exit 3010 instructs EC2Launch v2 to reboot the instance and
call the script again until it returns an exit code that is not 3010, or until the maximum reboot count
has been reached. EC2Launch v2 permits a maximum of 5 reboots per task. If you attempt to reboot an
instance from a script by using a different mechanism, such as Restart-Computer, then the script run
status will be inconsistent. For example, it may get stuck in a restart loop or not perform the restart.
If you are using an XML user data format that is compatible with older agents, the user data may
run more times than you intend it to. For more information, see Service runs user data more than
once (p. 690) in the Troubleshooting section.
If you create an AMI from an instance after updating its settings, the new settings are applied to any
instance that's launched from the new AMI. For information about creating an AMI, see Create a custom
Windows AMI (p. 143).
Troubleshoot EC2Launch v2
This section shows common troubleshooting scenarios for EC2Launch v2, information about viewing
Windows event logs, and console log output and messages.
Troubleshooting topics
• Common troubleshooting scenarios (p. 689)
• Windows event logs (p. 693)
• EC2Launch v2 console log output (p. 696)
Scenarios
• Service fails to set the wallpaper (p. 690)
• Service fails to run user data (p. 690)
• Service runs a task only one time (p. 690)
• Service fails to run a task (p. 690)
• Service runs user data more than once (p. 690)
• Scheduled tasks from EC2Launch v1 fail to run after migration to EC2Launch v2 (p. 691)
• Service initializes an EBS volume that is not empty (p. 691)
• setWallpaper task is not enabled but the wallpaper resets at reboot (p. 691)
• Service stuck in running status (p. 692)
• Invalid agent-config.yml prevents opening EC2Launch v2 settings dialog box (p. 692)
• task:executeScript should be unique and only invoked once (p. 693)
689
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Resolution
Possible cause: Service may have failed before running user data.
Resolution
1. Check %ProgramData%\Amazon\EC2Launch\state\previous-state.json.
2. See if boot, network, preReady, and postReadyLocalData have all been marked as success.
3. If one of the stages failed, check %ProgramData%\Amazon\EC2Launch\log\agent.log for
specific errors.
Resolution
Resolution
Resolution
User data is handled differently between EC2Launch v1 and EC2Launch v2. EC2Launch v1 runs user data
as a scheduled task on the instance when persist is set to true. If persist is set to false, the task is
not scheduled even when it exits with a reboot or is interrupted while running.
EC2Launch v2 runs user data as an agent task and tracks its run state. If user data issues a computer
restart or if user data was interrupted while running, the run state persists as pending and the user data
will run again at the next instance boot. If you want to prevent the user data script from running more
than once, make the script idempotent.
The following example idempotent script sets the computer name and joins a domain.
<powershell>
$name = $env:computername
if ($name -ne $desiredName) {
690
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Resolution
The migration tool does not detect any scheduled tasks linked to EC2Launch v1 scripts; therefore, it
does not automatically set up those tasks in EC2Launch v2. To configure these tasks, edit the agent-
config.yml (p. 675) file, or use the EC2Launch v2 settings dialog box (p. 663). For example, if an
instance has a scheduled task that runs InitializeDisks.ps1, then after you run the migration tool,
you must specify the volumes you want to initialize in the EC2Launch v2 settings dialog box. See Step 6
of the procedure to Change settings using the EC2Launch v2 settings dialog box (p. 663).
Resolution
The setWallpaper task creates the setwallpaper.lnk shortcut file in the startup folder of each
existing user except for Default User. This shortcut file runs when the user logs in for the first time
after instance boot. It sets up the instance with a custom wallpaper that displays the instance attributes.
Removing the setWallpaper task does not delete this shortcut file. You must manually delete this file
or delete it using a script.
$env:SystemDrive/Users/<user>/AppData/Roaming/Microsoft/Windows/Start Menu/
Programs/Startup/setwallpaper.lnk
Resolution
691
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Description
• Commands that run in blocking mode, such as sysprep (p. 673) and reset (p. 672), are blocked with
output similar to the following:
Possible cause
SAC is enabled and using the serial port. For more information, see Use SAC to troubleshoot your
Windows instance.
Resolution
Description
EC2Launch v2 settings attempts to parse the agent-config.yml file before it opens the dialog box.
If the YAML configuration file does not follow the supported schema, the dialog box will show the
following error:
692
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
Resolution
1. Verify that the configuration file follows the supported schema (p. 675).
2. If you want to start from scratch, copy the default configuration file into agent-config.yml. You
can use the example agent-config.yml (p. 676) provided in the Task Configuration section.
3. You can also start over by deleting agent-config.yml. EC2Launch v2 settings generates an empty
configuration file.
Description
Resolution
Some tasks must be input as an array, such as executeScript (p. 681) and executeProgram (p. 679).
For an example of how to write the script as an array, see executeScript (p. 681).
Event IDs provide information about an event and uniquely identify some events. The least significant
digit of an event ID indicates the severity of an event.
Success . . .0
Informational . . .1
Warning . . .2
Error . . .3
Service-related events that are generated when the service starts or stops include a single digit event
identifier.
Success 0
Informational 1
Warning 2
Error 3
693
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
The event messages for EC2LaunchService.exe events begin with Service:. The event messages for
EC2Launch.exe events do not begin with Service:.
Four digit event IDs include information about the stage, task, and severity of an event.
Topics
• Event ID format (p. 694)
• Event ID examples (p. 694)
• Windows event log schema (p. 695)
Event ID format
3 21 0
S T L
The letters and numbers in the table represent the following event type and definitions.
1 - Boot
2 - Network
3 - PreReady
5 - Windows is Ready
6 - PostReady
7 - User Data
1 - Informational
2 - Warning
3 - Error
Event ID examples
694
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
• 6013 - Set wallpaper task in PostReady Local Data stage encountered an error
. . .0 Success
. . .1 Informational
. . .2 Warning
. . .3 Error
200 Sysprep
300 PrimaryNic
400 Metadata
1000 Boot
2000 Network
3000 PreReady
695
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
6000 PostReadyLocalData
7000 PostReadyUserData
6010/7010 PostReadyLocal/UserData -
set_wallpaper
6020/7020 PostReadyLocal/UserData -
set_update_schedule
6040/7040 PostReadyLocal/UserData -
execute_program
6050/7050 PostReadyLocal/UserData -
execute_script
6060/7060 PostReadyLocal/UserData -
manage_package
6070/7070 PostReadyLocal/UserData -
initialize_volume
6110/7110 PostReadyLocal/UserData -
enable_jumbo_frames
Outputs
• EC2Launch v2 console log output (p. 696)
• EC2Launch v2 console log messages (p. 697)
696
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
697
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
2.0.1303 • Added additional error handling and log lines when adding May 3, 2023
network routes.
• Allowed executeScript and executeProgram tasks in the
PreReady stage.
• Updated executeProgram task to generate output files similar
to the output from the executeScript task. For more information,
see executeProgram (p. 679).
• Added telemetry to monitor usage of blocking agent commands
in XML user data.
2.0.1245 • Improved visibility into crashes by logging crash call stacks in March 8, 2023
clear text.
• Added the EventLog service as a startup dependency to fix a
crash when the Amazon EC2Launch service starts up faster than
the EventLog service.
• Made XML user data run before PostReady stage from the agent
config file (like EC2Launch v1 and EC2Config).
• Added YAML user data version 1.1 to make user data run before
PostReady stage from the agent config file (YAML user data
version 1.0 runs after PostReady stage from the agent config file).
698
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
2.0.1121 • Fixes an issue where a 404 error is printed to the wallpaper when January 4,
no public IPv4 address is assigned. 2023
• Fixes an issue where the volume's file system is formatted as RAW
instead of NTFS when its device's drive letter is set to D.
• Fixes an issue where NVMe SSD volumes are incorrectly identified
as EBS volumes.
• Fixes an error when activating Windows when IMDS is disabled.
2.0.1011 • Fixes logic for finding network adapter when PnPDeviceID is November 11,
empty. 2022
2.0.1009 • Uses PCI segment information to select the console port. November 8,
2022
2.0.863 • Updates IMDS wait logic to make only IMDSv2 requests. July 6, 2022
• Adds logic to assign drive letter to volumes that are already
initialized but not mounted.
• Prints a more specific error message when key pair type is not
supported.
• Fixes 3010 reboot code bug.
• Adds check for invalid base64-encoded user data.
2.0.698 • Fixes typo in log output when executing scripts. January 30,
2022
699
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
2.0.470 • Fixes bug in network stage to wait for DHCP to assign an IP to the July 20, 2021
instance.
• Fixes bug with setDnsSuffix when SearchList registry key
does not exist.
• Fixes bug in DNS devolution logic in setDnsSuffix.
• Adds network routes after intermediate reboots.
• Allows initializeVolume to re-letter existing volumes.
• Removes extra information from version subcommand.
2.0.285 • Adds option to run user scripts in a detached process. March 8, 2021
• Legacy userdata (XML userdata) now runs in a detached process,
which is similar behavior to the prior launch agent.
• Adds CLI flag to the sysprep and reset commands, which
allows them to block until the service stops.
• Restricts the config folder permissions.
700
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch v2
2.0.104 • Creates DNS suffix search list if it does not exist. August 12,
• Skips Hibernation if not requested. 2020
1.0.272 Change to use the latest version of the EC2Launch agent: 2.0.1303. May 3, 2023
1.0.262 Change to use the latest version of the EC2Launch agent: 2.0.1245. March 9, 2023
1.0.162 • Moves logic to remove legacy agents to the EC2Launch v2 MSI. March 18,
• Increments the version number of the EC2Launch agent to 2022
2.0.698.
1.0.136 Increments the version number of the EC2Launch agent to 2.0.651. October 13,
2021
1.0.130 Increments the version number of the EC2Launch agent to 2.0.548. August 5, 2021
1.0.101 Increments the version number of the EC2Launch agent to 2.0.285. March 12,
2021
1.0.86 Increments the version number of the EC2Launch agent to 2.0.207. February 3,
2021
1.0.76 Increments the version number of the EC2Launch agent to 2.0.160. December 4,
2020
1.0.69 Increments the version number of the EC2Launch agent to 2.0.153. November 5,
2020
1.0.65 Increments the version number of the EC2Launch agent to 2.0.146. October 9,
2020
1.0.60 Increments the version number of the EC2Launch agent to 2.0.124. September 10,
2020
701
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
Contents
• EC2Launch tasks (p. 702)
• Telemetry (p. 703)
• Install the latest version of EC2Launch (p. 704)
• Verify the EC2Launch version (p. 704)
• EC2Launch directory structure (p. 704)
• Configure EC2Launch (p. 705)
• EC2Launch version history (p. 708)
EC2Launch tasks
EC2Launch performs the following tasks by default during the initial instance boot:
702
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
The following tasks help to maintain backward compatibility with the EC2Config service. You can also
configure EC2Launch to perform these tasks during startup:
For more information about Windows Server 2019, see Compare Features in Windows Server Versions on
Microsoft.com.
Telemetry
Telemetry is additional information that helps AWS to better understand your requirements, diagnose
issues, and deliver features to improve your experience with AWS services.
EC2Launch version 1.3.2003498 and later collect telemetry, such as usage metrics and errors. This data
is collected from the Amazon EC2 instance on which EC2Launch runs. This includes all Windows AMIs
owned by AWS.
• Usage information — agent commands, install method, and scheduled run frequency.
• Errors and diagnostic information — agent installation and run error codes.
Telemetry is enabled by default. You can disable telemetry collection at any time. If telemetry is enabled,
EC2Launch sends telemetry data without additional customer notifications.
You can opt in or out of telemetry collection. Your selection to opt in or out of telemetry is collected to
ensure that we adhere to your telemetry option.
Telemetry visibility
When telemetry is enabled, it appears in the Amazon EC2 console output as follows:
To disable telemetry by setting a system environment variable, run the following command as an
administrator:
setx /M EC2LAUNCH_TELEMETRY 0
703
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
. .\install.ps1 -EnableTelemetry:$false
Use the following procedure to download and install the latest version of EC2Launch on your instances.
1. If you have already installed and configured EC2Launch on an instance, make a backup of the
EC2Launch configuration file. The installation process does not preserve changes in this file. By
default, the file is located in the C:\ProgramData\Amazon\EC2-Windows\Launch\Config
directory.
2. Download EC2-Windows-Launch.zip to a directory on the instance.
3. Download install.ps1 to the same directory where you downloaded EC2-Windows-Launch.zip.
4. Run install.ps1
5. If you made a backup of the EC2Launch configuration file, copy it to the C:\ProgramData\Amazon
\EC2-Windows\Launch\Config directory.
If you have already installed and configured EC2Launch on an instance, make a backup of the EC2Launch
configuration file. The installation process does not preserve changes in this file. By default, the file is
located in the C:\ProgramData\Amazon\EC2-Windows\Launch\Config directory.
To install the latest version of EC2Launch using PowerShell, run the following commands from a
PowerShell window
mkdir $env:USERPROFILE\Desktop\EC2Launch
$Url = "https://s3.amazonaws.com/ec2-downloads-windows/EC2Launch/latest/EC2-Windows-
Launch.zip"
$DownloadZipFile = "$env:USERPROFILE\Desktop\EC2Launch\" + $(Split-Path -Path $Url -Leaf)
Invoke-WebRequest -Uri $Url -OutFile $DownloadZipFile
$Url = "https://s3.amazonaws.com/ec2-downloads-windows/EC2Launch/latest/install.ps1"
$DownloadZipFile = "$env:USERPROFILE\Desktop\EC2Launch\" + $(Split-Path -Path $Url -Leaf)
Invoke-WebRequest -Uri $Url -OutFile $DownloadZipFile
& $env:USERPROFILE\Desktop\EC2Launch\install.ps1
704
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
Note
By default, Windows hides files and folders under C:\ProgramData. To view EC2Launch
directories and files, you must either type the path in Windows Explorer or change the folder
properties to show hidden files and folders.
All EC2Launch directories inherit their permissions from C:\ProgramData, with the exception of the
following:
Configure EC2Launch
After your instance has been initialized the first time, you can configure EC2Launch to run again and
perform different start-up tasks.
Tasks
• Configure initialization tasks (p. 705)
• Schedule EC2Launch to run on every boot (p. 706)
• Initialize drives and map drive letters (p. 707)
• Send Windows event logs to the EC2 console (p. 707)
• Send Windows is ready message after a successful boot (p. 708)
1. On the instance to configure, open the following file in a text editor: C:\ProgramData\Amazon
\EC2-Windows\Launch\Config\LaunchConfig.json.
705
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
2. Update the following settings as needed and save your changes. Provide a password in
adminPassword only if adminPasswordtype is Specify.
{
"setComputerName": false,
"setMonitorAlwaysOn": true,
"setWallpaper": true,
"addDnsSuffixList": true,
"extendBootVolumeSize": true,
"handleUserData": true,
"adminPasswordType": "Random | Specify | DoNothing",
"adminPassword": "password that adheres to your security policy (optional)"
}
Random
EC2Launch generates a password and encrypts it using the user's key. The system disables this
setting after the instance is launched so that this password persists if the instance is rebooted or
stopped and started.
Specify
EC2Launch uses the password you specify in adminPassword. If the password does not meet
the system requirements, EC2Launch generates a random password instead. The password is
stored in LaunchConfig.json as clear text and is deleted after Sysprep sets the administrator
password. EC2Launch encrypts the password using the user's key.
DoNothing
EC2Launch uses the password you specify in the unattend.xml file. If you don't specify a
password in unattend.xml, the administrator account is disabled.
3. In Windows PowerShell, run the following command to schedule the script to run as a Windows
Scheduled Task. The script runs one time during the next boot and then disables these tasks from
running again.
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -
Schedule
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -
SchedulePerBoot
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Settings\Ec2LaunchSettings.exe
Then select Run EC2Launch on every boot. You can specify that your EC2 instance Shutdown
without Sysprep or Shutdown with Sysprep.
706
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
Note
When you enable EC2Launch to run on every boot, the following happens the next time
EC2Launch runs:
{
"driveLetterMapping": [
{
"volumeName": "sample volume",
"driveLetter": "H"
}
]
}
3. Open Windows PowerShell and use the following command to run the EC2Launch script that
initializes the disks:
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeDisks.ps1
To initialize the disks each time the instance boots, add the -Schedule flag as follows:
{
"events": [
707
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
{
"logName": "System",
"source": "An event source (optional)",
"level": "Error | Warning | Information",
"numEntries": 3
}
]
}
3. In Windows PowerShell, run the following command so that the system schedules the script to run
as a Windows Scheduled Task each time the instance boots.
The logs can take three minutes or more to appear in the EC2 console logs.
To download and install the latest version of EC2Launch, see Install the latest version of
EC2Launch (p. 704).
The following table describes the released versions of EC2Launch. Note that the version format changed
after version 1.3.610.
1.3.2004052 • Fixed an error that occurred when no SSH key is specified at 8 March 2023
instance launch.
• Updated to retry starting the AmazonSSMAgent Windows service
on failure.
• Updated to fail SysprepInstance.ps1 if BeforeSysprep.cmd fails
with a non-zero exit code.
1.3.2003961 • Fixed issue where explicitly specified administrator passwords are 6 December
overwritten with a random password on fast-launched instances. 2022
• Fixed issue where SSM Agent fails to start on smaller instance
types.
• Fixed an issue where the instance console log
contains RDPCERTIFICATE-THUMBPRINT:
708
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
1.3.2003923 • Fixes logic for finding network adapter when PnPDeviceID is 9 November
empty. 2022
1.3.2003857 • Prioritizes adapters with a default gateway when the primary 3 October
network adapter is selected. 2022
• Extended in-memory password encryption.
1.3.2003691 • Updated IMDS wait logic to make only IMDSv2 requests. 21 June 2022
• Fixed bug impacting eGPU installation.
1.3.2003639 • Added network-adapter wait logic to prevent use before 10 May 2022
initialization.
• Fixed minor issues.
1.3.2003411 Changed password generation logic to exclude passwords with low 04 August
complexity. 2021
1.3.2003312 • Added log lines before and after setMonitorAlwaysOn setting. 04 May 2021
• Added AWS Nitro Enclaves package version to console log.
1.3.2003284 Improved permission model by updating location for storing user 23 March 2021
data to LocalAppData.
709
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
1.3.2001660 Fixed automatic login issue for users without password after first 2 July 2019
time executing Sysprep.
1.3.2001200 Fixed issue with InitializeDisks.ps1 where running the script on a 27 February
node in a Microsoft Windows Server Failover Cluster would format 2019
drives on remote nodes whose drive letter matched the local drive
letter.
1.3.2001040 • Added plugin for setting the monitor to never turn off to fix ACPI 21 January
issues. 2019
• SQL Server edition and version written to console.
1.3.2000760 • Added default configuration for RSS and Receive Queue settings 5 December
for ENA devices. 2018
• Disabled hibernation during Sysprep.
710
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Launch
1.3.200039.0 • Fixed improper drive lettering for EBS NVME volumes. 15 August
• Added additional logging for NVME driver versions. 2018
1.3.610 Fixed issue with redirecting output and errors to files from user
data.
1.3.580 • Fixed Get-Metadata to use the default system proxy settings for
web requests.
• Added a special case for NVMe in disk initialization.
• Fixed minor issues.
711
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
Windows AMIs for Windows Server 2012 R2 and earlier include an optional service, the EC2Config service
(EC2Config.exe). EC2Config starts when the instance boots and performs tasks during startup and
each time you stop or start the instance. EC2Config can also perform tasks on demand. Some of these
tasks are automatically enabled, while others must be enabled manually. Although optional, this service
provides access to advanced features that aren't otherwise available. This service runs in the LocalSystem
account.
Note
EC2Launch replaced EC2Config on Windows AMIs for Windows Server 2016 and 2019. For more
information, see Configure a Windows instance using EC2Launch (p. 702). The latest launch
service for all supported Windows Server versions is EC2Launch v2 (p. 653), which replaces
both EC2Config and EC2Launch.
EC2Config uses settings files to control its operation. You can update these settings files using either a
graphical tool or by directly editing XML files. The service binaries and additional files are contained in
the %ProgramFiles%\Amazon\EC2ConfigService directory.
Contents
• EC2Config tasks (p. 712)
• Install the latest version of EC2Config (p. 713)
• Stop, restart, delete, or uninstall EC2Config (p. 715)
• EC2Config and AWS Systems Manager (p. 715)
• EC2Config and Sysprep (p. 716)
• EC2 service properties (p. 716)
• EC2Config settings files (p. 719)
• Configure proxy settings for the EC2Config service (p. 723)
• EC2Config version history (p. 725)
• Troubleshoot issues with the EC2Config service (p. 737)
EC2Config tasks
EC2Config runs initial startup tasks when the instance is first started and then disables them. To run
these tasks again, you must explicitly enable them prior to shutting down the instance, or by running
Sysprep manually. These tasks are as follows:
EC2Config performs the following tasks every time the instance starts:
• Change the host name to match the private IP address in Hex notation (this task is disabled by default
and must be enabled in order to run at instance start).
712
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
• Configure the key management server (AWS KMS), check for Windows activation status, and activate
Windows as necessary.
• Mount all Amazon EBS volumes and instance store volumes, and map volume names to drive letters.
• Write event log entries to the console to help with troubleshooting (this task is disabled by default and
must be enabled in order to run at instance start).
• Write to the console that Windows is ready.
• Add a custom route to the primary network adapter to enable the following IP addresses when a single
NIC or multiple NICs are attached: 169.254.169.250, 169.254.169.251, and 169.254.169.254.
These addresses are used by Windows Activation and when you access instance metadata.
Note
If the Windows OS is configured to use IPv4, these IPv4 link-local addresses can be used. If
the Windows OS has the IPv4 network protocol stack disabled and uses IPv6 instead, add
[fd00:ec2::240] in place of 169.254.169.250 and 169.254.169.251. Then add
[fd00:ec2::254] in place of 169.254.169.254.
EC2Config performs the following task every time a user logs in:
While the instance is running, you can request that EC2Config perform the following task on demand:
• Run Sysprep and shut down the instance so that you can create an AMI from it. For more information,
see Create a standardized Amazon Machine Image (AMI) using Sysprep (p. 146).
For information about how to receive notifications for EC2Config updates, see Subscribe to EC2Config
service notifications (p. 737). For information about the changes in each version, see the EC2Config
version history (p. 725).
713
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
Update EC2Config
Note
We require TLS 1.2 and recommend TLS 1.3. Your client must meet this requirement to
download from Amazon Simple Storage Service (Amazon S3). For more information, see TLS 1.2
to become the minimum TLS protocol level for all AWS API endpoints.
Use the following procedure to download and install the latest version of EC2Config on your instances.
To download, unzip, and install the latest version of EC2Config using PowerShell, run the following
commands from a PowerShell window:
$Url = "https://s3.amazonaws.com/ec2-downloads-windows/EC2Config/EC2Install.zip"
$DownloadZipFile = "$env:USERPROFILE\Desktop\" + $(Split-Path -Path $Url -Leaf)
$ExtractPath = "$env:USERPROFILE\Desktop\"
Invoke-WebRequest -Uri $Url -OutFile $DownloadZipFile
$ExtractShell = New-Object -ComObject Shell.Application
$ExtractFiles = $ExtractShell.Namespace($DownloadZipFile).Items()
$ExtractShell.NameSpace($ExtractPath).CopyHere($ExtractFiles)
Start-Process $ExtractPath
Start-Process `
-FilePath $env:USERPROFILE\Desktop\EC2Install.exe `
-ArgumentList "/S"
714
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
To apply updated settings to your instance, you can stop and restart the service. If you're manually
installing EC2Config, you must stop the service first.
If you don't need to update the configuration settings, create your own AMI, or use AWS Systems
Manager, you can delete and uninstall the service. Deleting a service removes its registry subkey.
Uninstalling a service removes the files, the registry subkey, and any shortcuts to the service.
sc delete ec2config
To uninstall EC2Config
Instances created from AMIs for versions of Windows Server prior to Windows Server 2016 that were
published after November 2016 include the EC2Config service and SSM Agent. EC2Config performs all of
the tasks described earlier, and SSM Agent processes requests for Systems Manager capabilities like Run
Command and State Manager.
You can use Run Command to upgrade your existing instances to use to the latest version of the
EC2Config service and SSM Agent. For more information, see Update SSM Agent by using Run Command
in the AWS Systems Manager User Guide.
715
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
If you create an AMI from an instance after updating its settings, the new settings are applied to any
instance that's launched from the new AMI. For information about creating an AMI, see Create a custom
Windows AMI (p. 143).
3. On the General tab of the EC2 Service Properties dialog box, you can enable or disable the
following settings.
716
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
If this setting is enabled (it is disabled by default), the host name is compared to the current
internal IP address at each boot; if the host name and internal IP address do not match, the
host name is reset to contain the internal IP address and then the system reboots to pick up the
new host name. To set your own host name, or to prevent your existing host name from being
modified, do not enable this setting.
User Data
User data execution enables you to specify scripts in the instance metadata. By default, these
scripts are run during the initial launch. You can also configure them to run the next time you
reboot or start the instance, or every time you reboot or start the instance.
If you have a large script, we recommend that you use user data to download the script, and
then run it.
Use this setting to display event log entries on the console during boot for easy monitoring and
debugging.
Click Settings to specify filters for the log entries sent to the console. The default filter sends
the three most recent error entries from the system event log to the console.
Wallpaper Information
Use this setting to display system information on the desktop background. The following is an
example of the information displayed on the desktop background.
The information displayed on the desktop background is controlled by the settings file
EC2ConfigService\Settings\WallpaperSettings.xml.
Enable Hibernation
Use this setting to allow EC2 to signal the operating system to perform hibernation.
4. Click the Storage tab. You can enable or disable the following settings.
717
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
Root Volume
This setting dynamically extends Disk 0/Volume 0 to include any unpartitioned space. This can
be useful when the instance is booted from a root device volume that has a custom size.
Initialize Drives
This setting formats and mounts all volumes attached to the instance during start.
Drive Letter Mapping
The system maps the volumes attached to an instance to drive letters. For Amazon EBS
volumes, the default is to assign drive letters going from D: to Z:. For instance store volumes,
the default depends on the driver. AWS PV drivers and Citrix PV drivers assign instance store
volumes drive letters going from Z: to A:. Red Hat drivers assign instance store volumes drive
letters going from D: to Z:.
To choose the drive letters for your volumes, click Mappings. In the DriveLetterSetting dialog
box, specify the Volume Name and Drive Letter values for each volume, click Apply, and then
click OK. We recommend that you select drive letters that avoid conflicts with drive letters that
are likely to be in use, such as drive letters in the middle of the alphabet.
718
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
After you specify a drive letter mapping and attach a volume with same label as one of the
volume names that you specified, EC2Config automatically assigns your specified drive letter
to that volume. However, the drive letter mapping fails if the drive letter is already in use. Note
that EC2Config doesn't change the drive letters of volumes that were already mounted when
you specified the drive letter mapping.
5. To save your settings and continue working on them later, click OK to close the EC2 Service
Properties dialog box. If you have finished customizing your instance and want to create an AMI
from that instance, see Create a standardized Amazon Machine Image (AMI) using Sysprep (p. 146).
ActivationSettings.xml
This file contains settings that control product activation. When Windows boots, the EC2Config service
checks whether Windows is already activated. If Windows is not already activated, it attempts to activate
Windows by searching for the specified AWS KMS server.
719
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
• DoActivate—Attempts activation using the specified settings in the section. This value can be true
or false.
• LogResultToConsole—Displays the result to the console.
BundleConfig.xml
This file contains settings that control how EC2Config prepares an instance for AMI creation.
• AutoSysprep—Indicates whether to use Sysprep automatically. Change the value to Yes to use
Sysprep.
• SetRDPCertificate—Sets a self-signed certificate to the Remote Desktop server. This enables
you to securely RDP into the instances. Change the value to Yes if the new instances should have the
certificate.
This setting is not used with Windows Server 2008 or Windows Server 2012 instances because they
can generate their own certificates.
• SetPasswordAfterSysprep—Sets a random password on a newly launched instance, encrypts it
with the user launch key, and outputs the encrypted password to the console. Change the value of this
setting to No if the new instances should not be set to a random encrypted password.
Config.xml
Plug-ins
• Ec2SetPassword—Generates a random encrypted password each time you launch an instance. This
feature is disabled by default after the first launch so that reboots of this instance don't change a
password set by the user. Change this setting to Enabled to continue to generate passwords each
time you launch an instance.
This setting is important if you are planning to create an AMI from your instance.
• Ec2SetComputerName—Sets the host name of the instance to a unique name based on the IP
address of the instance and reboots the instance. To set your own host name, or prevent your existing
host name from being modified, you must disable this setting.
• Ec2InitializeDrives—Initializes and formats all volumes during startup. This feature is enabled
by default.
• Ec2EventLog—Displays event log entries in the console. By default, the three most recent error
entries from the system event log are displayed. To specify the event log entries to display, edit the
EventLogConfig.xml file located in the EC2ConfigService\Settings directory. For information
about the settings in this file, see Eventlog Key in the MSDN Library.
• Ec2ConfigureRDP—Sets up a self-signed certificate on the instance, so users can securely access the
instance using Remote Desktop. This feature is disabled on Windows Server 2008 and Windows Server
2012 instances because they can generate their own certificates.
• Ec2OutputRDPCert—Displays the Remote Desktop certificate information to the console so that the
user can verify it against the thumbprint.
• Ec2SetDriveLetter—Sets the drive letters of the mounted volumes based on user-defined settings.
By default, when an Amazon EBS volume is attached to an instance, it can be mounted using the drive
letter on the instance. To specify your drive letter mappings, edit the DriveLetterConfig.xml file
located in the EC2ConfigService\Settings directory.
• Ec2WindowsActivate—The plug-in handles Windows activation. It checks to see if Windows is
activated. If not, it updates the AWS KMS client settings, and then activates Windows.
To modify the AWS KMS settings, edit the ActivationSettings.xml file located in the
EC2ConfigService\Settings directory.
• Ec2DynamicBootVolumeSize—Extends Disk 0/Volume 0 to include any unpartitioned space.
720
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
• Ec2HandleUserData—Creates and runs scripts created by the user on the first launch of an instance
after Sysprep is run. Commands wrapped in script tags are saved to a batch file, and commands
wrapped in PowerShell tags are saved to a .ps1 file (corresponds to the User Data check box on the Ec2
Service Properties dialog box).
• Ec2ElasticGpuSetup—Installs the Elastic GPU software package if the instance is associated with
an elastic GPU.
• Ec2FeatureLogging—Sends Windows feature installation and corresponding service status to the
console. Supported only for the Microsoft Hyper-V feature and corresponding vmms service.
Global Settings
DriveLetterConfig.xml
This file contains settings that control drive letter mappings. By default, a volume can be mapped to any
available drive letter. You can mount a volume to a particular drive letter as follows.
• VolumeName—The volume label. For example, My Volume. To specify a mapping for an instance
storage volume, use the label Temporary Storage X, where X is a number from 0 to 25.
• DriveLetter—The drive letter. For example, M:. The mapping fails if the drive letter is already in use.
EventLogConfig.xml
This file contains settings that control the event log information that's displayed on the console while
the instance is booting. By default, we display the three most recent error entries from the System event
log.
721
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
WallpaperSettings.xml
This file contains settings that control the information that's displayed on the desktop background. The
following information is displayed by default.
You can remove any of the information that's displayed by default by deleting its entry. You can add
additional instance metadata to display as follows.
<WallpaperInformation>
<name>display_name</name>
<source>metadata</source>
<identifier>meta-data/path</identifier>
</WallpaperInformation>
<WallpaperInformation>
<name>display_name</name>
<source>EnvironmentVariable</source>
<identifier>variable-name</identifier>
</WallpaperInformation>
InitializeDrivesSettings.xml
This file contains settings that control how EC2Config initializes drives.
By default, EC2Config initialize drives that were not brought online with the operating system. You can
customize the plugin as follows.
<InitializeDrivesSettings>
<SettingsGroup>setting</SettingsGroup>
</InitializeDrivesSettings>
FormatWithTRIM
Enables the TRIM command when formatting drives. After a drive has been formatted and
initialized, the system restores TRIM configuration.
Starting with EC2Config version 3.18, the TRIM command is disabled during the disk format
operation by default. This improves formatting times. Use this setting to enable TRIM during the
disk format operation for EC2Config version 3.18 and later.
722
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
FormatWithoutTRIM
Disables the TRIM command when formatting drives and improves formatting times in Windows.
After a drive has been formatted and initialized, the system restores TRIM configuration.
DisableInitializeDrives
Disables formatting for new drives. Use this setting to initialize drives manually.
Methods
• Configure proxy settings using the AWS SDK for .NET (Preferred) (p. 723)
• Configure proxy settings using the system.net element (p. 724)
• Configure proxy settings using Microsoft Group Policy and Microsoft Internet Explorer (p. 724)
Configure proxy settings using the AWS SDK for .NET (Preferred)
You can configure proxy settings for the EC2Config service by specifying the proxy element in the
Ec2Config.exe.config file. For more information, see Configuration Files Reference for AWS SDK
for .NET.
1. Edit the Ec2Config.exe.config file on an instance where you want the EC2Config service
to communicate through a proxy. By default, the file is located in the following directory:
%ProgramFiles%\Amazon\Ec2ConfigService.
2. Add the following aws element to the configSections. Do not add this to any existing
sectionGroups.
<configSections>
<section name="aws" type="Amazon.AWSSection, AWSSDK"/>
</configSections>
<configSections>
<section name="aws" type="Amazon.AWSSection, AWSSDK.Core"/>
</configSections>
<aws>
<proxy
host="string value"
port="string value"
username="string value"
password="string value" />
723
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
</aws>
1. Edit the Ec2Config.exe.config file on an instance where you want the EC2Config service
to communicate through a proxy. By default, the file is located in the following directory:
%ProgramFiles%\Amazon\Ec2ConfigService.
2. Add a defaultProxy entry to system.net. For more information, see defaultProxy Element
(Network Settings) on MSDN.
For example, the following configuration routes all traffic to use the proxy that is currently
configured for Internet Explorer, with the exception of the metadata and licensing traffic, which will
bypass the proxy.
<defaultProxy>
<proxy usesystemdefault="true" />
<bypasslist>
<add address="169.254.169.250" />
<add address="169.254.169.251" />
<add address="169.254.169.254" />
<add address="[fd00:ec2::250]" />
<add address="[fd00:ec2::254]" />
</bypasslist>
</defaultProxy>
Configure proxy settings using Microsoft Group Policy and Microsoft Internet
Explorer
The EC2Config service runs under the Local System user account. You can specify instance-wide proxy
settings for this account in Internet Explorer after you change Group Policy settings on the instance.
1. On an instance where you want the EC2Config service to communicate through a proxy, open a
Command prompt as an Administrator, type gpedit.msc, and press Enter.
2. In the Local Group Policy Editor, under Local Computer Policy, choose Computer Configuration,
Administrative Templates, Windows Components, Internet Explorer.
3. In the right-pane, choose Make proxy settings per-machine (rather than per-user) and then choose
Edit policy setting.
4. Choose Enabled, and then choose Apply.
5. Open Internet Explorer, and then choose the Tools button.
6. Choose Internet Option, and then choose the Connections tab.
7. Choose LAN settings.
8. Under Proxy server, choose the Use a proxy server for your LAN option.
9. Specify address and port information and then choose OK.
724
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
You can receive notifications when new versions of the EC2Config service are released. For more
information, see Subscribe to EC2Config service notifications (p. 737).
The following table describes the released versions of EC2Config. For information about the updates for
SSM Agent, see Systems Manager SSM Agent Release Notes.
4.9.5103 • Fixed issue where ephemeral volumes are incorrectly identified on 5 December
r5d and i4i instance families. 2022
• New version of SSM Agent 3.1.1856.0.
4.9.5064 • Updated to use PCI segment information to select the console 16 November
port. 2022
• Signed PowerShell scripts and added copyright headers.
• Fixed primary network adapter selection logic.
• New version of SSM Agent 3.1.1732.0.
4.9.4588 • Updated IMDS wait logic to make only IMDSv2 requests. 31 May 2022
• Added libec2launch.dll launch-agent shared library.
• New version of SSM Agent 3.1.1188.0.
4.9.4556 • Added wait logic to ensure full initialization of NIC before use. 1 March 2022
• New version of Log4Net 2.0.14.0 picks up security patch.
• New version of SSM Agent 3.1.1045.0 picks up security patch.
4.9.4536 • Fixed issue where userdata crashes when the Temp folder is 31 January
missing. 2022
• New version of SSM Agent 3.1.804.0.
725
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
4.9.4381 • Added support for SSM document schema version 2.2 in 4 May 2021
EC2ConfigUpdater
• Added AWS Nitro Enclaves package version to console log
• New version of SSM Agent 3.0.529.0
4.9.3865 • Fixed issue detecting COM port for Windows Server 2008 R2 on 31 October
metal instances 2019
• New version of SSM Agent 2.3.722.0
4.9.3270 • Added plugin for setting the monitor to never turn off to fix ACPI 22 January
issues 2019
• SQL Server edition and version written to console
• New version of SSM Agent 2.3.415.0
726
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
727
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
728
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
729
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
3.19.1153 • Re-enabled activation plugin for instances with old AWS KMS
configuration.
• Change default TRIM behavior to be disabled during disk
format operation and added FormatWithTRIM for overriding
InitializeDisks plugin with userdata.
3.17.1032 • Fixes duplicate system logs appearing when filters set to same
category.
• Fixes to prevent from hanging during disk initialization.
<InitializeDrivesSettings><SettingsGroup>FormatWithoutTRIM</
SettingsGroup></InitializeDrivesSettings
730
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
3.8.294 • Fixed an issue with CloudWatch that prevented logs from getting
uploaded when not on primary drive.
• Improved the disk initialization process by adding retry logic.
• Added improved error handling when the SetPassword plugin
occasionally failed during AMI creation.
• Updates to improve support for AWS services.
731
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
732
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
2.2.11 Fixed a issue in CloudWatch plugin for handling empty log lines.
2.2.7 • Added support for EC2Config to run during Sysprep execution for
Windows 2008 and greater.
• Improved exception handling and logging for better diagnostics
2.2.6 • Reduced the load on the instance and on CloudWatch Logs when
uploading log events.
• Addressed an upgrade issue where the CloudWatch Logs plug-in
did not always stay enabled
2.2.2 • Added check to service stop behavior to check that resources are
being released
• Fixed issue with long execution times when joined to domain
733
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
2.1.19 • Added ephemeral disk labeling support when using Intel network
driver (eg. C3 instance Type). For more information, see Enhanced
networking on Windows (p. 1278).
• Added AMI Origin Version and AMI Origin Name support to the
console output
• Made changes to the Console Output for consistent formatting/
parsing
• Updated Help File
2.1.16 • General Tab includes link to EC2Config download page for new
Versions
• Desktop Wallpaper overlay now stored in Users Local Appdata
folder instead of My Documents to support MyDoc redirection
• MSSQLServer name sync'd with system in Post-Sysprep script
(2008+)
• Reordered Application Folder (moved files to Plugin directory and
removed duplicate files)
• Changed System Log Output (Console):
• *Moved to a date, name, value format for easier parsing (Please
start migrating dependencies to new format)
• *Added 'Ec2SetPassword' plugin status
• *Added Sysprep Start and End times
• Fixed issue of Ephemeral Disks not being labeled as 'Temporary
Storage' for non-english Operating Systems
• Fixed EC2Config Uninstall failure after running Sysprep
734
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
735
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
736
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
a. For Topic ARN, use the following Amazon Resource Name (ARN):
arn:aws:sns:us-east-1:801119661308:ec2-windows-ec2config
Whenever a new version of the EC2Config service is released, we send notifications to subscribers. If you
no longer want to receive these notifications, use the following procedure to unsubscribe.
To update EC2Config on an Amazon EBS-backed Windows instance that you can't connect to
737
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2Config service
4. Choose Launch instances and create a temporary t2.micro instance in the same Availability Zone
as the affected instance. Use a different AMI than the one that you used to launch the affected
instance.
Important
If you do not create the instance in the same Availability Zone as the affected instance you
will not be able to attach the root volume of the affected instance to the new instance.
5. In the EC2 console, choose Volumes.
6. Locate the root volume of the affected instance. Detach the volume (p. 1565) and then attach the
volume (p. 1542) to the temporary instance that you created earlier. Attach it with the default
device name (xvdf).
7. Use Remote Desktop to connect to the temporary instance, and then use the Disk Management
utility to make the volume available for use (p. 1543).
8. Download the latest version of the EC2Config service. Extract the files from the .zip file to the
Temp directory on the drive you attached.
9. On the temporary instance, open the Run dialog box, type regedit, and press Enter.
10. Choose HKEY_LOCAL_MACHINE. From the File menu, choose Load Hive. Choose the drive and then
navigate to and open the following file: Windows\System32\config\SOFTWARE. When prompted,
specify a key name.
11. Select the key you just loaded and navigate to Microsoft\Windows\CurrentVersion. Choose
the RunOnce key. If this key doesn't exist, choose CurrentVersion from the context (right-click)
menu, choose New and then choose Key. Name the key RunOnce.
12. From the context (right-click) menu choose the RunOnce key, choose New and then choose String
Value. Enter Ec2Install as the name and C:\Temp\Ec2Install.exe /quiet as the data.
13. Choose the HKEY_LOCAL_MACHINE\specified key name\Microsoft\Windows NT
\CurrentVersion\Winlogon key. From the context (right-click) menu choose New, and then
choose String Value. Enter AutoAdminLogon as the name and 1 as the value data.
14. Choose the HKEY_LOCAL_MACHINE\specified key name\Microsoft\Windows NT
\CurrentVersion\Winlogon> key. From the context (right-click) menu choose New, and then
choose String Value. Enter DefaultUserName as the name and Administrator as the value data.
15. Choose the HKEY_LOCAL_MACHINE\specified key name\Microsoft\Windows NT
\CurrentVersion\Winlogon key. From the context (right-click) menu choose New, and then
choose String Value. Type DefaultPassword as the name and enter a password in the value data.
16. In the Registry Editor navigation pane, choose the temporary key that you created when you first
opened Registry Editor.
17. From the File menu, choose Unload Hive.
18. In Disk Management Utility, choose the drive you attached earlier, open the context (right-click)
menu, and choose Offline.
19. In the Amazon EC2 console, detach the affected volume from the temporary instance and reattach it
to your instance with the device name /dev/sda1. You must specify this device name to designate
the volume as a root volume.
20. Stop and start your instance (p. 580) the instance.
21. After the instance starts, check the system log and verify that you see the message Windows is ready
to use.
22. Open Registry Editor and choose HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT
\CurrentVersion\Winlogon. Delete the String Value keys you created earlier: AutoAdminLogon,
DefaultUserName, and DefaultPassword.
23. Delete or stop the temporary instance you created in this procedure.
738
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Instance type Not supported for all instance Supported for Xen instance Supported for
types. If you specify an types. Xen instance
unsupported instance type, the types.
instance is impaired.
The following table shows which PV drivers you should run on each version of Windows Server on
Amazon EC2.
739
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Contents
• AWS PV drivers (p. 740)
• Citrix PV drivers (p. 743)
• RedHat PV drivers (p. 743)
• Subscribe to notifications (p. 744)
• Upgrade PV drivers on Windows instances (p. 745)
• Troubleshoot PV drivers (p. 750)
AWS PV drivers
The AWS PV drivers are stored in the %ProgramFiles%\Amazon\Xentools directory. This directory
also contains public symbols and a command line tool, xenstore_client.exe, that enables you to
access entries in XenStore. For example, the following PowerShell command returns the current time
from the Hypervisor:
The AWS PV driver components are listed in the Windows registry under HKEY_LOCAL_MACHINE
\SYSTEM\CurrentControlSet\Services. These driver components are as follows: xenbus, xeniface,
xennet, xenvbd, and xenvif.
AWS PV drivers also have a Windows service named LiteAgent, which runs in user-mode. It handles tasks
such as shutdown and restart events from AWS APIs on Xen generation instances. You can access and
manage services by running Services.msc from the command line. When running on Nitro generation
instances, the AWS PV drivers are not used and the LiteAgent service will self-stop starting with driver
version 8.2.4. Updating to the latest AWS PV driver also updates the LiteAgent and improves reliability
on all instance generations.
Amazon Windows AMIs contain a set of drivers to permit access to virtualized hardware. These
drivers are used by Amazon EC2 to map instance store and Amazon EBS volumes to their devices. We
recommend that you install the latest drivers to improve stability and performance of your EC2 Windows
instances.
740
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Installation options
• You can use AWS Systems Manager to automatically update the PV drivers. For more information,
see Walkthrough: Automatically Update PV Drivers on EC2 Windows Instances (Console) in the AWS
Systems Manager User Guide.
• You can download the driver package and run the install program manually. Be sure to check the
readme.txt file for system requirements. For information about downloading and installing the
AWS PV drivers, or upgrading a domain controller, see Upgrade Windows Server instances (AWS PV
upgrade) (p. 745).
8.4.3 Fixed bugs in the package installer to improve the upgrade 24 January
experience. 2023
8.4.0 • Stability fixes to address rare cases of stuck disk IO. 2 March 2021
• Stability fixes to address rare cases of crashes during EBS volume
detachment.
• Added feature to distribute load across multiple cores for
workloads that leverage more than 20,000 IOPS and experience
degradation due to bottlenecks. To enable this feature, see
Workloads that leverage more than 20,000 disk IOPS experience
degradation due to CPU bottlenecks (p. 755).
• AWS PV 8.4 installation on Windows Server 2008 R2 will fail.
AWS PV version 8.3.5 and earlier are supported on Windows
Server 2008 R2.
741
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Report EBS volume ID as disk serial number for EBS volumes. This
enables cluster scenarios such as S2D.
8.2.1 Network and storage performance improvements plus multiple 8 March 2018
robustness fixes.
To verify that this version has been installed, refer to the following
Windows registry value: HKLM\Software\Amazon\PVDriver
\Version 8.2.1.
7.4.6 Stability fixes to make AWS PV drivers more resilient. 26 April 2017
7.3.0 TRIM support: The AWS PV driver now sends TRIM requests to the
hypervisor. Ephemeral disks will properly process TRIM requests
given the underlying storage supports TRIM (SSD). Note that EBS-
based storage does not support TRIM as of March 2015.
742
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
7.2.1 • Run in safe mode: Fixed an issue where the driver would not
load in safe mode. Previously the AWS PV Drivers would only
instantiate in normal running systems.
• Add disks to Microsoft Windows Storage Pools: Previously we
synthesized page 83 queries. The fix disabled page 83 support.
Note this does not affect storage pools that are used in a cluster
environment because PV disks are not valid cluster disks.
Citrix PV drivers
The Citrix PV drivers are stored in the %ProgramFiles%\Citrix\XenTools (32-bit instances) or
%ProgramFiles(x86)%\Citrix\XenTools (64-bit instances) directory.
The Citrix PV driver components are listed in the Windows registry under HKEY_LOCAL_MACHINE
\SYSTEM\CurrentControlSet\services. These driver components are as follows: xenevtchn,
xeniface, xennet, Xennet6, xensvc, xenvbd, and xenvif.
Citrix also has a driver component named XenGuestAgent, which runs as a Windows service. It handles
tasks such as shutdown and restart events from the API. You can access and manage services by running
Services.msc from the command line.
If you are encountering networking errors while performing certain workloads, you may need to disable
the TCP offloading feature for the Citrix PV driver. For more information, see TCP offloading (p. 754).
RedHat PV drivers
RedHat drivers are supported for legacy instances, but are not recommended on newer instances with
more than 12GB of RAM due to driver limitations. Instances with more than 12GB of RAM running
743
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
RedHat drivers can fail to boot and become inaccessible. We recommend upgrading RedHat drivers to
Citrix PV drivers, and then upgrade Citrix PV drivers to AWS PV drivers.
The source files for the RedHat drivers are in the %ProgramFiles%\RedHat (32-bit instances) or
%ProgramFiles(x86)%\RedHat (64-bit instances) directory. The two drivers are rhelnet, the RedHat
Paravirtualized network driver, and rhelscsi, the RedHat SCSI miniport driver.
Subscribe to notifications
Amazon SNS can notify you when new versions of EC2 Windows Drivers are released. Use one of the
following methods to subscribe to these notifications.
Note
You must specify the Region for the SNS Topic you subscribe to.
arn:aws:sns:us-east-1:801119661308:ec2-windows-drivers
b. For Protocol, choose Email.
c. For Endpoint, type an email address that you can use to receive the notifications.
d. Choose Create subscription.
6. You'll receive a confirmation email. Open the email and follow the directions to complete your
subscription.
To subscribe to EC2 notifications with the AWS CLI, use the following command.
To subscribe to EC2 notifications with Tools for Windows PowerShell, use the following command.
Whenever new EC2 Windows drivers are released, we send notifications to subscribers. If you no longer
want to receive these notifications, use the following procedure to unsubscribe.
744
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
3. Select the check box for the subscription and then choose Actions, Delete subscriptions. When
prompted for confirmation, choose Delete.
We recommend that you install the latest PV drivers to improve the stability and performance of your
EC2 Windows instances. The directions on this page help you download the driver package and run the
install program.
Open Network Connections in Control Panel and view Local Area Connection. Check whether the driver
is one of the following:
Alternatively, you can check the output from the pnputil -e command.
System requirements
Be sure to check the readme.txt file in the download for system requirements.
Contents
• Upgrade Windows Server instances (AWS PV upgrade) (p. 745)
• Upgrade a domain controller (AWS PV upgrade) (p. 746)
• Upgrade Windows Server 2008 and 2008 R2 instances (Redhat to Citrix PV upgrade) (p. 748)
• Upgrade your Citrix Xen guest agent service (p. 750)
Some older versions of Windows Server can't use the latest drivers. To verify which driver version
to use for your operating system, see the driver version table in the Paravirtual drivers for Windows
instances (p. 739) page.
Important
If your instance is a domain controller, see Upgrade a domain controller (AWS PV
upgrade) (p. 746). The upgrade process for domain controller instances is different than
standard editions of Windows.
1. We recommend that you create an AMI as a backup as follows, in case you need to roll back your
changes.
745
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
a. When you stop an instance, the data on any instance store volumes is erased. Before you stop
an instance, verify that you've copied any data that you need from your instance store volumes
to persistent storage, such as Amazon EBS or Amazon S3.
b. In the navigation pane, choose Instances.
c. Select the instance that requires the driver upgrade, and choose Instance state, Stop instance.
d. After the instance is stopped, select the instance, choose Actions, then Image and templates,
and then choose Create image.
e. Choose Instance state, Start instance.
2. Connect to the instance using Remote Desktop.
3. We recommend that you take all non-system disks offline and note any drive letter mappings to the
secondary disks in Disk Management before you perform this upgrade. This step is not required if
you are performing an in-place update of AWS PV drivers. We also recommend setting non-essential
services to Manual start-up in the Services console.
4. Download the latest driver package to the instance.
Invoke-WebRequest https://s3.amazonaws.com/ec2-windows-drivers-downloads/AWSPV/Latest/
AWSPVDriver.zip -outfile $env:USERPROFILE\pv_driver.zip
Expand-Archive $env:userprofile\pv_driver.zip -DestinationPath
$env:userprofile\pv_drivers
After running the MSI, the instance automatically reboots and then upgrades the driver. The instance will
not be available for up to 15 minutes. After the upgrade is complete and the instance passes both health
checks in the Amazon EC2 console, you can verify that the new driver was installed by connecting to the
instance using Remote Desktop and then running the following PowerShell command:
Get-ItemProperty HKLM:\SOFTWARE\Amazon\PVDriver
Verify that the driver version is the same as the latest version listed in the Driver Version History table.
For more information, see AWS PV driver package history (p. 741) Open Disk Management to review
any offline secondary volumes and bring them online corresponding to the drive letters noted in Step 6.
If you previously disabled TCP offloading (p. 754) using Netsh for Citrix PV drivers we recommend that
you re-enable this feature after upgrading to AWS PV drivers. TCP Offloading issues with Citrix drivers
are not present in the AWS PV drivers. As a result, TCP Offloading provides better performance with AWS
PV drivers.
If you previously applied a static IP address or DNS configuration to the network interface, you might
need to reapply the static IP address or DNS configuration after upgrading AWS PV drivers.
1. We recommend that you create a backup of your domain controller in case you need to roll back
your changes. Using an AMI as a backup is not supported. For more information, see Backup and
Restore Considerations for Virtualized Domain Controllers in the Microsoft documentation.
2. Run the following command to configure Windows to boot into Directory Services Restore Mode
(DSRM).
746
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Warning
Before running this command, confirm that you know the DSRM password. You'll need this
information so that you can log in to your instance after the upgrade is complete and the
instance automatically reboots.
PowerShell:
The system must boot into DSRM because the upgrade utility removes Citrix PV storage drivers so it
can install AWS PV drivers. Therefore we recommend noting any drive letter and folder mappings to
the secondary disks in Disk Management. When Citrix PV storage drivers are not present, secondary
drives are not detected. Domain controllers that use an NTDS folder on secondary drives will not
boot because the secondary disk is not detected.
Warning
After you run this command do not manually reboot the system. The system will be
unreachable because Citrix PV drivers do not support DSRM.
3. Run the following command to add DisableDCCheck to the registry:
After running the MSI, the instance automatically reboots and then upgrades the driver. The instance
will not be available for up to 15 minutes.
6. After the upgrade is complete and the instance passes both health checks in the Amazon EC2
console, connect to the instance using Remote Desktop. Open Disk Management to review any
offline secondary volumes and bring them online corresponding to the drive letters and folder
mappings noted earlier.
You must connect to the instance by specifying the user name in the following format
hostname\administrator. For example, Win2k12TestBox\administrator.
7. Run the following command to remove the DSRM boot configuration:
Note
If you previously disabled TCP offloading (p. 754) using Netsh for Citrix PV drivers we
recommend that you re-enable this feature after upgrading to AWS PV Drivers. TCP Offloading
747
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
issues with Citrix drivers are not present in the AWS PV drivers. As a result, TCP Offloading
provides better performance with AWS PV drivers.
• Install the latest version of the EC2Config service. For more information, see Install the latest version
of EC2Config (p. 713).
• Verify that you have Windows PowerShell 3.0 installed. To verify the version that you have installed,
run the following command in a PowerShell window:
PS C:\> $PSVersionTable.PSVersion
Windows PowerShell 3.0 is bundled in the Windows Management Framework (WMF) version 3.0 install
package. If you need to install Windows PowerShell 3.0, see Windows Management Framework 3.0 in
the Microsoft Download Center.
• Back up your important information on the instance, or create an AMI from the instance. For more
information about creating an AMI, see Create a custom Windows AMI (p. 143). If you create an AMI,
make sure that you do the following:
• Write down your password.
• Do not run the Sysprep tool manually or using the EC2Config service.
• Set your Ethernet adapter to obtain an IP address automatically using DHCP. For more information,
see Configure TCP/IP Settings in the Microsoft TechNet Library.
1. Connect to your instance and log in as the local administrator. For more information about
connecting to your instance, see Connect to your Windows instance (p. 610).
2. In your instance, download the Citrix PV upgrade package.
3. Extract the contents of the upgrade package to a location of your choice.
4. Double-click the Upgrade.bat file. If you get a security warning, choose Run.
5. In the Upgrade Drivers dialog box, review the information and choose Yes if you are ready to start
the upgrade.
6. In the Red Hat Paravirtualized Xen Drivers for Windows uninstaller dialog box, choose Yes to
remove the RedHat software. Your instance will be rebooted.
Note
If you do not see the uninstaller dialog box, choose Red Hat Paravirtualize in the Windows
taskbar.
748
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
749
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Before you start upgrading your drivers, make sure you back up your important information on the
instance, or create an AMI from the instance. For more information about creating an AMI, see Create a
custom Windows AMI (p. 143). If you create an AMI, make sure you do the following:
1. Connect to your instance and log in as the local administrator. For more information about
connecting to your instance, see Connect to your Windows instance (p. 610).
2. On your instance, download the Citrix upgrade package.
3. Extract the contents of the upgrade package to a location of your choice.
4. Double-click the Upgrade.bat file. If you get a security warning, choose Run.
5. In the Upgrade Drivers dialog box, review the information and choose Yes if you are ready to start
the upgrade.
6. When the upgrade is complete, the PVUpgrade.log file will open and contain the text UPGRADE
IS COMPLETE.
7. Reboot your instance.
Troubleshoot PV drivers
The following are solutions to issues that you might encounter with older Amazon EC2 images and PV
drivers.
Contents
• Windows Server 2012 R2 loses network and storage connectivity after an instance reboot (p. 750)
• TCP offloading (p. 754)
• Time synchronization (p. 755)
• Workloads that leverage more than 20,000 disk IOPS experience degradation due to CPU
bottlenecks (p. 755)
Windows Server 2012 R2 Amazon Machine Images (AMIs) made available before September 10, 2014
can lose network and storage connectivity after an instance reboot. The error in the AWS Management
Console system log states: “Difficulty detecting PV driver details for Console Output.” The connectivity
750
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
loss is caused by the Plug and Play Cleanup feature. This features scans for and disables inactive system
devices every 30 days. The feature incorrectly identifies the EC2 network device as inactive and removes
it from the system. When this happens, the instance loses network connectivity after a reboot.
For systems that you suspect could be affected by this issue, you can download and run an in-place driver
upgrade. If you are unable to perform the in-place driver upgrade, you can run a helper script. The script
determines if your instance is affected. If it is affected, and the Amazon EC2 network device has not been
removed, the script disables the Plug and Play Cleanup scan. If the network device was removed, the
script repairs the device, disables the Plug and Play Cleanup scan, and enables your instance to reboot
with network connectivity enabled.
Contents
• Choose how to fix problems (p. 751)
• Method 1 - Enhanced networking (p. 751)
• Method 2 - Registry configuration (p. 752)
• Run the remediation script (p. 754)
There are two methods for restoring network and storage connectivity to an instance affected by this
issue. Choose one of the following methods:
Method 1 - Enhanced Enhanced networking is only You change the server instance
networking available in a virtual private type to a C3 instance. Enhanced
cloud (VPC) which requires a C3 networking then enables you
instance type. If the server does to connect to the affected
not currently use the C3 instance instance and fix the problem.
type, then you must temporarily After you fix the problem, you
change it. change the instance back to
the original instance type. This
method is typically faster than
Method 2 and less likely to
result in user error. You will incur
additional charges as long as the
C3 instance is running.
Method 2 - Registry Ability to create or access a You detach the root volume
configuration second server. Ability to change from the affected instance,
Registry settings. attach it to a different instance,
connect, and make changes
in the Registry. You will incur
additional charges as long as the
additional server is running. This
method is slower than Method
1, but this method has worked in
situations where Method 1 failed
to resolve the problem.
751
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
3. Locate the affected instance. Select the instance and choose Instance state, and then choose Stop
instance.
Warning
When you stop an instance, the data on any instance store volumes is erased. To keep data
from instance store volumes, be sure to back it up to persistent storage.
4. After the instance is stopped, create a backup. Select the instance and choose Actions, then Image
and templates, and then choose Create image.
5. Change the instance type to any C3 instance type.
6. Start the instance.
7. Connect to the instance using Remote Desktop and then download the AWS PV Drivers Upgrade
package to the instance.
8. Extract the contents of the folder and run AWSPVDriverSetup.msi.
After running the MSI, the instance automatically reboots and then upgrades the drivers. The
instance will not be available for up to 15 minutes.
9. After the upgrade is complete and the instance passes both health checks in the Amazon EC2
console, connect to the instance using Remote Desktop and verify that the new drivers were
installed. In Device Manager, under Storage Controllers, locate AWS PV Storage Host Adapter.
Verify that the driver version is the same as the latest version listed in the Driver Version History
table. For more information, see AWS PV driver package history (p. 741).
10. Stop the instance and change the instance back to its original instance type.
11. Start the instance and resume normal use.
752
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
HKEY_LOCAL_MACHINE\your_temporary_key_name\ControlSet001\Control\Class\4d36e97d-
e325-11ce-bfc1-08002be10318
HKEY_LOCAL_MACHINE\your_temporary_key_name\ControlSet001\Control\Class\4d36e96a-
e325-11ce-bfc1-08002be10318
12. For each key, double-click UpperFilters, enter a value of XENFILT, and then choose OK.
HKEY_LOCAL_MACHINE\your_temporary_key_name\ControlSet001\Services\XENBUS
\Parameters
14. Create a new string (REG_SZ) with the name ActiveDevice and the following value:
PCI\VEN_5853&DEV_0001&SUBSYS_00015853&REV_01
15. Locate the following key:
HKEY_LOCAL_MACHINE\your_temporary_key_name\ControlSet001\Services\XENBUS
16. Change the Count from 0 to 1.
17. Locate and delete the following keys:
HKEY_LOCAL_MACHINE\your_temporary_key_name\ControlSet001\Services\xenvbd
\StartOverride
HKEY_LOCAL_MACHINE \your_temporary_key_name\ControlSet001\Services\xenfilt
\StartOverride
18. In the Registry Editor navigation pane, choose the temporary key that you created when you first
opened the Registry Editor.
19. From the File menu, choose Unload Hive.
20. In the Disk Management Utility, choose the drive you attached earlier, open the context (right-click)
menu, and choose Offline.
21. In the Amazon EC2 console, detach the affected volume from the temporary instance and reattach
it to your Windows Server 2012 R2 instance with the device name /dev/sda1. You must specify this
device name to designate the volume as a root volume.
753
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
After running the MSI, the instance automatically reboots and then upgrades the drivers. The
instance will not be available for up to 15 minutes.
25. After the upgrade is complete and the instance passes both health checks in the Amazon EC2
console, connect to the instance using Remote Desktop and verify that the new drivers were
installed. In Device Manager, under Storage Controllers, locate AWS PV Storage Host Adapter.
Verify that the driver version is the same as the latest version listed in the Driver Version History
table. For more information, see AWS PV driver package history (p. 741).
26. Delete or stop the temporary instance you created in this procedure.
If you are unable to perform an in-place driver upgrade or migrate to a newer instance you can run the
remediation script to fix the problems caused by the Plug and Play Cleanup task.
TCP offloading
Important
This issue does not apply to instances running AWS PV or Intel network drivers.
By default, TCP offloading is enabled for the Citrix PV drivers in Windows AMIs. If you encounter
transport-level errors or packet transmission errors (as visible on the Windows Performance Monitor)—
for example, when you're running certain SQL workloads—you may need to disable this feature.
Warning
Disabling TCP offloading may reduce the network performance of your instance.
754
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
6. In the Local Area Connection Properties dialog box, choose Configure to open the Citrix PV
Ethernet Adapter #0 Properties dialog box.
7. On the Advanced tab, disable each of the properties, except for Correct TCP/UDP Checksum Value.
To disable a property, select it from Property and choose Disabled from Value.
8. Choose OK.
9. Run the following commands from a Command Prompt window.
Time synchronization
Prior to the release of the 2013.02.13 Windows AMI, the Citrix Xen guest agent could set the system time
incorrectly. This can cause your DHCP lease to expire. If you have issues connecting to your instance, you
might need to update the agent.
To determine whether you have the updated Citrix Xen guest agent, check whether the C:\Program
Files\Citrix\XenGuestAgent.exe file is from March 2013. If the date on this file is earlier than
that, update the Citrix Xen guest agent service. For more information, see Upgrade your Citrix Xen guest
agent service (p. 750).
Workloads that leverage more than 20,000 disk IOPS experience degradation
due to CPU bottlenecks
You can be affected by this issue if you are using Windows instances running AWS PV
drivers that leverage more than 20,000 IOPS, and you experience bug check code 0x9E:
USER_MODE_HEALTH_MONITOR.
Disk reads and writes (IOs) in the AWS PV drivers occur in two phases: IO preparation and IO
completion. By default, the preparation phase runs on a single arbitrary core. The completion phase
runs on core 0. The amount of computation required to process an IO varies based on it size and other
properties. Some IOs use more computation in the preparation phase, and others in the completion
phase. When an instance drives more than 20,000 IOPS, the preparation or completion phase may result
755
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
in a bottleneck, where the CPU upon which it runs is at 100% capacity. Whether or not the preparation
or completion phase becomes a bottleneck depends on the properties of the IOs used by the application.
Starting with AWS PV drivers 8.4.0, the load of the preparation phase and the completion phase can be
distributed across multiple cores, eliminating bottlenecks. Each application uses different IO properties.
Therefore, applying one of the following configurations may raise, lower, or not impact the performance
of your application. After you apply any of these configurations, monitor the application to verify that it
is meeting your desired performance.
1. Prerequisites
Before you begin this troubleshooting procedure, verify the following prerequisites:
• Your instance uses AWS PV drivers version 8.4.0 or later. To upgrade, see Upgrade PV drivers on
Windows instances (p. 745).
• You have RDP access to the instance. For steps to connect to your Windows instance using RDP,
see Connect to your Windows instance using RDP (p. 612).
• You have administrator access on the instance.
2. Observe CPU load on your instance
You can use Windows Task Manager to view the load on each CPU to determine potential
bottlenecks to disk IO.
1. Verify that your application is running and handling traffic similar to your production workload.
2. Connect to your instance using RDP.
3. Choose the Start menu on your instance.
4. Enter Task Manager in the Start menu to open Task Manager.
5. If Task Manager displays the Summary View, choose More details to expand the detailed view.
6. Choose the Performance tab.
7. Select CPU in the left pane.
8. Right-click on the graph in the main pane and select Change graph to>Logical processors to
display each individual core.
9. Depending on how many cores are on your instance, you may see lines displaying CPU load over
time, or you may just see a number.
• If you see graphs displaying load over time, look for CPUs where the box is almost entirely
shaded.
• If you see a number on each core, look for cores that consistently show 95% or greater.
10.Note whether core 0 or a different core is experiencing a heavy load.
3. Choose which configuration to apply
Allow driver to choose whether Workload is driving more than This configuration is
to distribute completion 20,000 IOPS and moderate or recommended for all Xen
high load is observed on core instances using PV 8.4.0 or
0. later and leveraging more than
756
Amazon Elastic Compute Cloud
User Guide for Windows Instances
PV drivers
Note
We recommend that you do not distribute IO preparation without also distributing
IO completion (setting DpcRedirection without setting NotifierDistributed)
because the completion phase is sensitive to overload by the preparation phase when the
preparation phase is running in parallel.
• NotifierDistributed
Value 1 — The driver chooses to run the completion phase or core 0 or one additional core per
attached disk.
Value 2 — The driver runs the completion phase on one additional core per attached disk.
• DpcRedirection
Value 0 or not present — The preparation phase will run on a single, arbitrary core.
Default configuration
Apply the default configuration with AWS PV driver versions prior to 8.4.0, or if performance or
stability degradation is observed after applying one of the other configurations in this section.
757
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS NVMe drivers
Set NotiferDistributed registry key to allow the PV storage driver to choose whether or not to
distribute IO completion.
Set NotifierDistributed and DpcRedirection registry keys to always distribute both the
preparation and completion phases.
For more information about EBS and NVMe, see Amazon EBS and NVMe on Windows instances (p. 1750).
For more information about SSD instance store and NVMe, see SSD instance store volumes (p. 1821).
758
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS NVMe drivers
If you are not using the latest AWS Windows AMIs provided by Amazon, use the following procedure to
install the current AWS NVMe driver. You should perform this update at a time when it is convenient to
reboot your instance. Either the install script will reboot your instance or you must reboot it as the final
step.
Prerequisites
1. We recommend that you create an AMI as a backup as follows, in case you need to roll back your
changes.
a. When you stop an instance, the data on any instance store volumes is erased. Before you stop
an instance, verify that you've copied any data that you need from your instance store volumes
to persistent storage, such as Amazon EBS or Amazon S3.
b. In the navigation pane, choose Instances.
c. Select the instance that requires the driver upgrade, and choose Instance state, Stop instance.
d. After the instance is stopped, select the instance, choose Actions, then Image and templates,
and then choose Create image.
e. Choose Instance state, Start instance.
2. Connect to your instance and log in as the local administrator.
3. Download and extract the drivers to your instance using one of the following options:
• Using a browser:
Invoke-WebRequest https://s3.amazonaws.com/ec2-windows-drivers-downloads/NVMe/
Latest/AWSNVMe.zip -outfile $env:USERPROFILE\nvme_driver.zip
Expand-Archive $env:userprofile\nvme_driver.zip -DestinationPath $env:userprofile
\nvme_driver
4. Install the driver to your instance by running the install.ps1 PowerShell script from the
nvme_driver directory (.\install.ps1). If you get an error, make sure you are using PowerShell
3.0 or later.
install.ps1 allows you to specify whether the ebsnvme-id tool should be installed with
the driver. To install the ebsnvme-id tool, specify InstallEBSNVMeIdTool ‘Yes’. If you
do not want to install the tool, specify InstallEBSNVMeIdTool ‘No’. If you do not specify
InstallEBSNVMeIdTool, and the tool is already present at C:\ProgramData\Amazon\Tools,
the package will upgrade the tool by default. If the tool is not present, install.ps1 will not
upgrade the tool by default. If you do not want to install the tool as part of the package, and want
to install it later, you can download it from Amazon S3:
1. For instructions for how to install the NVMe driver package using SSM Distributor, see the
procedures in Install or update packages in the Amazon EC2 Systems Manager User Guide.
759
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS NVMe drivers
If SSM_InstallEBSNVMeIdTool is not specified for Additional Arguments, and the tool is already
present at C:\ProgramData\Amazon\Tools, the package will upgrade the tool by default. If the
tool is not present, the package will not upgrade the tool by default. Additional Arguments must be
formatted using valid JSON syntax. For examples of how to pass additional arguments for the aws
configure package, see the Amazon EC2 Systems Manager documentation. If you do not want to
install the tool as part of the package, and want to install it later, you can download it from Amazon
S3:
The following table describes the released versions of the AWS NVMe driver.
1.4.2 Fixed a bug where the AWS NVMe driver did not support instance 16 March 2023
store volumes on D3 instances.
1.4.1 Reports Namespace Preferred Write Granularity (NPGW) for 20 May 2022
EBS volumes that support this optional NVMe feature. For more
information, see section 8.25, "Improving Performance through I/
O Size and Alignment Adherence," in the NVMe Base Specification,
version 1.4.
1.4.0 • Added support for IOCTLs that allow applications to interact 23 November
with NVMe devices. This support allows applications to get 2021
IdentifyController, IdentifyNamespace, and NameSpace
list from the NVMe device. For more information, see Protocol-
specific queries in the Microsoft documentation.
760
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS NVMe drivers
1.3.2 Fixed issue with modifying EBS volumes actively processing IO, 10 September
which may result in data corruption. Customers who do not modify 2019
online EBS volumes (for example, resizing or changing type) are not
impacted.
1.2.0 Performance and reliability improvements for AWS NVMe devices 13 June 2018
on all supported instances, including bare metal instances.
1.0.0 AWS NVMe driver for supported instance types running Windows 12 February
Server. 2018
Subscribe to notifications
Amazon SNS can notify you when new versions of EC2 Windows Drivers are released. Use the following
procedure to subscribe to these notifications.
arn:aws:sns:us-east-1:801119661308:ec2-windows-drivers
b. For Protocol, choose Email.
c. For Endpoint, type an email address that you can use to receive the notifications.
d. Choose Create subscription.
6. You'll receive a confirmation email. Open the email and follow the directions to complete your
subscription.
Whenever new EC2 Windows drivers are released, we send notifications to subscribers. If you no longer
want to receive these notifications, use the following procedure to unsubscribe.
761
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
To subscribe to EC2 notifications with the AWS CLI, use the following command.
To subscribe to EC2 notifications with AWS Tools for Windows PowerShell, use the following command.
In most cases, there is an Amazon EC2 instance type that has a combination of memory and number
of vCPUs to suit your workloads. However, you can specify the following CPU options to optimize your
instance for specific workloads or business needs:
• Number of CPU cores: You can customize the number of CPU cores for the instance. You might do
this to potentially optimize the licensing costs of your software with an instance that has sufficient
amounts of RAM for memory-intensive workloads but fewer CPU cores.
• Threads per core: You can disable multithreading by specifying a single thread per CPU core. You
might do this for certain workloads, such as high performance computing (HPC) workloads.
You can specify these CPU options during instance launch. There is no additional or reduced charge
for specifying CPU options. You're charged the same as instances that are launched with default CPU
options.
Contents
• Rules for specifying CPU options (p. 763)
• CPU cores and threads per CPU core per instance type (p. 763)
• Specify CPU options for your instance (p. 791)
• View the CPU options for your instance (p. 794)
762
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
• CPU options can only be specified during instance launch and cannot be modified after launch.
• When you launch an instance, you must specify both the number of CPU cores and threads per core in
the request. For example requests, see Specify CPU options for your instance (p. 791).
• The number of vCPUs for the instance is the number of CPU cores multiplied by the threads per core.
To specify a custom number of vCPUs, you must specify a valid number of CPU cores and threads per
core for the instance type. You cannot exceed the default number of vCPUs for the instance. For more
information, see CPU cores and threads per CPU core per instance type (p. 763).
• To disable multithreading, specify one thread per core.
• When you change the instance type (p. 331) of an existing instance, the CPU options automatically
change to the default CPU options for the new instance type.
• The specified CPU options persist after you stop, start, or reboot an instance.
CPU cores and threads per CPU core per instance type
The following tables list the instance types that support specifying CPU options.
Contents
• General purpose instances (p. 763)
• Compute optimized instances (p. 771)
• Memory optimized instances (p. 776)
• Storage optimized instances (p. 787)
• Accelerated computing instances (p. 789)
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m2.xlarge 2 2 1 1, 2 1
m2.2xlarge 4 4 1 1, 2, 3, 4 1
m2.4xlarge 8 8 1 1, 2, 3, 4, 5, 6, 1
7, 8
m3.large 2 1 2 1 1, 2
m3.xlarge 4 2 2 1, 2 1, 2
m3.2xlarge 8 4 2 1, 2, 3, 4 1, 2
m4.large 2 1 2 1 1, 2
m4.xlarge 4 2 2 1, 2 1, 2
m4.2xlarge 8 4 2 1, 2, 3, 4 1, 2
m4.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
763
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m4.10xlarge 40 20 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20
m4.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m5.large 2 1 2 1 1, 2
m5.xlarge 4 2 2 2 1, 2
m5.2xlarge 8 4 2 2, 4 1, 2
m5.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m5.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m5.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m5.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m5a.large 2 1 2 1 1, 2
m5a.xlarge 4 2 2 2 1, 2
m5a.2xlarge 8 4 2 2, 4 1, 2
m5a.4xlarge 16 8 2 2, 4, 6, 8 1, 2
764
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m5ad.large 2 1 2 1 1, 2
m5ad.xlarge 4 2 2 2 1, 2
m5ad.2xlarge 8 4 2 2, 4 1, 2
m5ad.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m5d.large 2 1 2 1 1, 2
m5d.xlarge 4 2 2 2 1, 2
m5d.2xlarge 8 4 2 2, 4 1, 2
m5d.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m5d.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m5d.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m5d.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m5dn.large 2 1 2 1 1, 2
m5dn.xlarge 4 2 2 1, 2 1, 2
m5dn.2xlarge 8 4 2 2, 4 1, 2
m5dn.4xlarge 16 8 2 2, 4, 6, 8 1, 2
765
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m5dn.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m5dn.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m5dn.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m5dn.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
m5n.large 2 1 2 1 1, 2
m5n.xlarge 4 2 2 1, 2 1, 2
m5n.2xlarge 8 4 2 2, 4 1, 2
m5n.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m5n.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m5n.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m5n.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m5n.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
m5zn.large 2 1 2 1 1, 2
m5zn.xlarge 4 2 2 1, 2 1, 2
m5zn.2xlarge 8 4 2 2, 4 1, 2
m5zn.3xlarge 12 6 2 2, 4, 6 1, 2
m5zn.6xlarge 24 12 2 2, 4, 6, 8, 10, 1, 2
12
766
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m5zn.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m6a.large 2 1 2 1 1, 2
m6a.xlarge 4 2 2 1, 2 1, 2
m6a.2xlarge 8 4 2 1, 2, 3, 4 1, 2
m6a.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
m6a.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16
m6a.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16, 24
m6a.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32
m6a.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32,
48
m6i.large 2 1 2 1 1, 2
m6i.xlarge 4 2 2 1, 2 1, 2
m6i.2xlarge 8 4 2 2, 4 1, 2
m6i.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m6i.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m6i.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m6i.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
767
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m6i.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
m6id.large 2 1 2 1 1, 2
m6id.xlarge 4 2 2 1, 2 1, 2
m6id.2xlarge 8 4 2 2, 4 1, 2
m6id.4xlarge 16 8 2 2, 4, 6, 8 1, 2
m6id.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
m6id.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
m6id.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
m6id.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
m6idn.large 2 1 2 1 1, 2
m6idn.xlarge 4 2 2 1, 2 1, 2
768
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m6idn.2xlarge 8 4 2 1, 2, 3, 4 1, 2
m6idn.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
m6idn.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
m6idn.12xlarge48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24
m6idn.16xlarge64 32 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31,
32
m6in.large 2 1 2 1 1, 2
m6in.xlarge 4 2 2 1, 2 1, 2
m6in.2xlarge 8 4 2 1, 2, 3, 4 1, 2
m6in.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
m6in.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
769
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
m6in.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24
m6in.16xlarge 64 32 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31,
32
t3.nano 2 1 2 1 1, 2
t3.micro 2 1 2 1 1, 2
t3.small 2 1 2 1 1, 2
t3.medium 2 1 2 1 1, 2
t3.large 2 1 2 1 1, 2
t3.xlarge 4 2 2 2 1, 2
t3.2xlarge 8 4 2 2, 4 1, 2
t3a.nano 2 1 2 1 1, 2
t3a.micro 2 1 2 1 1, 2
t3a.small 2 1 2 1 1, 2
t3a.medium 2 1 2 1 1, 2
t3a.large 2 1 2 1 1, 2
770
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
t3a.xlarge 4 2 2 2 1, 2
t3a.2xlarge 8 4 2 2, 4 1, 2
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c3.large 2 1 2 1 1, 2
c3.xlarge 4 2 2 1, 2 1, 2
c3.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c3.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
c3.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
c4.large 2 1 2 1 1, 2
c4.xlarge 4 2 2 1, 2 1, 2
c4.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c4.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
c4.8xlarge 36 18 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18
c5.large 2 1 2 1 1, 2
c5.xlarge 4 2 2 2 1, 2
c5.2xlarge 8 4 2 2, 4 1, 2
c5.4xlarge 16 8 2 2, 4, 6, 8 1, 2
c5.9xlarge 36 18 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18
c5.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
771
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c5.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
c5a.large 2 1 2 1 1, 2
c5a.xlarge 4 2 2 1, 2 1, 2
c5a.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c5a.4xlarge 16 8 2 1, 2, 3, 4, 8 1, 2
c5a.8xlarge 32 16 2 1, 2, 3, 4, 8, 12, 1, 2
16
c5a.12xlarge 48 24 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24
c5a.16xlarge 64 32 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24, 28,
32
c5a.24xlarge 96 48 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24, 28,
32, 36, 40, 44,
48
c5ad.large 2 1 2 1 1, 2
c5ad.xlarge 4 2 2 1, 2 1, 2
c5ad.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c5ad.4xlarge 16 8 2 1, 2, 3, 4, 8 1, 2
c5ad.8xlarge 32 16 2 1, 2, 3, 4, 8, 12, 1, 2
16
c5ad.12xlarge 48 24 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24
c5ad.16xlarge 64 32 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24, 28,
32
c5ad.24xlarge 96 48 2 1, 2, 3, 4, 8, 12, 1, 2
16, 20, 24, 28,
32, 36, 40, 44,
48
c5d.large 2 1 2 1 1, 2
c5d.xlarge 4 2 2 2 1, 2
772
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c5d.2xlarge 8 4 2 2, 4 1, 2
c5d.4xlarge 16 8 2 2, 4, 6, 8 1, 2
c5d.9xlarge 36 18 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18
c5d.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
c5d.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
c5n.large 2 1 2 1 1, 2
c5n.xlarge 4 2 2 2 1, 2
c5n.2xlarge 8 4 2 2, 4 1, 2
c5n.4xlarge 16 8 2 2, 4, 6, 8 1, 2
c5n.9xlarge 36 18 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18
c6a.large 2 1 2 1 1, 2
c6a.xlarge 4 2 2 1, 2 1, 2
c6a.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c6a.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
c6a.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16
c6a.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16, 24
c6a.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32
773
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c6a.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32,
48
c6i.large 2 1 2 1 1, 2
c6i.xlarge 4 2 2 1, 2 1, 2
c6i.2xlarge 8 4 2 2, 4 1, 2
c6i.4xlarge 16 8 2 2, 4, 6, 8 1, 2
c6i.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
c6i.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
c6i.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
c6i.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
c6id.large 2 1 2 1 1, 2
c6id.xlarge 4 2 2 1, 2 1, 2
c6id.2xlarge 8 4 2 2, 4 1, 2
c6id.4xlarge 16 8 2 2, 4, 6, 8 1, 2
774
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c6id.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
c6id.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
c6id.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
c6id.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
c6in.large 2 1 2 1 1, 2
c6in.xlarge 4 2 2 1, 2 1, 2
c6in.2xlarge 8 4 2 1, 2, 3, 4 1, 2
c6in.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
c6in.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
c6in.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24
775
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
c6in.16xlarge 64 32 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31,
32
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
64
hpc6id.32xlarge 64 1 4, 6, 8, 10, 12, 1
14, 16, 18, 20,
22, 24, 26, 28,
30, 32, 34, 36,
38, 40, 42, 44,
46, 48, 50, 52,
54, 56, 58, 60,
62, 64
r3.large 2 1 2 1 1, 2
r3.xlarge 4 2 2 1, 2 1, 2
r3.2xlarge 8 4 2 1, 2, 3, 4 1, 2
r3.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
r3.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r4.large 2 1 2 1 1, 2
776
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r4.xlarge 4 2 2 1, 2 1, 2
r4.2xlarge 8 4 2 1, 2, 3, 4 1, 2
r4.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
r4.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
r4.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5.large 2 1 2 1 1, 2
r5.xlarge 4 2 2 2 1, 2
r5.2xlarge 8 4 2 2, 4 1, 2
r5.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r5.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r5.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5a.large 2 1 2 1 1, 2
r5a.xlarge 4 2 2 2 1, 2
r5a.2xlarge 8 4 2 2, 4 1, 2
r5a.4xlarge 16 8 2 2, 4, 6, 8 1, 2
777
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r5ad.large 2 1 2 1 1, 2
r5ad.xlarge 4 2 2 2 1, 2
r5ad.2xlarge 8 4 2 2, 4 1, 2
r5ad.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5b.large 2 1 2 1 1, 2
r5b.xlarge 4 2 2 1, 2 1, 2
r5b.2xlarge 8 4 2 2, 4 1, 2
r5b.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5b.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r5b.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r5b.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5b.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
778
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r5d.large 2 1 2 1 1, 2
r5d.xlarge 4 2 2 2 1, 2
r5d.2xlarge 8 4 2 2, 4 1, 2
r5d.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5d.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r5d.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r5d.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5dn.large 2 1 2 1 1, 2
r5dn.xlarge 4 2 2 1, 2 1, 2
r5dn.2xlarge 8 4 2 2, 4 1, 2
r5dn.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5dn.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r5dn.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r5dn.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5dn.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
r5n.large 2 1 2 1 1, 2
779
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r5n.xlarge 4 2 2 1, 2 1, 2
r5n.2xlarge 8 4 2 2, 4 1, 2
r5n.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r5n.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r5n.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r5n.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r5n.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
r6a.large 2 1 2 1 1, 2
r6a.xlarge 4 2 2 1, 2 1, 2
r6a.2xlarge 8 4 2 1, 2, 3, 4 1, 2
r6a.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
r6a.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16
r6a.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 16, 24
r6a.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32
r6a.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 32,
48
r6i.large 2 1 2 1 1, 2
780
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r6i.xlarge 4 2 2 1, 2 1, 2
r6i.2xlarge 8 4 2 2, 4 1, 2
r6i.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r6i.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r6i.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r6i.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r6i.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
r6idn.large 2 1 2 1 1, 2
r6idn.xlarge 4 2 2 1, 2 1, 2
r6idn.2xlarge 8 4 2 1, 2, 3, 4 1, 2
r6idn.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
r6idn.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
r6idn.12xlarge48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24
781
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r6idn.16xlarge64 32 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31,
32
r6in.large 2 1 2 1 1, 2
r6in.xlarge 4 2 2 1, 2 1, 2
r6in.2xlarge 8 4 2 1, 2, 3, 4 1, 2
r6in.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
r6in.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
r6in.12xlarge 48 24 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24
r6in.16xlarge 64 32 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31,
32
782
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
r6id.large 2 1 2 1 1, 2
r6id.xlarge 4 2 2 1, 2 1, 2
r6id.2xlarge 8 4 2 2, 4 1, 2
r6id.4xlarge 16 8 2 2, 4, 6, 8 1, 2
r6id.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
r6id.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
r6id.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
r6id.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
783
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
224
u-3tb1.56xlarge 112 2 4, 8, 12, 16, 1, 2
20, 24, 28, 32,
36, 40, 44, 48,
52, 56, 60, 64,
68, 72, 76, 80,
84, 88, 92, 96,
100, 104, 108,
112
224
u-6tb1.56xlarge 224 1 8, 16, 24, 32, 1
40, 48, 56, 64,
72, 80, 88, 96,
104, 112, 120,
128, 136, 144,
152, 160, 168,
176, 184, 192,
200, 208, 216,
224
448
u-6tb1.112xlarge 224 2 8, 16, 24, 32, 1, 2
40, 48, 56, 64,
72, 80, 88, 96,
104, 112, 120,
128, 136, 144,
152, 160, 168,
176, 184, 192,
200, 208, 216,
224
448
u-9tb1.112xlarge 224 2 8, 16, 24, 32, 1, 2
40, 48, 56, 64,
72, 80, 88, 96,
104, 112, 120,
128, 136, 144,
152, 160, 168,
176, 184, 192,
200, 208, 216,
224
448
u-12tb1.112xlarge 224 2 8, 16, 24, 32, 1, 2
40, 48, 56, 64,
72, 80, 88, 96,
104, 112, 120,
128, 136, 144,
152, 160, 168,
176, 184, 192,
200, 208, 216,
224
x1.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
784
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
x2idn.16xlarge64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
x2idn.24xlarge96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
x2idn.32xlarge128 64 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48, 50,
52, 54, 56, 58,
60, 62, 64
x2iedn.xlarge 4 2 2 1, 2 1, 2
x2iedn.2xlarge8 4 2 2, 4 1, 2
x2iedn.4xlarge16 8 2 2, 4, 6, 8 1, 2
x2iedn.8xlarge32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
64
x2iedn.16xlarge 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
96
x2iedn.24xlarge 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
128
x2iedn.32xlarge 64 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48, 50,
52, 54, 56, 58,
60, 62, 64
785
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
x2iezn.2xlarge8 4 2 2, 4 1, 2
x2iezn.4xlarge16 8 2 2, 4, 6, 8 1, 2
x2iezn.6xlarge24 12 2 2, 4, 6, 8, 10, 1, 2
12
x2iezn.8xlarge32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
48
x2iezn.12xlarge 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
x1e.xlarge 4 2 2 1, 2 1, 2
x1e.2xlarge 8 4 2 1, 2, 3, 4 1, 2
x1e.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
x1e.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
x1e.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
z1d.large 2 1 2 1 1, 2
z1d.xlarge 4 2 2 1, 2 1, 2
z1d.2xlarge 8 4 2 2, 4 1, 2
z1d.3xlarge 12 6 2 2, 4, 6 1, 2
z1d.6xlarge 24 12 2 2, 4, 6, 8, 10, 1, 2
12
786
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
d2.xlarge 4 2 2 1, 2 1, 2
d2.2xlarge 8 4 2 1, 2, 3, 4 1, 2
d2.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
d2.8xlarge 36 18 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18
d3.xlarge 4 2 2 1, 2 1, 2
d3.2xlarge 8 4 2 2, 4 1, 2
d3.4xlarge 16 8 2 2, 4, 6, 8 1, 2
d3.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
d3en.xlarge 4 2 2 1, 2 1, 2
d3en.2xlarge 8 4 2 2, 4 1, 2
d3en.4xlarge 16 8 2 2, 4, 6, 8 1, 2
d3en.6xlarge 24 12 2 2, 4, 6, 8, 10, 1, 2
12
d3en.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
d3en.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
h1.2xlarge 8 4 2 1, 2, 3, 4 1, 2
h1.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
h1.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
h1.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
i2.xlarge 4 2 2 1, 2 1, 2
i2.2xlarge 8 4 2 1, 2, 3, 4 1, 2
787
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
i2.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
i2.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
i3.large 2 1 2 1 1, 2
i3.xlarge 4 2 2 1, 2 1, 2
i3.2xlarge 8 4 2 1, 2, 3, 4 1, 2
i3.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
i3.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
i3.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
i3en.large 2 1 2 1 1, 2
i3en.xlarge 4 2 2 1, 2 1, 2
i3en.2xlarge 8 4 2 2, 4 1, 2
i3en.3xlarge 12 6 2 2, 4, 6 1, 2
i3en.6xlarge 24 12 2 2, 4, 6, 8, 10, 1, 2
12
i3en.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
i3en.24xlarge 96 48 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
36, 38, 40, 42,
44, 46, 48
i4i.large 2 1 2 1 1, 2
i4i.xlarge 4 2 2 1, 2 1, 2
i4i.2xlarge 8 4 2 1, 2, 3, 4 1, 2
i4i.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
788
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
i4i.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
i4i.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
f1.2xlarge 8 4 2 1, 2, 3, 4 1, 2
f1.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
f1.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
g2.2xlarge 8 4 2 1, 2, 3, 4 1, 2
g2.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
g3.4xlarge 16 8 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8
g3.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
g3.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
789
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
g4ad.xlarge 4 2 2 2 1, 2
g4ad.2xlarge 8 4 2 2, 4 1, 2
g4ad.4xlarge 16 8 2 2, 4, 8 1, 2
g4ad.8xlarge 32 16 2 2, 4, 8, 16 1, 2
g4ad.16xlarge 64 32 2 2, 4, 8, 16, 32 1, 2
g4dn.xlarge 4 2 2 2 1, 2
g4dn.2xlarge 8 4 2 2, 4 1, 2
g4dn.4xlarge 16 8 2 2, 4, 6, 8 1, 2
g4dn.8xlarge 32 16 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16
g4dn.12xlarge 48 24 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24
g4dn.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
p2.xlarge 4 2 2 1, 2 1, 2
p2.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
p2.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
p3.2xlarge 8 4 2 1, 2, 3, 4 1, 2
p3.8xlarge 32 16 2 1, 2, 3, 4, 5, 6, 1, 2
7, 8, 9, 10, 11,
12, 13, 14, 15,
16
p3.16xlarge 64 32 2 2, 4, 6, 8, 10, 1, 2
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32
790
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
Instance type Default vCPUs Default CPU Default Valid CPU Valid threads
cores threads per cores per core
core
The following examples describe how to specify the CPU options when using the launch instance wizard
in the EC2 console and the run-instances AWS CLI command, and the create launch template page in the
EC2 console and the create-launch-template AWS CLI command. For EC2 Fleet or Spot Fleet, you must
specify the CPU options in a launch template.
The following examples are for an r4.4xlarge instance type, which has the following default
values (p. 776):
Disable multithreading
To disable multithreading, specify 1 thread per core.
New console
1. Follow the Quickly launch an instance (p. 540) procedure and configure your instance as
needed.
2. Expand Advanced details, and select the Specify CPU options check box.
3. For Core count, choose the number of required CPU cores. In this example, to specify the
default CPU core count for an r4.4xlarge instance, choose 8.
4. To disable multithreading, for Threads per core, choose 1.
5. In the Summary panel, review your instance configuration, and then choose Launch instance.
For more information, see Launch an instance using the new launch instance wizard (p. 539).
Old console
1. Follow the Launch an instance using the old launch instance wizard (p. 548) procedure.
2. On the Configure Instance Details page, for CPU options, choose Specify CPU options.
791
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
3. For Core count, choose the number of required CPU cores. In this example, to specify the
default CPU core count for an r4.4xlarge instance, choose 8.
4. To disable multithreading, for Threads per core, choose 1.
5. Continue as prompted by the wizard. When you've finished reviewing your options on the
Review Instance Launch page, choose Launch. For more information, see Launch an instance
using the old launch instance wizard (p. 548).
AWS CLI
Use the run-instances AWS CLI command and specify a value of 1 for ThreadsPerCore for the --
cpu-options parameter. For CoreCount, specify the number of CPU cores. In this example, to
specify the default CPU core count for an r4.4xlarge instance, specify a value of 8.
New console
1. Follow the Quickly launch an instance (p. 540) procedure and configure your instance as
needed.
2. Expand Advanced details, and select the Specify CPU options check box.
3. To get 6 vCPUs, specify 3 CPU cores and 2 threads per core, as follows:
Old console
1. Follow the Launch an instance using the old launch instance wizard (p. 548) procedure.
2. On the Configure Instance Details page, for CPU options, choose Specify CPU options.
3. To get 6 vCPUs, specify 3 CPU cores and 2 threads per core, as follows:
792
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
AWS CLI
Use the run-instances AWS CLI command and specify the number of CPU cores and number of
threads in the --cpu-options parameter. You can specify 3 CPU cores and 2 threads per core to
get 6 vCPUs.
Alternatively, specify 6 CPU cores and 1 thread per core (disable multithreading) to get 6 vCPUs:
The following example creates a launch template that specifies the configuration for an r4.4xlarge
instance with 6 vCPUs.
Console
1. Follow the Create a new launch template using parameters you define (p. 556) procedure and
configure your launch template as needed.
2. Expand Advanced details, and select the Specify CPU options check box.
3. To get 6 vCPUs, specify 3 CPU cores and 2 threads per core, as follows:
AWS CLI
Use the create-launch-template AWS CLI command and specify the number of CPU cores and
number of threads in the CpuOptions parameter. You can specify 3 CPU cores and 2 threads per
core to get 6 vCPUs.
793
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Optimize CPU options
The following is an example JSON file that contains the launch template data, which includes the
CPU options, for the instance configuration for this example.
{
"NetworkInterfaces": [{
"AssociatePublicIpAddress": true,
"DeviceIndex": 0,
"Ipv6AddressCount": 1,
"SubnetId": "subnet-7b16de0c"
}],
"ImageId": "ami-8c1be5f6",
"InstanceType": "r4.4xlarge",
"TagSpecifications": [{
"ResourceType": "instance",
"Tags": [{
"Key":"Name",
"Value":"webserver"
}]
}],
"CpuOptions": {
"CoreCount":3,
"ThreadsPerCore":2
}
}
Alternatively, specify 6 CPU cores and 1 thread per core (disable multithreading) to get 6 vCPUs:
{
"NetworkInterfaces": [{
"AssociatePublicIpAddress": true,
"DeviceIndex": 0,
"Ipv6AddressCount": 1,
"SubnetId": "subnet-7b16de0c"
}],
"ImageId": "ami-8c1be5f6",
"InstanceType": "r4.4xlarge",
"TagSpecifications": [{
"ResourceType": "instance",
"Tags": [{
"Key":"Name",
"Value":"webserver"
}]
}],
"CpuOptions": {
"CoreCount":6,
"ThreadsPerCore":1
}
}
Console
794
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
3. On the Details tab, under Host and placement group, find Number of vCPUs.
AWS CLI
...
"Instances": [
{
"Monitoring": {
"State": "disabled"
},
"PublicDnsName": "ec2-198-51-100-5.eu-central-1.compute.amazonaws.com",
"State": {
"Code": 16,
"Name": "running"
},
"EbsOptimized": false,
"LaunchTime": "2018-05-08T13:40:33.000Z",
"PublicIpAddress": "198.51.100.5",
"PrivateIpAddress": "172.31.2.206",
"ProductCodes": [],
"VpcId": "vpc-1a2b3c4d",
"CpuOptions": {
"CoreCount": 34,
"ThreadsPerCore": 1
},
"StateTransitionReason": "",
...
}
]
...
In the output that's returned, the CoreCount field indicates the number of cores for the instance.
The ThreadsPerCore field indicates the number of threads per core.
Alternatively, connect to your instance and use Task Manager to view the CPU information for your
instance.
You can use AWS Config to record, assess, audit, and evaluate configuration changes for instances,
including terminated instances. For more information, see Getting Started with AWS Config in the AWS
Config Developer Guide.
Amazon provides the Amazon Time Sync Service, which is accessible from all EC2 instances, and is also
used by other AWS services. This service uses a fleet of satellite-connected and atomic reference clocks
in each Region to deliver accurate current time readings of the Coordinated Universal Time (UTC) global
795
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
standard through Network Time Protocol (NTP). The Amazon Time Sync Service automatically smooths
any leap seconds that are added to UTC.
The Amazon Time Sync Service is available through NTP at the 169.254.169.123 IPv4 address or the
fd00:ec2::123 IPv6 address for any instance running in a VPC. Your instance does not require access to
the internet, and you do not have to configure your security group rules or your network ACL rules to
allow access. The latest versions of AWS Windows AMIs synchronize with the Amazon Time Sync Service
by default.
Note
The examples in this section use the IPv4 address of the Amazon Time Sync Service:
169.254.169.123. If you are retrieving time for EC2 instances over the IPv6 address, ensure that
you use the IPv6 address instead: fd00:ec2::123. The IPv6 address is only accessible on Instances
built on the Nitro System (p. 210).
We recommend that you use Coordinated Universal Time (UTC) for your instances to avoid human error
and to facilitate synchronization across your CloudWatch Logs, Metrics, local logs, and other services. You
can, however, choose to use a different time zone to better suit your requirements.
When you use local timezones rather than UTC, make sure that you account for aspects such as daylight
savings time (when applicable) for automation, code, scheduled jobs, troubleshooting activities
(correlating logs), and more.
Use the following procedures to configure the Amazon Time Sync Service on your instance from the
command prompt. Alternatively, you can use external NTP sources. For more information about NTP
and public time sources, see http://www.ntp.org/. An instance must have access to the internet for the
external NTP time sources to work.
For Linux instances, see Set the time for your Linux instance.
Contents
• Change the time zone (p. 796)
• Configure network time protocol (NTP) (p. 797)
• Default network time protocol (NTP) settings for Amazon Windows AMIs (p. 798)
• Amazon Time Sync Public NTP (p. 799)
• Configure time settings for Windows Server 2008 and later (p. 800)
• Related resources (p. 800)
tzutil /l
This command returns a list of all available time zones, using the following format:
display name
796
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
time zone ID
Note
You can assign the recommended UTC time zone by using the following command:
tzutil /s "UTC"
For a backup to the Amazon Time Sync link-local service, and to connect resources outside of Amazon
EC2 to the Amazon Time Sync Service, you can use the Amazon Time Sync Public NTP pool located
at time.aws.com. Amazon Time Sync Public NTP, like the Amazon Time Sync service, automatically
smooths any leap seconds that are added to UTC. The Amazon Time Sync Service Public NTP is
supported globally by our fleet of satellite-connected and atomic reference clocks in each AWS Region
See Configuring Clients to Amazon Time Sync Public NTP for configuration instructions.
To configure Amazon Time Sync Public NTP for Microsoft Windows Server
797
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
This command returns the current configuration settings for the Windows instance.
3. (Optional) Get the status of the current configuration by typing the following command:
This command returns information such as the last time the instance synced with the NTP server and
the poll interval.
To change the NTP server to use the Amazon Time Sync Service
In the output that's returned, verify that NtpServer displays the 169.254.169.123 IP address.
You can change the instance to use a different set of NTP servers if required. For example, if you have
Windows instances that do not have internet access, you can configure them to use an NTP server
located within your private network. If your instance is within a domain, you should change the settings
to use the domain controllers as the time source to avoid time skew. The security group of your instance
must be configured to allow outbound UDP traffic on port 123 (NTP).
Where NTP servers is a space-delimited list of NTP servers for the instance to use.
2. Verify your new settings by using the following command:
• Update Interval – governs how frequently the time service will adjust system time towards accuracy.
AWS configures the update interval to occur once every two minutes.
• NTP Server – starting with the August 2018 release, AMIs will now use the Amazon Time Sync
Service by default. This time service is accessible from any EC2 Region at the 169.254.169.123
798
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
endpoint. Additionally, the 0x9 flag indicates that the time service is acting as a client, and to use
SpecialPollInterval to determine how frequently to check in with the configured time server.
• Type – "NTP" means that the service acts as a standalone NTP client instead of acting as part of a
domain.
• Enabled and InputProvider – the time service is enabled and provides time to the operating system.
• Special Poll Interval – checks against the configured NTP Server every 900 seconds, or 15 minutes.
HKLM:\System Enabled 1
\CurrentControlSet\services
\w32time\TimeProviders
\NtpClient
HKLM:\System InputProvider 1
\CurrentControlSet\services
\w32time\TimeProviders
\NtpClient
For a backup to the Amazon Time Sync link-local service, and to connect resources outside of Amazon
EC2 to the Amazon Time Sync Service, you can use the Amazon Time Sync Public NTP pool located
at time.aws.com. Amazon Time Sync Public NTP, like the Amazon Time Sync service, automatically
smooths any leap seconds that are added to UTC. The Amazon Time Sync Service Public NTP is
supported globally by our fleet of satellite-connected and atomic reference clocks in each AWS Region
See Configuring Clients to Amazon Time Sync Public NTP for configuration instructions.
799
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the time
To configure Amazon Time Sync Public NTP for Microsoft Windows Server
3. If you are using a Windows Server 2008 AMI (not Windows Server 2008 R2) that was created before
February 22, 2013, we recommend updating to the latest AWS Windows AMI. If you are using an AMI
running Windows Server 2008 R2 (not Windows Server 2008), you must verify that the Microsoft
hotfix KB2922223 is installed. If this hotfix is not installed, we recommend updating to the latest
AWS Windows AMI.
4. (Optional) Verify that the instance saved the key successfully using the following command:
This command returns the subkeys for the TimeZoneInformation registry key. You should see the
RealTimeIsUniversal key at the bottom of the list, similar to the following:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation
Bias REG_DWORD 0x1e0
DaylightBias REG_DWORD 0xffffffc4
DaylightName REG_SZ @tzres.dll,-211
DaylightStart REG_BINARY 00000300020002000000000000000000
StandardBias REG_DWORD 0x0
StandardName REG_SZ @tzres.dll,-212
StandardStart REG_BINARY 00000B00010002000000000000000000
TimeZoneKeyName REG_SZ Pacific Standard Time
DynamicDaylightTimeDisabled REG_DWORD 0x0
ActiveTimeBias REG_DWORD 0x1a4
RealTimeIsUniversal REG_DWORD 0x1
Related resources
For more information about how the Windows operating system coordinates and manages time,
including the addition of a leap second, see the following documentation:
800
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Set the password
• W32tm (Microsoft)
• How the Windows Time service treats a leap second (Microsoft)
• The story around Leap Seconds and Windows: It's likely not Y2K (Microsoft)
With AWS Windows AMIs for Windows Server 2012 R2 and earlier, the EC2Config service (p. 712)
generates the default password. With AWS Windows AMIs for Windows Server 2016 and 2019,
EC2Launch (p. 702) generates the default password. With AWS Windows AMIs for Windows Server
2022 and later, EC2Launch v2 (p. 653) generates the default password.
Note
With Windows Server 2016 and later, Password never expires is disabled for the local
administrator. With Windows Server 2012 R2 and earlier, Password never expires is
enabled for the local administrator.
To access and install the optional components, you must find the correct EBS snapshot for your version
of Windows Server, create a volume from the snapshot, and attach the volume to your instance.
801
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add Windows components
To add Windows components to your instance using the Tools for Windows PowerShell
1. Use the Get-EC2Snapshot cmdlet with the Owner and description filters to get a list of the
available installation media snapshots.
802
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add Windows components
2. In the output, note the ID of the snapshot that matches your system architecture and language
preference. For example:
...
DataEncryptionKeyId :
Description : Windows 2019 English Installation Media
Encrypted : False
KmsKeyId :
OwnerAlias : amazon
OwnerId : 123456789012
Progress : 100%
SnapshotId : snap-22da283e
StartTime : 10/25/2019 8:00:47 PM
State : completed
StateMessage :
Tags : {}
VolumeId : vol-be5eafcb
VolumeSize : 6
...
3. Use the New-EC2Volume cmdlet to create a volume from the snapshot. Specify the same Availability
Zone as your instance.
Attachments : {}
AvailabilityZone : us-east-1a
CreateTime : 4/18/2017 10:50:25 AM
Encrypted : False
Iops : 100
KmsKeyId :
Size : 6
SnapshotId : snap-22da283e
State : creating
Tags : {}
VolumeId : vol-06aa9e1fbf8b82ed1
VolumeType : gp2
6. Connect to your instance and make the volume available. For more information, see Make an
Amazon EBS volume available for use on Windows (p. 1543).
Important
Do not initialize the volume.
7. Open Control Panel, Programs and Features. Choose Turn Windows features on or off. If you are
prompted for installation media, specify the EBS volume with the installation media.
8. (Optional) When you are finished with the installation media, use the Dismount-EC2Volume cmdlet
to detach the volume from your instance. After you detach the volume, you can use the Remove-
EC2Volume cmdlet to delete the volume.
803
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add Windows components
1. Use the describe-snapshots command with the owner-ids parameter and description filter to
get a list of the available installation media snapshots.
2. In the output, note the ID of the snapshot that matches your system architecture and language
preference. For example:
{
"Snapshots": [
...
{
"OwnerAlias": "amazon",
"Description": "Windows 2019 English Installation Media",
"Encrypted": false,
"VolumeId": "vol-be5eafcb",
"State": "completed",
"VolumeSize": 6,
"Progress": "100%",
"StartTime": "2019-10-25T20:00:47.000Z",
"SnapshotId": "snap-22da283e",
"OwnerId": "123456789012"
},
...
]
}
3. Use the create-volume command to create a volume from the snapshot. Specify the same
Availability Zone as your instance.
{
"AvailabilityZone": "us-east-1a",
"Encrypted": false,
"VolumeType": "gp2",
"VolumeId": "vol-0c98b37f30bcbc290",
"State": "creating",
"Iops": 100,
"SnapshotId": "snap-22da283e",
"CreateTime": "2017-04-18T10:33:10.940Z",
"Size": 6
}
6. Connect to your instance and make the volume available. For more information, see Make an
Amazon EBS volume available for use on Windows (p. 1543).
804
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure a secondary private IPv4 Address
Important
Do not initialize the volume.
7. Open Control Panel, Programs and Features. Choose Turn Windows features on or off. If you are
prompted for installation media, specify the EBS volume with the installation media.
8. (Optional) When you are finished with the installation media, use the detach-volume command to
detach the volume from your instance. After you detach the volume, you can use the delete-volume
command to delete the volume.
Configuring the operating system on a Windows instance to recognize a secondary private IPv4 address
requires the following:
Topics
• Prerequisite steps (p. 805)
• Step 1: Configure static IP addressing on your instance (p. 805)
• Step 2: Configure a secondary private IP address for your instance (p. 807)
• Step 3: Configure applications to Use the secondary private IP address (p. 808)
Note
These instructions are based on Windows Server 2008 R2. The implementation of these steps
may vary based on the operating system of the Windows instance.
As a best practice, launch your Windows instances using the latest AMIs. If you are using an older
Windows AMI, ensure that it has the Microsoft hot fix referenced in http://support.microsoft.com/kb/
2582281.
Prerequisite steps
1. Assign the secondary private IPv4 address to the network interface for the instance. You can assign
the secondary private IPv4 address when you launch the instance, or after the instance is running. For
more information, see Assign a secondary private IPv4 address (p. 1197).
2. Allocate an Elastic IP address and associate it with the secondary private IPv4 address. For more
information, see Allocate an Elastic IP address (p. 1235) and Associate an Elastic IP address with the
secondary private IPv4 address (p. 1199).
805
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure a secondary private IPv4 Address
ipconfig /all
Review the following section in your output, and note the IPv4 Address, Subnet Mask, Default
Gateway, and DNS Servers values for the network interface.
3. Open the Network and Sharing Center by running the following command:
%SystemRoot%\system32\control.exe ncpa.cpl
4. Open the context (right-click) menu for the network interface (Local Area Connection) and choose
Properties.
5. Choose Internet Protocol Version 4 (TCP/IPv4), Properties.
6. In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, choose Use the following IP
address, enter the following values, and then choose OK.
Field Value
Important
If you set the IP address to any value other than the current IP address, you will lose
connectivity to the instance.
806
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure a secondary private IPv4 Address
You will lose RDP connectivity to the Windows instance for a few seconds while the instance converts
from using DHCP to static addressing. The instance retains the same IP address information as before,
but now this information is static and not managed by DHCP.
807
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure a secondary private IPv4 Address
808
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
For examples of the assembly of a UserData property in a AWS CloudFormation template, see Base64
Encoded UserData Property and Base64 Encoded UserData Property with AccessKey and SecretKey.
For information about running commands on your Linux instance at launch, see Running commands on
your Linux instance at launch in the Amazon EC2 User Guide for Linux Instances.
For an example of running commands on an instance within an Auto Scaling that work with lifecycle
hooks, see Tutorial: Configure user data to retrieve the target lifecycle state through instance metadata
in the Amazon EC2 Auto Scaling User Guide.
Contents
• User data scripts (p. 809)
• User data execution (p. 811)
• User data and the console (p. 813)
• User data and the Tools for Windows PowerShell (p. 815)
If you specify both a batch script and a Windows PowerShell script, the batch script runs first and the
Windows PowerShell script runs next, regardless of the order in which they appear in the instance user
data.
If you use an AWS API, including the AWS CLI, in a user data script, you must use an instance profile when
launching the instance. An instance profile provides the appropriate AWS credentials required by the user
data script to make the API call. For more information, see Instance profiles (p. 1463). The permissions
you assign to the IAM role depend on which services you are calling with the API. For more information,
see IAM roles for Amazon EC2.
809
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
Script type
• Syntax for batch scripts (p. 810)
• Syntax for Windows PowerShell scripts (p. 810)
• Syntax for YAML configuration scripts (p. 810)
• Base64 encoding (p. 811)
<script>
echo Current date and time >> %SystemRoot%\Temp\test.log
echo %DATE% %TIME% >> %SystemRoot%\Temp\test.log
</script>
By default, the user data scripts are run one time when you launch the instance. To run the user data
scripts every time you reboot or start the instance, add <persist>true</persist> to the user data.
<script>
echo Current date and time >> %SystemRoot%\Temp\test.log
echo %DATE% %TIME% >> %SystemRoot%\Temp\test.log
</script>
<persist>true</persist>
Specify a Windows PowerShell script using the <powershell> tag. Separate the commands using line
breaks. The <powershell> tag is case-sensitive.
For example:
<powershell>
$file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
</powershell>
By default, the user data scripts are run one time when you launch the instance. To run the user data
scripts every time you reboot or start the instance, add <persist>true</persist> to the user data.
<powershell>
$file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
</powershell>
<persist>true</persist>
810
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
version: 1.0
tasks:
- task: executeScript
inputs:
- frequency: always
type: powershell
runAs: localSystem
content: |-
$file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
version: 1.1
tasks:
- task: executeScript
inputs:
- frequency: always
type: batch
runAs: localSystem
content: |-
echo Current date and time >> %SystemRoot%\Temp\test.log
echo %DATE% %TIME% >> %SystemRoot%\Temp\test.log
Base64 encoding
If you're using the Amazon EC2 API or a tool that does not perform base64 encoding of the user data,
you must encode the user data yourself. If not, an error is logged about being unable to find script or
powershell tags to run. The following is an example that encodes using Windows PowerShell.
$UserData =
[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($Script))
$Script =
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($UserData))
User data scripts are run from the local administrator account when a random password is generated.
Otherwise, user data scripts are run from the System account.
811
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
Instance launch
Scripts in the instance user data are run during the initial launch of the instance. If the persist tag is
found, user data execution is enabled for subsequent reboots or starts. The log files for EC2Launch v2,
EC2Launch, and EC2Config contain the output from the standard output and standard error streams.
EC2Launch v2
• Info: Converting user-data to yaml format – If the user data was provided in XML format
• Info: Initializing user-data state – The start of user data execution
• Info: Frequency is: always – If the user data task is running on every boot
• Info: Frequency is: once – If the user data task is running just once
• Stage: postReadyUserData execution completed – The end of user data execution
EC2Launch
The C:\ProgramData folder might be hidden. To view the folder, you must show hidden files and
folders.
EC2Config
• Ec2HandleUserData: Message: Start running user scripts – The start of user data
execution
• Ec2HandleUserData: Message: Re-enabled userdata execution – If the persist tag is found
• Ec2HandleUserData: Message: Could not find <persist> and </persist> – If the
persist tag is not found
• Ec2HandleUserData: Message: The output from user scripts – If user data scripts are
run, their output is logged
812
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
If you choose the Shutdown with Sysprep option, user data scripts are run the next time the instance
starts or reboots, even if you did not enable user data execution for subsequent reboots or starts. The
user data scripts will not be executed on subsequent reboots or starts.
To enable user data execution with EC2Launch (Windows Server 2016 or later)
C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 –Schedule
3. Disconnect from your Windows instance. To run updated scripts the next time the instance is started,
stop the instance and update the user data. For more information, see View and update the instance
user data (p. 814).
To enable user data execution with EC2Config (Windows Server 2012 R2 and earlier)
In the following screenshot of the User data field, the example script creates a file in the
Windows temporary folder, using the current date and time in the file name. When you include
<persist>true</persist>, the script is run every time you reboot or start the instance. If you leave
the User data has already been base64 encoded check box empty, the Amazon EC2 console performs
the base64 encoding for you.
813
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
814
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
7. Start the instance. If you enabled user data execution for subsequent reboots or starts, the updated
user data scripts are run as part of the instance start process.
Create a text file with the instance user data. To run user data scripts every time you reboot or start the
instance, add <persist>true</persist>, as shown in the following example.
<powershell>
$file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
815
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Run commands at launch
</powershell>
<persist>true</persist>
To specify instance user data when you launch your instance, use the New-EC2Instance command. This
command does not perform base64 encoding of the user data for you. Use the following commands to
encode the user data in a text file named script.txt.
Use the -UserData parameter to pass the user data to the New-EC2Instance command.
You can modify the user data of a stopped instance using the Edit-EC2InstanceAttribute command.
Create a text file with the new script. Use the following commands to encode the user data in the text
file named new-script.txt.
Use the -UserData and -Value parameters to specify the user data.
To retrieve the user data for an instance, use the Get-EC2InstanceAttribute command.
The following is example output. Note that the user data is encoded.
PHBvd2Vyc2hlbGw
+DQpSZW5hbWUtQ29tcHV0ZXIgLU5ld05hbWUgdXNlci1kYXRhLXRlc3QNCjwvcG93ZXJzaGVsbD4=
Use the following commands to store the encoded user data in a variable and then decode it.
<powershell>
816
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
You can use the Get-EC2Tag command to read the tag value, rename the instance on first boot
to match the tag value, and reboot. To run this command successfully, you must have a role with
ec2:DescribeTags permissions attached to the instance because tag information is retrieved by the
API call. For more information on settings permissions by using IAM roles, see Attaching an IAM Role to
an Instance.
Note
This script fails on Windows Server versions prior to 2008.
<powershell>
$instanceId = (invoke-webrequest http://169.254.169.254/latest/meta-data/instance-id -
UseBasicParsing).content
$nameValue = (get-ec2tag -filter @{Name="resource-id";Value=
$instanceid},@{Name="key";Value="Name"}).Value
$pattern = "^(?![0-9]{1,15}$)[a-zA-Z0-9-]{1,15}$"
#Verify Name Value satisfies best practices for Windows hostnames
If ($nameValue -match $pattern)
{Try
{Rename-Computer -NewName $nameValue -Restart -ErrorAction Stop}
Catch
{$ErrorMessage = $_.Exception.Message
Write-Output "Rename failed: $ErrorMessage"}}
Else
{Throw "Provided name not a valid hostname. Please ensure Name value is between 1 and
15 characters in length and contains only alphanumeric or hyphen characters"}
</powershell>
You can also rename the instance using tags in instance metadata, if your instance is configured to
access tags from the instance metadata.
Note
This script fails on Windows Server versions prior to 2008.
<powershell>
$nameValue = Get-EC2InstanceMetadata -Path /tags/instance/Name
$pattern = "^(?![0-9]{1,15}$)[a-zA-Z0-9-]{1,15}$"
#Verify Name Value satisfies best practices for Windows hostnames
If ($nameValue -match $pattern)
{Try
{Rename-Computer -NewName $nameValue -Restart -ErrorAction Stop}
Catch
{$ErrorMessage = $_.Exception.Message
Write-Output "Rename failed: $ErrorMessage"}}
Else
{Throw "Provided name not a valid hostname. Please ensure Name value is between 1 and
15 characters in length and contains only alphanumeric or hyphen characters"}
</powershell>
817
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
You can also use instance metadata to access user data that you specified when launching your instance.
For example, you can specify parameters for configuring your instance, or include a simple script. You
can build generic AMIs and use user data to modify the configuration files supplied at launch time. For
example, if you run web servers for various small businesses, they can all use the same generic AMI and
retrieve their content from the Amazon S3 bucket that you specify in the user data at launch. To add a
new customer at any time, create a bucket for the customer, add their content, and launch your AMI with
the unique bucket name provided to your code in the user data. If you launch more than one instance
at the same time, the user data is available to all instances in that reservation. Each instance that is part
of the same reservation has a unique ami-launch-index number, allowing you to write code that
controls what to do. For example, the first host might elect itself as the original node in a cluster.
EC2 instances can also include dynamic data, such as an instance identity document that is generated
when the instance is launched. For more information, see Dynamic data categories (p. 851).
Important
Although you can only access instance metadata and user data from within the instance itself,
the data is not protected by authentication or cryptographic methods. Anyone who has direct
access to the instance, and potentially any software running on the instance, can view its
metadata. Therefore, you should not store sensitive data, such as passwords or long-lived
encryption keys, as user data.
Note
The examples in this topic use the IPv4 address of the Instance Metadata Service (IMDS):
169.254.169.254. If you are retrieving instance metadata for EC2 instances over the IPv6
address, ensure that you enable and use the IPv6 address instead: fd00:ec2::254. The IPv6
address of the IMDS is compatible with IMDSv2 commands. The IPv6 address is only accessible
on Instances built on the Nitro System (p. 210).
Contents
• Use IMDSv2 (p. 818)
• Configure the instance metadata options (p. 823)
• Retrieve instance metadata (p. 831)
• Work with instance user data (p. 840)
• Retrieve dynamic data (p. 841)
• Instance metadata categories (p. 842)
• Instance identity documents (p. 851)
• Instance identity roles (p. 879)
Use IMDSv2
You can access instance metadata from a running instance using one of the following methods:
By default, you can use either IMDSv1 or IMDSv2, or both. The instance metadata service distinguishes
between IMDSv1 and IMDSv2 requests based on whether, for any given request, either the PUT or GET
headers, which are unique to IMDSv2, are present in that request.
You can configure the Instance Metadata Service (IMDS) on each instance so that local code or
users must use IMDSv2. When you specify that IMDSv2 must be used, IMDSv1 no longer works. For
information about how to configure your instance to use IMDSv2, see Configure the instance metadata
options (p. 823).
818
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
For an extensive review of IMDSv2, see Add defense in depth against open firewalls, reverse proxies, and
SSRF vulnerabilities with enhancements to the EC2 Instance Metadata Service.
Topics
• How Instance Metadata Service Version 2 works (p. 819)
• Transition to using Instance Metadata Service Version 2 (p. 820)
• Use a supported AWS SDK (p. 823)
The following example uses a PowerShell shell script and IMDSv2 to retrieve the top-level instance
metadata items. The example:
• Creates a session token lasting six hours (21,600 seconds) using the PUT request
• Stores the session token header in a variable named token
• Requests the top-level metadata items using the token
After you've created a token, you can reuse it until it expires. In the following example command, which
gets the ID of the AMI used to launch the instance, the token that is stored in $token in the previous
example is reused.
When you use IMDSv2 to request instance metadata, the request must include the following:
1. Use a PUT request to initiate a session to the instance metadata service. The PUT request returns a
token that must be included in subsequent GET requests to the instance metadata service. The token
is required to access metadata using IMDSv2.
2. Include the token in all GET requests to the IMDS. When token usage is set to required, requests
without a valid token or with an expired token receive a 401 - Unauthorized HTTP error code.
• The token is an instance-specific key. The token is not valid on other EC2 instances and will be
rejected if you attempt to use it outside of the instance on which it was generated.
819
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
• The PUT request must include a header that specifies the time to live (TTL) for the token, in seconds,
up to a maximum of six hours (21,600 seconds). The token represents a logical session. The TTL
specifies the length of time that the token is valid and, therefore, the duration of the session.
• After a token expires, to continue accessing instance metadata, you must create a new session using
another PUT.
• You can choose to reuse a token or create a new token with every request. For a small number of
requests, it might be easier to generate and immediately use a token each time you need to access
the IMDS. But for efficiency, you can specify a longer duration for the token and reuse it rather
than having to write a PUT request every time you need to request instance metadata. There is no
practical limit on the number of concurrent tokens, each representing its own session. IMDSv2 is,
however, still constrained by normal IMDS connection and throttling limits. For more information,
see Query throttling (p. 838).
HTTP GET and HEAD methods are allowed in IMDSv2 instance metadata requests. PUT requests are
rejected if they contain an X-Forwarded-For header.
By default, the response to PUT requests has a response hop limit (time to live) of 1 at the IP protocol
level. If you need a bigger hop limit, you can adjust it by using the modify-instance-metadata-options
AWS CLI command. For example, you might need a bigger hop limit for backward compatibility with
container services running on the instance. For more information, see Modify instance metadata options
for existing instances (p. 827).
Topics
• Tools for helping with the transition to IMDSv2 (p. 820)
• Recommended path to requiring IMDSv2 (p. 822)
If your software uses IMDSv1, use the following tools to help reconfigure your software to use IMDSv2.
AWS software
The latest versions of the AWS CLI and AWS SDKs support IMDSv2. To use IMDSv2, make sure that
your EC2 instances have the latest versions of the CLI and SDKs. For information about updating the
CLI, see Installing, updating, and uninstalling the AWS CLI in the AWS Command Line Interface User
Guide.
For the minimum AWS SDK versions that support IMDSv2, see Use a supported AWS SDK (p. 823).
IMDS Packet Analyzer
The IMDS Packet Analyzer is an open-sourced tool that identifies and logs IMDSv1 calls from your
instance’s boot phase. This can assist in identifying the software making IMDSv1 calls on EC2
instances, allowing you to pinpoint exactly what you need to update to get your instances ready to
use IMDSv2 only. You can run IMDS Packet Analyzer from a command line or install it as a service.
For more information, see IMDS Packet Analyzer on GitHub.
CloudWatch
IMDSv2 uses token-backed sessions, while IMDSv1 does not. The MetadataNoToken CloudWatch
metric tracks the number of calls to the Instance Metadata Service (IMDS) that are using IMDSv1. By
820
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
tracking this metric to zero, you can determine if and when all of your software has been upgraded
to use IMDSv2. For more information, see Instance metrics (p. 1140).
Updates to EC2 APIs and CLIs
For new instances, you can use the RunInstances API to launch new instances that require the use of
IMDSv2. For more information, see Configure instance metadata options for new instances (p. 824).
For existing instances, you can use the ModifyInstanceMetadataOptions API to require the
use of IMDSv2. For more information, see Modify instance metadata options for existing
instances (p. 827).
To require the use of IMDSv2 on all new instances launched by Auto Scaling groups, your Auto
Scaling groups can use either a launch template or a launch configuration. When you create a launch
template or create a launch configuration, you must configure the MetadataOptions parameters
to require the use of IMDSv2. The Auto Scaling group launches new instances using the new launch
template or launch configuration, but existing instances are not affected. For existing instances in
an Auto Scaling group, you can use the ModifyInstanceMetadataOptions API to require the use of
IMDSv2 on the existing instances, or terminate the instances and the Auto Scaling group will launch
new replacement instances with the instance metadata options settings that are defined in the new
launch template or launch configuration.
Use an AMI that configures IMDSv2 by default
When you launch an instance, you can automatically configure it to use IMDSv2 by default (the
HttpTokens parameter is set to required) by launching it with an AMI that is configured with the
ImdsSupport parameter set to v2.0. You can set the ImdsSupport parameter to v2.0 when you
register the AMI using the register-image CLI command, or you can modify an existing AMI by using
the modify-image-attribute CLI command. For more information, see Configure the AMI (p. 825).
IAM policies and SCPs
You can use an IAM policy or AWS Organizations service control policy (SCP) to control users as
follows:
• Can't launch an instance using the RunInstances API unless the instance is configured to use
IMDSv2.
• Can't modify a running instance using the ModifyInstanceMetadataOptions API to re-enable
IMDSv1.
The IAM policy or SCP must contain the following IAM condition keys:
• ec2:MetadataHttpEndpoint
• ec2:MetadataHttpPutResponseHopLimit
• ec2:MetadataHttpTokens
If a parameter in the API or CLI call does not match the state specified in the policy that contains the
condition key, the API or CLI call fails with an UnauthorizedOperation response.
Furthermore, you can choose an additional layer of protection to enforce the change from IMDSv1
to IMDSv2. At the access management layer with respect to the APIs called via EC2 Role credentials,
you can use a new condition key in either IAM policies or AWS Organizations service control
policies (SCPs). Specifically, by using the condition key ec2:RoleDelivery with a value of 2.0
in your IAM policies, API calls made with EC2 Role credentials obtained from IMDSv1 will receive
an UnauthorizedOperation response. The same thing can be achieved more broadly with that
condition required by an SCP. This ensures that credentials delivered via IMDSv1 cannot actually
be used to call APIs because any API calls not matching the specified condition will receive an
UnauthorizedOperation error.
For example IAM policies, see Work with instance metadata (p. 1449). For more information on
SCPs, see Service Control Policies in the AWS Organizations User Guide.
821
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Using the above tools, we recommend that you follow this path for transitioning to IMDSv2.
Update the SDKs, CLIs, and your software that use Role credentials on their EC2 instances to versions
compatible with IMDSv2. For information about updating the CLI, see Upgrading to the latest version of
the AWS CLI in the AWS Command Line Interface User Guide.
Then, change your software that directly accesses instance metadata (in other words, that does not use
an SDK) using the IMDSv2 requests. You can use the IMDS Packet Analyzer to identify the software that
you need to change to use IMDSv2 requests.
Track your transition progress by using the CloudWatch metric MetadataNoToken. This metric
shows the number of IMDSv1 calls to the IMDS on your instances. For more information, see Instance
metrics (p. 1140).
When the CloudWatch metric MetadataNoToken records zero IMDSv1 usage, your instances are ready
to be fully transitioned to using IMDSv2. At this stage, you can do the following:
• New instances
You can modify the instance metadata options on running instances, and you don't need to restart the
instances after modifying the instance metadata options.
You can check if any instances are not yet configured to require the use of IMDSv2, in other words,
IMDSv2 is still configured as optional. If any instances are still configured as optional, you can
modify the instance metadata options to make IMDSv2 required by repeating the preceding Step
3 (p. 822).
• Amazon EC2 console: On the Instances page, filter your instances by using the IMDSv2 = optional
filter. For more information about filtering, see Filter resources using the console (p. 1886). You can
also view whether IMDSv2 is required or optional for each instance: In the Preferences window, toggle
on IMDSv2 to add the IMDSv2 column to the Instances table.
822
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
• AWS CLI: Use the describe-instances CLI command and filter by metadata-options.http-tokens
= optional, as follows:
The following are the minimum versions that support using IMDSv2:
You can also use IAM condition keys in an IAM policy or SCP to do the following:
823
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
• Allow an instance to launch only if it's configured to require the use of IMDSv2
• Restrict the number of allowed hops
• Turn off access to instance metadata
Note
If your PowerShell version is earlier than 4.0, you must update to Windows Management
Framework 4.0 to require the use of IMDSv2.
Note
You should proceed cautiously and conduct careful testing before making any changes. Take
note of the following:
• If you enforce the use of IMDSv2, applications or agents that use IMDSv1 for instance
metadata access will break.
• If you turn off all access to instance metadata, applications or agents that rely on instance
metadata access to function will break.
• For IMDSv2, you must use /latest/api/token when retrieving the token.
Topics
• Configure instance metadata options for new instances (p. 824)
• Modify instance metadata options for existing instances (p. 827)
There are various ways that you can require that IMDSv2 is used on an instance at launch, as follows:
• Configure the instance at launch (p. 824)
• Configure the AMI (p. 825)
• Use an IAM policy (p. 826)
When you launch an instance (p. 540), you can configure the instance to require the use of IMDSv2 by
configuring the following fields:
When you specify that IMDSv2 is required, you must also enable the Instance Metadata Service (IMDS)
endpoint by setting Metadata accessible to Enabled (console) or HttpEndpoint to enabled (AWS CLI).
824
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
New console
• When launching a new instance in the Amazon EC2 console, expand Advanced details, and do
the following:
Old console
• When launching a new instance in the Amazon EC2 console, select the following options on the
Configure Instance Details page:
For more information, see Step 3: Configure Instance Details (p. 550).
AWS CLI
AWS CloudFormation
To specify the metadata options for an instance using AWS CloudFormation, see the
AWS::EC2::LaunchTemplate MetadataOptions property in the AWS CloudFormation User Guide.
Note that when you set imds-support to v2.0, instances launched from this AMI will also have
Metadata response hop limit (console) or http-put-response-hop-limit (AWS CLI) set to 2.
Important
Do not use this parameter unless your AMI software supports IMDSv2. After you set the value
to v2.0, you can't undo it. The only way to "reset" your AMI is to create a new AMI from the
underlying snapshot.
825
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
The following register-image example registers an AMI using the specified snapshot of an EBS root
volume as device /dev/xvda. Specify v2.0 for the imds-support parameter so that instances
launched from this AMI will require that IMDSv2 is used when requesting instance metadata.
The following modify-image-attribute example modifies an existing AMI for IMDSv2 only. Specify v2.0
for the imds-support parameter so that instances launched from this AMI will require that IMDSv2 is
used when requesting instance metadata.
You can create an IAM policy that prevents users from launching new instances unless they require
IMDSv2 on the new instance.
To enforce the use of IMDSv2 on all new instances by using an IAM policy
To ensure that users can only launch instances that require the use of IMDSv2 when requesting instance
metadata, you can specify that the condition to require IMDSv2 must be met before an instance can be
launched. For the example IAM policy, see Work with instance metadata (p. 1449).
By default, the IPv6 endpoint is disabled. This is true even if you are launching an instance into an IPv6-
only subnet. You can choose to enable the IPv6 endpoint at instance launch when using the AWS CLI.
This option is not available in the Amazon EC2 console.
The IPv6 endpoint for the IMDS is only accessible on Instances built on the Nitro System (p. 210).
The following run-instances example launches a t3.large instance with the IPv6 endpoint enabled
for the IMDS. To enable the IPv6 endpoint, for the --metadata-options parameter, specify
HttpProtocolIpv6=enabled. When you specify a value for HttpProtocolIpv6, you must also set
HttpEndpoint to enabled.
You can ensure that access to your instance metadata is turned off, regardless of which version of the
IMDS you are using. You can turn on access later. For more information, see Turn on access to instance
metadata (p. 829).
826
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
New console
• Launch the instance (p. 540) in the Amazon EC2 console with the following specified under
Advanced details:
• Launch the instance in the Amazon EC2 console with the following option selected on the
Configure Instance Details page:
For more information, see Step 3: Configure Instance Details (p. 550).
AWS CLI
AWS CloudFormation
To specify the metadata options for an instance using AWS CloudFormation, see the
AWS::EC2::LaunchTemplate MetadataOptions property in the AWS CloudFormation User Guide.
You can also create an IAM policy that prevents users from modifying the instance metadata options on
existing instances. To control which users can modify the instance metadata options, specify a policy that
prevents all users other than users with a specified role to use the ModifyInstanceMetadataOptions API.
For the example IAM policy, see Work with instance metadata (p. 1449).
You can modify the following metadata options for existing instances:
• Require the use of IMDSv2 (p. 828)
• Restore the use of IMDSv1 (p. 828)
• Change the PUT response hop limit (p. 829)
• Enable the IPv6 endpoint for your instance (p. 829)
• Turn on access to instance metadata (p. 829)
• Turn off access to instance metadata (p. 830)
827
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Use one of the following methods to modify the instance metadata options on an existing instance
to require that IMDSv2 is used when requesting instance metadata. When IMDSv2 is required, IMDSv1
cannot be used.
Console
AWS CLI
Use the modify-instance-metadata-options CLI command and set the http-tokens parameter
to required. When you specify a value for http-tokens, you must also set http-endpoint to
enabled.
When IMDSv2 is required, IMDSv1 will not work when requesting instance metadata. When IMDSv2 is
optional, then both IMDSv2 and IMDSv1 will work. Therefore, to restore IMDSv1, make IMDSv2 optional
by using one of the following methods.
Console
828
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
AWS CLI
You can use the modify-instance-metadata-options CLI command with http-tokens set to
optional to restore the use of IMDSv1 when requesting instance metadata.
For existing instances, you can change the settings of the PUT response hop limit.
Currently only the AWS CLI and AWS SDKs support changing the PUT response hop limit.
By default, the IPv6 endpoint is disabled. This is true even if you have launched an instance into an
IPv6-only subnet. The IPv6 endpoint for the IMDS is only accessible on Instances built on the Nitro
System (p. 210).
Currently only the AWS CLI and AWS SDKs support enabling the IPv6 endpoint for your instance.
Use the modify-instance-metadata-options CLI command and set the http-protocol-ipv6 parameter
to enabled. Note that when specifying a value for http-protocol-ipv6, you must also set http-
endpoint to enabled.
You can turn on access to instance metadata by enabling the HTTP endpoint of the IMDS on your
instance, regardless of which version of the IMDS you are using. You can reverse this change at any time
by disabling the HTTP endpoint.
Use one of the following methods to turn on access to instance metadata on an instance.
829
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Console
AWS CLI
Use the modify-instance-metadata-options CLI command and set the http-endpoint parameter
to enabled.
You can turn off access to instance metadata by disabling the HTTP endpoint of the IMDS on your
instance, regardless of which version of the IMDS you are using. You can reverse this change at any time
by enabling the HTTP endpoint.
Use one of the following methods to turn off access to instance metadata on an instance.
Console
AWS CLI
Use the modify-instance-metadata-options CLI command and set the http-endpoint parameter
to disabled.
830
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
--instance-id i-1234567898abcdef0 \
--http-endpoint disabled
Instance metadata is divided into categories. For a description of each instance metadata category, see
Instance metadata categories (p. 842).
To view all categories of instance metadata from within a running instance, use the following IPv4 or
IPv6 URIs.
IPv4
http://169.254.169.254/latest/meta-data/
IPv6
http://[fd00:ec2::254]/latest/meta-data/
The IP addresses are link-local addresses and are valid only from the instance. For more information, see
Link-local address on Wikipedia.
Note
The examples in this section use the IPv4 address of the IMDS: 169.254.169.254. If you are
retrieving instance metadata for EC2 instances over the IPv6 address, ensure that you enable
and use the IPv6 address instead: fd00:ec2::254. The IPv6 address of the IMDS is compatible
with IMDSv2 commands. The IPv6 address is only accessible on Instances built on the Nitro
System (p. 210).
The command format is different, depending on whether you use IMDSv1 or IMDSv2. By default, you can
use both versions of the IMDS. To require the use of IMDSv2, see Use IMDSv2 (p. 818).
You can use PowerShell cmdlets to retrieve the URI. For example, if you are running version 3.0 or later
of PowerShell, use the following cmdlet.
IMDSv2
IMDSv1
If you don't want to use PowerShell, you can install a third-party tool such as GNU Wget or cURL.
831
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Important
If you install a third-party tool on a Windows instance, ensure that you read the accompanying
documentation carefully, as the method of calling the HTTP and the output format might be
different from what is documented here.
For the command to retrieve instance metadata from a Linux instance, see Retrieve instance metadata in
the Amazon EC2 User Guide for Windows Instances.
Costs
You are not billed for HTTP requests used to retrieve instance metadata and user data.
Considerations
To avoid problems with instance metadata retrieval, consider the following:
• The AWS SDKs use IMDSv2 calls by default. If the IMDSv2 call receives no response, the SDK retries
the call and, if still unsuccessful, uses IMDSv1. This can result in a delay. In a container environment, if
the hop limit is 1, the IMDSv2 response does not return because going to the container is considered
an additional network hop. To avoid the process of falling back to IMDSv1 and the resultant delay, in
a container environment we recommend that you set the hop limit to 2. For more information, see
Configure the instance metadata options (p. 823).
• If you launch a Windows instance using a custom Windows AMI, to ensure that the IMDS works on the
instance, the AMI must be a standardized image created using Sysprep (p. 146). Otherwise, the IMDS
won't work.
• For IMDSv2, you must use /latest/api/token when retrieving the token. Issuing PUT requests to
any version-specific path, for example /2021-03-23/api/token, will result in the metadata service
returning 403 Forbidden errors. This behavior is intended.
A request for a specific metadata resource returns the appropriate value, or a 404 - Not Found HTTP
error code if the resource is not available.
A request for a general metadata resource (the URI ends with a /) returns a list of available resources, or
a 404 - Not Found HTTP error code if there is no such resource. The list items are on separate lines,
terminated by line feeds (ASCII 10).
For requests made using Instance Metadata Service Version 2, the following HTTP error codes can be
returned:
832
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Examples
• Get the available versions of the instance metadata (p. 833)
• Get the top-level metadata items (p. 834)
• Get the list of available public keys (p. 836)
• Show the formats in which public key 0 is available (p. 836)
• Get public key 0 (in the OpenSSH key format) (p. 837)
• Get the subnet ID for an instance (p. 837)
• Get the instance tags for an instance (p. 838)
This example gets the available versions of the instance metadata. Each version refers to an instance
metadata build when new instance metadata categories were released. The instance metadata build
versions do not correlate with the Amazon EC2 API versions. The earlier versions are available to you in
case you have scripts that rely on the structure and information present in a previous version.
Note
To avoid having to update your code every time Amazon EC2 releases a new instance metadata
build, we recommend that you use latest in the path, and not the version number. For
example, use latest as follows:
curl http://169.254.169.254/latest/meta-data/ami-id
IMDSv2
IMDSv1
833
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
2007-12-15
2008-02-01
2008-09-01
2009-04-04
2011-01-01
2011-05-01
2012-01-12
2014-02-25
2014-11-05
2015-10-20
2016-04-19
...
latest
This example gets the top-level metadata items. For more information, see Instance metadata
categories (p. 842).
IMDSv2
IMDSv1
834
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups
services/
The following examples get the values of some of the top-level metadata items that were obtained in
the preceding example. The IMDSv2 requests use the stored token that was created in the preceding
example command, assuming it has not expired.
IMDSv2
IMDSv1
IMDSv2
IMDSv1
IMDSv2
IMDSv1
835
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
ip-10-251-50-12.ec2.internal
IMDSv2
IMDSv1
IMDSv2
IMDSv1
IMDSv2
IMDSv1
836
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
This example gets public key 0 (in the OpenSSH key format).
IMDSv2
IMDSv1
IMDSv2
837
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
IMDSv1
This example gets all the instance tag keys for an instance.
IMDSv2
IMDSv1
The following example gets the value of the Name key that was obtained in the preceding example. The
IMDSv2 request uses the stored token that was created in the preceding example command, assuming it
has not expired.
IMDSv2
IMDSv1
Query throttling
We throttle queries to the IMDS on a per-instance basis, and we place limits on the number of
simultaneous connections from an instance to the IMDS.
If you're using the IMDS to retrieve AWS security credentials, avoid querying for credentials during every
transaction or concurrently from a high number of threads or processes, as this might lead to throttling.
Instead, we recommend that you cache the credentials until they start approaching their expiry time. For
more information about IAM role and security credentials associated with the role, see Retrieve security
credentials from instance metadata (p. 1464).
838
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
If you are throttled while accessing the IMDS, retry your query with an exponential backoff strategy.
The following PowerShell example uses the built-in Windows firewall to prevent the Internet Information
Server webserver (based on its default installation user ID of NT AUTHORITY\IUSR) from accessing
169.254.169.254. It uses a deny rule to reject all instance metadata requests (whether IMDSv1 or
IMDSv2) from any process running as that user.
Or, you can consider only allowing access to particular users or groups, by using allow rules. Allow rules
might be easier to manage from a security perspective, because they require you to make a decision
about what software needs access to instance metadata. If you use allow rules, it's less likely you will
accidentally allow software to access the metadata service (that you did not intend to have access) if
you later change the software or configuration on an instance. You can also combine group usage with
allow rules, so that you can add and remove users from a permitted group without needing to change
the firewall rule.
The following example prevents access to instance metadata by all processes running as an OS group
specified in the variable blockPrincipal (in this example, the Windows group Everyone), except for
processes specified in exceptionPrincipal (in this example, a group called trustworthy-users).
You must specify both deny and allow principals because Windows Firewall, unlike the ! --uid-owner
trustworthy-user rule in Linux iptables, does not provide a shortcut mechanism to allow only a
particular principal (user or group) by denying all the others.
839
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
Note
To use local firewall rules, you need to adapt the preceding example commands to suit your
needs.
You can consider blocking all software using netsh rules, but those are much less flexible.
C:\> netsh advfirewall firewall add rule name="Block metadata service altogether" dir=out
protocol=TCP remoteip=169.254.169.254 action=block
Note
• To use local firewall rules, you need to adapt the preceding example commands to suit your
needs.
• netsh rules must be set from an elevated command prompt, and can’t be set to deny or
allow particular principals.
• User data must be base64-encoded. The Amazon EC2 console can perform the base64-encoding for
you or accept base64-encoded input.
• User data is limited to 16 KB, in raw form, before it is base64-encoded. The size of a string of length n
after base64-encoding is ceil(n/3)*4.
• User data must be base64-decoded when you retrieve it. If you retrieve the data using instance
metadata or the console, it's decoded for you automatically.
• User data is treated as opaque data: what you give is what you get back. It is up to the instance to be
able to interpret it.
• If you stop an instance, modify its user data, and start the instance, the updated user data is not
run automatically when you start the instance. However, you can configure settings so that updated
user data scripts are run one time when you start the instance or every time you reboot or start the
instance.
840
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
To retrieve user data from within a running instance, use the following URI.
http://169.254.169.254/latest/user-data
A request for user data returns the data as it is (content type application/octet-stream).
This example returns user data that was provided as comma-separated text.
IMDSv2
IMDSv1
IMDSv2
IMDSv1
To retrieve user data for an instance from your own computer, see User data and the Tools for Windows
PowerShell (p. 815).
841
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
http://169.254.169.254/latest/dynamic/
Note
The examples in this section use the IPv4 address of the IMDS: 169.254.169.254. If you are
retrieving instance metadata for EC2 instances over the IPv6 address, ensure that you enable
and use the IPv6 address instead: fd00:ec2::254. The IPv6 address of the IMDSis compatible
with IMDSv2 commands. The IPv6 address is only accessible on Instances built on the Nitro
System (p. 210).
This example shows how to retrieve the high-level instance identity categories.
IMDSv2
IMDSv1
For more information about dynamic data and examples of how to retrieve it, see Instance identity
documents (p. 851).
When new categories are released, a new instance metadata build is created with a new version number.
In the following table, the Version when category was released column specifies the build version when
an instance metadata category was released. To avoid having to update your code every time Amazon
EC2 releases a new instance metadata build, use latest instead of the version number in your metadata
requests. For more information, see Get the available versions of the instance metadata (p. 833).
When Amazon EC2 releases a new instance metadata category, the instance metadata for the new
category might not be available for existing instances. With instances built on the Nitro system (p. 210),
you can retrieve instance metadata only for the categories that were available at launch. For instances
with the Xen hypervisor, you can stop and then start (p. 580) the instance to update the categories that
are available for the instance.
The following table lists the categories of instance metadata. Some of the category names include
placeholders for data that is unique to your instance. For example, mac represents the MAC address
for the network interface. You must replace the placeholders with actual values when you retrieve the
instance metadata.
842
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
843
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
844
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
845
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
846
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
847
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
848
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
849
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
850
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
fws/instance- Value showing whether the customer has enabled detailed 2009-04-04
monitoring one-minute monitoring in CloudWatch. Valid values:
enabled | disabled
851
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
The instance identity document is generated when the instance is stopped and started, restarted, or
launched. The instance identity document is exposed (in plaintext JSON format) through the Instance
Metadata Service (IMDS). The IPv4 address 169.254.169.254 is a link-local address and is valid
only from the instance. For more information, see Link-local address on Wikipedia. The IPv6 address
fd00:ec2::254 is a unique local address and is valid only from the instance. For more information,
see Unique local address on Wikipedia.
Note
The examples in this section use the IPv4 address of the IMDS: 169.254.169.254. If you are
retrieving instance metadata for EC2 instances over the IPv6 address, ensure that you enable
and use the IPv6 address instead: fd00:ec2::254. The IPv6 address of the IMDS is compatible
with IMDSv2 commands. The IPv6 address is only accessible on Instances built on the Nitro
System (p. 210).
You can retrieve the instance identity document from a running instance at any time. The instance
identity document includes the following information:
Data Description
architecture The architecture of the AMI used to launch the instance (i386 | x86_64 |
arm64).
devpayProductCodes Deprecated.
The AWS Marketplace product code of the AMI used to launch the instance.
marketplaceProductCodes
pendingTime The date and time that the instance was launched.
ramdiskId The ID of the RAM disk associated with the instance, if applicable.
Connect to the instance and run one of the following commands depending on the version of the IMDS
used by the instance.
852
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
IMDSv2
IMDSv1
{
"devpayProductCodes" : null,
"marketplaceProductCodes" : [ "1abc2defghijklm3nopqrs4tu" ],
"availabilityZone" : "us-west-2b",
"privateIp" : "10.158.112.84",
"version" : "2017-09-30",
"instanceId" : "i-1234567890abcdef0",
"billingProducts" : null,
"instanceType" : "t2.micro",
"accountId" : "123456789012",
"imageId" : "ami-5fb8c835",
"pendingTime" : "2016-11-19T16:32:11Z",
"architecture" : "x86_64",
"kernelId" : null,
"ramdiskId" : null,
"region" : "us-west-2"
}
The plaintext instance identity document is accompanied by three hashed and encrypted signatures. You
can use these signatures to verify the origin and authenticity of the instance identity document and the
information that it includes. The following signatures are provided:
Each signature is available at a different endpoint in the instance metadata. You can use any one of these
signatures depending on your hashing and encryption requirements. To verify the signatures, you must
use the corresponding AWS public certificate.
The following topics provide detailed steps for validating the instance identity document using each
signature.
853
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
• Use the PKCS7 signature to verify the instance identity document (p. 854)
• Use the base64-encoded signature to verify the instance identity document (p. 860)
• Use the RSA-2048 signature to verify the instance identity document (p. 865)
Prerequisites
This procedure requires the System.Security Microsoft .NET Core class. To add the class to your
PowerShell session, run the following command.
Note
The command adds the class to the current PowerShell session only. If you start a new session,
you must run the command again.
To verify the instance identity document using the PKCS7 signature and the AWS DSA public
certificate
IMDSv2
IMDSv1
3. Retrieve the plaintext instance identity document from the instance metadata, convert it to a byte
array, and add it to a variable named $Document. Use one of the following commands depending
on the IMDS version used by the instance.
IMDSv2
854
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
IMDSv1
4. Create a new file named certificate.pem and add one of the following AWS DSA public
certificates, depending on your Region.
The following AWS public certificate is for all AWS Regions, except Hong Kong, Bahrain, UAE,
Cape Town, Milan, Spain, Zurich, Jakarta, Melbourne, Hyderabad, and China.
-----BEGIN CERTIFICATE-----
MIIC7TCCAq0CCQCWukjZ5V4aZzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xMjAxMDUxMjU2MTJaFw0z
ODAxMDUxMjU2MTJaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQCjkvcS2bb1VQ4yt/5e
ih5OO6kK/n1Lzllr7D8ZwtQP8fOEpp5E2ng+D6Ud1Z1gYipr58Kj3nssSNpI6bX3
VyIQzK7wLclnd/YozqNNmgIyZecN7EglK9ITHJLP+x8FtUpt3QbyYXJdmVMegN6P
hviYt5JH/nYl4hh3Pa1HJdskgQIVALVJ3ER11+Ko4tP6nwvHwh6+ERYRAoGBAI1j
k+tkqMVHuAFcvAGKocTgsjJem6/5qomzJuKDmbJNu9Qxw3rAotXau8Qe+MBcJl/U
hhy1KHVpCGl9fueQ2s6IL0CaO/buycU1CiYQk40KNHCcHfNiZbdlx1E9rpUp7bnF
lRa2v1ntMX3caRVDdbtPEWmdxSCYsYFDk4mZrOLBA4GEAAKBgEbmeve5f8LIE/Gf
MNmP9CM5eovQOGx5ho8WqD+aTebs+k2tn92BBPqeZqpWRa5P/+jrdKml1qx4llHW
MXrs3IgIb6+hUIB+S8dz8/mmO0bpr76RoZVCXYab2CZedFut7qc3WUH9+EUAH5mw
vSeDCOUMYQR7R9LINYwouHIziqQYMAkGByqGSM44BAMDLwAwLAIUWXBlk40xTwSw
7HX32MxXYruse9ACFBNGmdX2ZBrVNGrN9N2f6ROk0k9K
-----END CERTIFICATE-----
The AWS public certificate for Asia Pacific (Hong Kong) is as follows.
-----BEGIN CERTIFICATE-----
MIIC7zCCAq4CCQCO7MJe5Y3VLjAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTAyMDMwMjIxMjFaFw00
NTAyMDMwMjIxMjFaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQDvQ9RzVvf4MAwGbqfX
blCvCoVb9957OkLGn/04CowHXJ+vTBR7eyIa6AoXltsQXBOmrJswToFKKxT4gbuw
jK7s9QQX4CmTRWcEgO2RXtZSVjOhsUQMh+yf7Ht4OVL97LWnNfGsX2cwjcRWHYgI
7lvnuBNBzLQHdSEwMNq0Bk76PwIVAMan6XIEEPnwr4e6u/RNnWBGKd9FAoGBAOCG
eSNmxpW4QFu4pIlAykm6EnTZKKHT87gdXkAkfoC5fAfOxxhnE2HezZHp9Ap2tMV5
8bWNvoPHvoKCQqwfm+OUBlAxC/3vqoVkKL2mG1KgUH9+hrtpMTkwO3RREnKe7I5O
x9qDimJpOihrL4I0dYvy9xUOoz+DzFAW8+ylWVYpA4GFAAKBgQDbnBAKSxWr9QHY
6Dt+EFdGz6lAZLedeBKpaP53Z1DTO34J0C55YbJTwBTFGqPtOLxnUVDlGiD6GbmC
80f3jvogPR1mSmGsydbNbZnbUEVWrRhe+y5zJ3g9qs/DWmDW0deEFvkhWVnLJkFJ
9pdOu/ibRPH1lE2nz6pK7GbOQtLyHTAJBgcqhkjOOAQDAzAAMC0CFQCoJlwGtJQC
cLoM4p/jtVFOj26xbgIUUS4pDKyHaG/eaygLTtFpFJqzWHc=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
855
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
MIIC7jCCAq4CCQCVWIgSmP8RhTAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTAyMDUxMzA2MjFaFw00
NTAyMDUxMzA2MjFaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQDcwojQfgWdV1QliO0B
8n6cLZ38VE7ZmrjZ9OQV//Gst6S1h7euhC23YppKXi1zovefSDwFU54zi3/oJ++q
PHlP1WGL8IZ34BUgRTtG4TVolvp0smjkMvyRu5hIdKtzjV93Ccx15gVgyk+o1IEG
fZ2Kbw/Dd8JfoPS7KaSCmJKxXQIVAIZbIaDFRGa2qcMkW2HWASyNDl7bAoGBANtz
IdhfMq+l2I5iofY2oj3HI21Kj3LtZrWEg3W+/4rVhL3lTm0Nne1rl9yGujrjQwy5
Zp9V4A/w9w2O10Lx4K6hj34Eefy/aQnZwNdNhv/FQP7Az0fju+Yl6L13OOHQrL0z
Q+9cF7zEosekEnBQx3v6psNknKgD3Shgx+GO/LpCA4GFAAKBgQCVS7m77nuNAlZ8
wvUqcooxXMPkxJFl54NxAsAul9KP9KN4svm0O3Zrb7t2FOtXRM8zU3TqMpryq1o5
mpMPsZDg6RXo9BF7Hn0DoZ6PJTamkFA6md+NyTJWJKvXC7iJ8fGDBJqTciUHuCKr
12AztQ8bFWsrTgTzPE3p6U5ckcgV1TAJBgcqhkjOOAQDAy8AMCwCFB2NZGWm5EDl
86ayV3c1PEDukgQIAhQow38rQkN/VwHVeSW9DqEshXHjuQ==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIC7zCCAq+gAwIBAgIGAXjXhqnnMAkGByqGSM44BAMwXDELMAkGA1UEBhMCVVMx
GTAXBgNVBAgMEFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAe
BgNVBAoMF0FtYXpvbiBXZWIgU2VydmljZXMgTExDMB4XDTIxMDQxNTIxNTM1MFoX
DTQ3MDQxNTIxNTM1MFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdhc2hpbmd0
b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpvbiBXZWIg
U2VydmljZXMgTExDMIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9K
nC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00
b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNa
FpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA
9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJ
FnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7
zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAW+csuHsWp/7/
pv8CTKFwxsYudxuR6rbWaHCykIeAydXL9AWnphK6yp1ODEMBFl68Xq8Hp23sOWyf
8moOhqCom9+0+ovuUFdpvCie86bpEZW5G8QbGebFr1F/TOZU568Ty1ff3dDWbdRz
eNQRHodRG+XEQSizMkAreeWt4kBa+PUwCQYHKoZIzjgEAwMvADAsAhQD3Z+XGmzK
mgaLgGcVX/Qf1+Tn4QIUH1cgksBSVKbWj81tovBMJeKgdYo=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIC7DCCAqwCCQCncbCtQbjuyzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTA2MDQxMjQ4MDVaFw00
NTA2MDQxMjQ4MDVaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQC12Nr1gMrHcFSZ7S/A
pQBSCMHWmn2qeoQTMVWqe50fnTd0zGFxDdIjKxUK58/8zjWG5uR4TXRzmZpGpmXB
bSufAR6BGqud2LnT/HIWGJAsnX2uOtSyNfCoJigqwhea5w+CqZ6I7iBDdnB4TtTw
qO6TlnExHFVj8LMkylZgiaE1CQIVAIhdobse4K0QnbAhCL6R2euQzloXAoGAV/21
WUuMz/79Ga0JvQcz1FNy1sT0pU9rU4TenqLQIt5iccn/7EIfNtvVO5TZKulIKq7J
gXZr0x/KIT8zsNweetLOaGehPIYRMPX0vunMMR7hN7qA7W17WZv/76adywIsnDKq
ekfe15jinaX8MsKUdyDK7Y+ifCG4PVhoM4+W2XwDgYQAAoGAIxOKbVgwLxbn6Pi2
6hBOihFv16jKxAQI0hHzXJLV0Vyv9QwnqjJJRfOCy3dB0zicLXiIxeIdYfvqJr+u
hlN8rGxEZYYJjEUKMGvsc0DW85jonXz0bNfcP0aaKH0lKKVjL+OZi5n2kn9wgdo5
F3CVnMl8BUra8A1Tr2yrrE6TVZ4wCQYHKoZIzjgEAwMvADAsAhQfa7MCJZ+/TEY5
AUr0J4wm8VzjoAIUSYZVu2NdRJ/ERPmDfhW5EsjHlCA=
856
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
-----END CERTIFICATE-----
Europe (Milan)
-----BEGIN CERTIFICATE-----
MIIC7TCCAqwCCQCMElHPdwG37jAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTA0MjkyMDM1MjJaFw00
NTA0MjkyMDM1MjJaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDAkoL4YfdMI/MrQ0oL
NPfeEk94eiCQA5xNOnU7+2eVQtEqjFbDADFENh1p3sh9Q9OoheLFH8qpSfNDWn/0
ktCS909ApTY6Esx1ExjGSeQq/U+SC2JSuuTT4WFMKJ63a/czMtFkEPPnVIjJJJmT
HJSKSsVUgpdDIRvJXuyB0zdB+wIVALQ3OLaVGdlPMNfS1nD/Yyn+32wnAoGAPBQ3
7XHg5NLOS4326eFRUT+4ornQFjJjP6dp3pOBEzpImNmZTtkCNNUKE4Go9hv5T4lh
R0pODvWv0CBupMAZVBP9ObplXPCyEIZtuDqVa7ukPOUpQNgQhLLAqkigTyXVOSmt
ECBj9tu5WNP/x3iTZTHJ+g0rhIqpgh012UwJpKADgYQAAoGAV1OEQPYQUg5/M3xf
6vE7jKTxxyFWEyjKfJK7PZCzOIGrE/swgACy4PYQW+AwcUweSlK/Hx2OaZVUKzWo
wDUbeu65DcRdw2rSwCbBTU342sitFo/iGCV/Gjf+BaiAJtxniZze7J1ob8vOBeLv
uaMQmgOYeZ5e0fl04GtqPl+lhcQwCQYHKoZIzjgEAwMwADAtAhQdoeWLrkm0K49+
AeBK+j6m2h9SKQIVAIBNhS2a8cQVABDCQXVXrc0tOmO8
-----END CERTIFICATE-----
Europe (Spain)
Europe (Zurich)
857
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJ
FnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7
zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAYNjaCNg/cfgQ
Ol1BUj5ClUulqwZ9Q+SfDzPZh9D2C0VbiRANiZoxrV8RdgmzzC5T7VcriVwjwvta
2Ch//b+sZ86E5h0XWWr+BeEjD9cu3eDj12XB5sWEbNHNx49p5Tmtu5r2LDtlL8X/
Rpfalu2Z2OJgjFJWGf7hRwxe456n+lowCQYHKoZIzjgEAwMvADAsAhRChsLcj4U5
CVb2cp5M0RE1XbXmhAIUeGSnH+aiUQIWmPEFja+itWDufIk=
-----END CERTIFICATE-----" >> certificate
-----BEGIN CERTIFICATE-----
MIIC8DCCArCgAwIBAgIGAXbVDEikMAkGByqGSM44BAMwXDELMAkGA1UEBhMCVVMx
GTAXBgNVBAgMEFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAe
BgNVBAoMF0FtYXpvbiBXZWIgU2VydmljZXMgTExDMB4XDTIxMDEwNjAwMTUyMFoX
DTQ3MDEwNjAwMTUyMFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdhc2hpbmd0
b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpvbiBXZWIg
U2VydmljZXMgTExDMIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9K
nC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00
b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNa
FpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA
9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJ
FnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7
zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAPjuiEx05N3J
Q6cVwntJie67D8OuNo4jGRn+crEtL7YO0jSVB9zGE1ga+UgRPIaYETL293S8rTJT
VgXAqdpBwfaHC6NUzre8U8iJ8FMNnlP9Gw1oUIlgQBjORyynVJexoB31TDZM+/52
g9O/bpq1QqNyKbeIgyBBlc1dAtr1QLnsMAkGByqGSM44BAMDLwAwLAIUK8E6RDIR
twK+9qnaTOBhvO/njuQCFFocyT1OxK+UDR888oNsdgtif2Sf
-----END CERTIFICATE-----
858
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
BgNVBAoMF0FtYXpvbiBXZWIgU2VydmljZXMgTExDMB4XDTIxMDQxOTE3NTI1NloX
DTQ3MDQxOTE3NTI1NlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdhc2hpbmd0
b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpvbiBXZWIg
U2VydmljZXMgTExDMIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9K
nC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00
b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNa
FpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA
9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJ
FnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7
zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAJCKGBBoxIUx
qBk94JHhwZZbgvbP0DAOoHENQWxp/98lI7/YOfYJOVMJS22aCnHDurofmo5rvNIk
gXi7Rztbhu+lko9rK6DgpmpUwBU0WZtf34aZ2IWNBwHaVhHvWAQf9/46u18dMa2Y
ucK1Wi+Vc+M+KldrvgXmhym6ErNlzhJyMAkGByqGSM44BAMDLwAwLAIUaaPKxaOH
oYvwz709xXpsQueIq+UCFFa/GpzoDOSokl1057NU/2hnsiW4
-----END CERTIFICATE-----" >> certificate
China
The AWS public certificate for China (Beijing) and China (Ningxia) is as follows.
-----BEGIN CERTIFICATE-----
MIIDNjCCAh4CCQD3yZ1w1AVkTzANBgkqhkiG9w0BAQsFADBcMQswCQYDVQQGEwJV
UzEZMBcGA1UECBMQV2FzaGluZ3RvbiBTdGF0ZTEQMA4GA1UEBxMHU2VhdHRsZTEg
MB4GA1UEChMXQW1hem9uIFdlYiBTZXJ2aWNlcyBMTEMwIBcNMTUwNTEzMDk1OTE1
WhgPMjE5NDEwMTYwOTU5MTVaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNo
aW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24g
V2ViIFNlcnZpY2VzIExMQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AMWk9vyppSmDU3AxZ2Cy2bvKeK3F1UqNpMuyeriizi+NTsZ8tQqtNloaQcqhto/l
gsw9+QSnEJeYWnmivJWOBdn9CyDpN7cpHVmeGgNJL2fvImWyWe2f2Kq/BL9l7N7C
P2ZT52/sH9orlck1n2zO8xPi7MItgPHQwu3OxsGQsAdWucdxjHGtdchulpo1uJ31
jsTAPKZ3p1/sxPXBBAgBMatPHhRBqhwHO/Twm4J3GmTLWN7oVDds4W3bPKQfnw3r
vtBj/SM4/IgQ3xJslFcl90TZbQbgxIi88R/gWTbs7GsyT2PzstU30yLdJhKfdZKz
/aIzraHvoDTWFaOdy0+OOaECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAdSzN2+0E
V1BfR3DPWJHWRf1b7zl+1X/ZseW2hYE5r6YxrLv+1VPf/L5I6kB7GEtqhZUqteY7
zAceoLrVu/7OynRyfQetJVGichaaxLNM3lcr6kcxOowb+WQQ84cwrB3keykH4gRX
KHB2rlWSxta+2panSEO1JX2q5jhcFP90rDOtZjlpYv57N/Z9iQ+dvQPJnChdq3BK
5pZlnIDnVVxqRike7BFy8tKyPj7HzoPEF5mh9Kfnn1YoSVu+61lMVv/qRjnyKfS9
c96nE98sYFj0ZVBzXw8Sq4Gh8FiVmFHbQp1peGC19idOUqxPxWsasWxQXO0azYsP
9RyWLHKxH1dMuA==
-----END CERTIFICATE-----
5. Extract the certificate from the certificate file and store it in a variable named $Store.
PS C:\> $Store =
[Security.Cryptography.X509Certificates.X509Certificate2Collection]::new([Security.Cryptography.X5
Path certificate.pem)))
PS C:\> $SignatureDocument.Decode($Signature)
If the signature is valid, the command returns no output. If the signature cannot be verified, the
command returns Exception calling "CheckSignature" with "2" argument(s):
"Cannot find the original signer. If your signature cannot be verified, contact AWS
Support.
859
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
PS C:
\> [Linq.Enumerable]::SequenceEqual($SignatureDocument.ContentInfo.Content, $Document)
If the content of the instance identity document is valid, the command returns True. If instance
identity document cannot be validated, contact AWS Support.
To validate the instance identity document using the base64-encoded signature and the AWS
RSA public certificate
IMDSv2
IMDSv1
3. Retrieve the plaintext instance identity document from the instance metadata, convert it to a byte
array, and add it to a variable named $Document. Use one of the following commands depending
on the IMDS version used by the instance.
IMDSv2
IMDSv1
4. Add one of the following AWS RSA public certificates to a new file named certificate.pem,
depending on the Region of your instance.
860
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
The following AWS public certificate is for all AWS Regions, except Hong Kong, Bahrain, UAE,
Cape Town, Milan, Spain, Zurich, Jakarta, Melbourne, Hyderabad, China, and GovCloud.
-----BEGIN CERTIFICATE-----
MIIDIjCCAougAwIBAgIJAKnL4UEDMN/FMA0GCSqGSIb3DQEBBQUAMGoxCzAJBgNV
BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRgw
FgYDVQQKEw9BbWF6b24uY29tIEluYy4xGjAYBgNVBAMTEWVjMi5hbWF6b25hd3Mu
Y29tMB4XDTE0MDYwNTE0MjgwMloXDTI0MDYwNTE0MjgwMlowajELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxGDAWBgNV
BAoTD0FtYXpvbi5jb20gSW5jLjEaMBgGA1UEAxMRZWMyLmFtYXpvbmF3cy5jb20w
gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIe9GN//SRK2knbjySG0ho3yqQM3
e2TDhWO8D2e8+XZqck754gFSo99AbT2RmXClambI7xsYHZFapbELC4H91ycihvrD
jbST1ZjkLQgga0NE1q43eS68ZeTDccScXQSNivSlzJZS8HJZjgqzBlXjZftjtdJL
XeE4hwvo0sD4f3j9AgMBAAGjgc8wgcwwHQYDVR0OBBYEFCXWzAgVyrbwnFncFFIs
77VBdlE4MIGcBgNVHSMEgZQwgZGAFCXWzAgVyrbwnFncFFIs77VBdlE4oW6kbDBq
MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh
dHRsZTEYMBYGA1UEChMPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQDExFlYzIuYW1h
em9uYXdzLmNvbYIJAKnL4UEDMN/FMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF
BQADgYEAFYcz1OgEhQBXIwIdsgCOS8vEtiJYF+j9uO6jz7VOmJqO+pRlAbRlvY8T
C1haGgSI/A1uZUKs/Zfnph0oEI0/hu1IIJ/SKBDtN5lvmZ/IzbOPIJWirlsllQIQ
7zvWbGd9c9+Rm3p04oTvhup99la7kZqevJK0QRdD/6NpCKsqP/0=
-----END CERTIFICATE-----
The AWS public certificate for Asia Pacific (Hong Kong) is as follows.
-----BEGIN CERTIFICATE-----
MIICSzCCAbQCCQDtQvkVxRvK9TANBgkqhkiG9w0BAQsFADBqMQswCQYDVQQGEwJV
UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEYMBYGA1UE
ChMPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQDExFlYzIuYW1hem9uYXdzLmNvbTAe
Fw0xOTAyMDMwMzAwMDZaFw0yOTAyMDIwMzAwMDZaMGoxCzAJBgNVBAYTAlVTMRMw
EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRgwFgYDVQQKEw9B
bWF6b24uY29tIEluYy4xGjAYBgNVBAMTEWVjMi5hbWF6b25hd3MuY29tMIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1kkHXYTfc7gY5Q55JJhjTieHAgacaQkiR
Pity9QPDE3b+NXDh4UdP1xdIw73JcIIG3sG9RhWiXVCHh6KkuCTqJfPUknIKk8vs
M3RXflUpBe8Pf+P92pxqPMCz1Fr2NehS3JhhpkCZVGxxwLC5gaG0Lr4rFORubjYY
Rh84dK98VwIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAA6xV9f0HMqXjPHuGILDyaNN
dKcvplNFwDTydVg32MNubAGnecoEBtUPtxBsLoVYXCOb+b5/ZMDubPF9tU/vSXuo
TpYM5Bq57gJzDRaBOntQbX9bgHiUxw6XZWaTS/6xjRJDT5p3S1E0mPI3lP/eJv4o
Ezk5zb3eIf10/sqt4756
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDPDCCAqWgAwIBAgIJAMl6uIV/zqJFMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNV
BAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMSAw
HgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzEaMBgGA1UEAwwRZWMyLmFt
YXpvbmF3cy5jb20wIBcNMTkwNDI2MTQzMjQ3WhgPMjE5ODA5MjkxNDMyNDdaMHIx
CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0
dGxlMSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzEaMBgGA1UEAwwR
ZWMyLmFtYXpvbmF3cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALVN
CDTZEnIeoX1SEYqq6k1BV0ZlpY5y3KnoOreCAE589TwS4MX5+8Fzd6AmACmugeBP
Qk7Hm6b2+g/d4tWycyxLaQlcq81DB1GmXehRkZRgGeRge1ePWd1TUA0I8P/QBT7S
gUePm/kANSFU+P7s7u1NNl+vynyi0wUUrw7/wIZTAgMBAAGjgdcwgdQwHQYDVR0O
BBYEFILtMd+T4YgH1cgc+hVsVOV+480FMIGkBgNVHSMEgZwwgZmAFILtMd+T4YgH
861
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
1cgc+hVsVOV+480FoXakdDByMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGlu
Z3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEgMB4GA1UECgwXQW1hem9uIFdlYiBTZXJ2
aWNlcyBMTEMxGjAYBgNVBAMMEWVjMi5hbWF6b25hd3MuY29tggkAyXq4hX/OokUw
DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBhkNTBIFgWFd+ZhC/LhRUY
4OjEiykmbEp6hlzQ79T0Tfbn5A4NYDI2icBP0+hmf6qSnIhwJF6typyd1yPK5Fqt
NTpxxcXmUKquX+pHmIkK1LKDO8rNE84jqxrxRsfDi6by82fjVYf2pgjJW8R1FAw+
mL5WQRFexbfB5aXhcMo0AA==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXjRrnDjMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTA0MTQxODM5
MzNaGA8yMjAwMDQxNDE4MzkzM1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDc
aTgW/KyA6zyruJQrYy00a6wqLA7eeUzk3bMiTkLsTeDQfrkaZMfBAjGaaOymRo1C
3qzE4rIenmahvUplu9ZmLwL1idWXMRX2RlSvIt+d2SeoKOKQWoc2UOFZMHYxDue7
zkyk1CIRaBukTeY13/RIrlc6X61zJ5BBtZXlHwayjQIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBABTqTy3R6RXKPW45FA+cgo7YZEj/Cnz5YaoUivRRdX2A83BHuBTvJE2+
WX00FTEj4hRVjameE1nENoO8Z7fUVloAFDlDo69fhkJeSvn51D1WRrPnoWGgEfr1
+OfK1bAcKTtfkkkP9r4RdwSjKzO5Zu/B+Wqm3kVEz/QNcz6npmA6
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICNjCCAZ+gAwIBAgIJAKumfZiRrNvHMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xOTExMjcw
NzE0MDVaGA8yMTk5MDUwMjA3MTQwNVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
gQDFd571nUzVtke3rPyRkYfvs3jh0C0EMzzG72boyUNjnfw1+m0TeFraTLKb9T6F
7TuB/ZEN+vmlYqr2+5Va8U8qLbPF0bRH+FdaKjhgWZdYXxGzQzU3ioy5W5ZM1VyB
7iUsxEAlxsybC3ziPYaHI42UiTkQNahmoroNeqVyHNnBpQIDAQABMA0GCSqGSIb3
DQEBCwUAA4GBAAJLylWyElEgOpW4B1XPyRVD4pAds8Guw2+krgqkY0HxLCdjosuH
RytGDGN+q75aAoXzW5a7SGpxLxk6Hfv0xp3RjDHsoeP0i1d8MD3hAC5ezxS4oukK
s5gbPOnokhKTMPXbTdRn5ZifCbWlx+bYN/mTYKvxho7b5SVg2o1La9aK
-----END CERTIFICATE-----
Europe (Milan)
-----BEGIN CERTIFICATE-----
MIICNjCCAZ+gAwIBAgIJAOZ3GEIaDcugMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xOTEwMjQx
NTE5MDlaGA8yMTk5MDMyOTE1MTkwOVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
gQCjiPgW3vsXRj4JoA16WQDyoPc/eh3QBARaApJEc4nPIGoUolpAXcjFhWplo2O+
ivgfCsc4AU9OpYdAPha3spLey/bhHPRi1JZHRNqScKP0hzsCNmKhfnZTIEQCFvsp
DRp4zr91/WS06/flJFBYJ6JHhp0KwM81XQG59lV6kkoW7QIDAQABMA0GCSqGSIb3
DQEBCwUAA4GBAGLLrY3P+HH6C57dYgtJkuGZGT2+rMkk2n81/abzTJvsqRqGRrWv
862
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
XRKRXlKdM/dfiuYGokDGxiC0Mg6TYy6wvsR2qRhtXW1OtZkiHWcQCnOttz+8vpew
wx8JGMvowtuKB1iMsbwyRqZkFYLcvH+Opfb/Aayi20/ChQLdI6M2R5VU
-----END CERTIFICATE-----
Europe (Spain)
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXjwLkiaMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTA0MjAxNjQ3
NDhaGA8yMjAwMDQyMDE2NDc0OFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB
/VvR1+45Aey5zn3vPk6xBm5o9grSDL6D2iAuprQnfVXn8CIbSDbWFhA3fi5ippjK
kh3sl8VyCvCOUXKdOaNrYBrPRkrdHdBuL2Tc84RO+3m/rxIUZ2IK1fDlC6sWAjdd
f6sBrV2w2a78H0H8EwuwiSgttURBjwJ7KPPJCqaqrQIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBAKR+FzqQDzun/iMMzcFucmLMl5BxEblrFXOz7IIuOeiGkndmrqUeDCyk
ztLku45s7hxdNy4ltTuVAaE5aNBdw5J8U1mRvsKvHLy2ThH6hAWKwTqtPAJp7M21
GDwgDDOkPSz6XVOehg+hBgiphYp84DUbWVYeP8YqLEJSqscKscWC
-----END CERTIFICATE-----
Europe (Zurich)
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXjSGFGiMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTA0MTQyMDM1
MTJaGA8yMjAwMDQxNDIwMzUxMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2
mdGdps5Rz2jzYcGNsgETTGUthJRrVqSnUWJXTlVaIbkGPLKO6Or7AfWKFp2sgRJ8
vLsjoBVR5cESVK7cuK1wItjvJyi/opKZAUusJx2hpgU3pUHhlp9ATh/VeVD582jT
d9IY+8t5MDa6Z3fGliByEiXz0LEHdi8MBacLREu1TwIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBAILlpoE3k9o7KdALAxsFJNitVS+g3RMzdbiFM+7MA63Nv5fsf+0xgcjS
NBElvPCDKFvTJl4QQhToy056llO5GvdS9RK+H8xrP2mrqngApoKTApv93vHBixgF
Sn5KrczRO0YSm3OjkqbydU7DFlmkXXR7GYE+5jbHvQHYiT1J5sMu
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXbVDG2yMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTAxMDYwMDE1
MzBaGA8yMjAwMDEwNjAwMTUzMFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCn
CS/Vbt0gQ1ebWcur2hSO7PnJifE4OPxQ7RgSAlc4/spJp1sDP+ZrS0LO1ZJfKhXf
1R9S3AUwLnsc7b+IuVXdY5LK9RKqu64nyXP5dx170zoL8loEyCSuRR2fs+04i2Qs
WBVP+KFNAn7P5L1EHRjkgTO8kjNKviwRV+OkP9ab5wIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBAI4WUy6+DKh0JDSzQEZNyBgNlSoSuC2owtMxCwGB6nBfzzfcekWvs6eo
fLTSGovrReX7MtVgrcJBZjmPIentw5dWUs+87w/g9lNwUnUt0ZHYyh2tuBG6hVJu
UEwDJ/z3wDd6wQviLOTF3MITawt9P8siR1hXqLJNxpjRQFZrgHqi
-----END CERTIFICATE-----
863
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXjSh40SMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTA0MTQyMjM2
NDJaGA8yMjAwMDQxNDIyMzY0MlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDH
ezwQr2VQpQSTW5TXNefiQrP+qWTGAbGsPeMX4hBMjAJUKys2NIRcRZaLM/BCew2F
IPVjNtlaj6Gwn9ipU4Mlz3zIwAMWi1AvGMSreppt+wV6MRtfOjh0Dvj/veJe88aE
ZJMozNgkJFRS+WFWsckQeL56tf6kY6QTlNo8V/0CsQIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBAF7vpPghH0FRo5gu49EArRNPrIvW1egMdZHrzJNqbztLCtV/wcgkqIww
uXYj+1rhlL+/iMpQWjdVGEqIZSeXn5fLmdx50eegFCwND837r9e8XYTiQS143Sxt
9+Yi6BZ7U7YD8kK9NBWoJxFqUeHdpRCs0O7COjT3gwm7ZxvAmssh
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICMzCCAZygAwIBAgIGAXjwLj9CMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNVBAYT
AlVTMRkwFwYDVQQIDBBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHDAdTZWF0dGxl
MSAwHgYDVQQKDBdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMTA0MjAxNjQ3
NDVaGA8yMjAwMDQyMDE2NDc0NVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgMEFdh
c2hpbmd0b24gU3RhdGUxEDAOBgNVBAcMB1NlYXR0bGUxIDAeBgNVBAoMF0FtYXpv
biBXZWIgU2VydmljZXMgTExDMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDT
wHu0ND+sFcobrjvcAYm0PNRD8f4R1jAzvoLt2+qGeOTAyO1Httj6cmsYN3AP1hN5
iYuppFiYsl2eNPa/CD0Vg0BAfDFlV5rzjpA0j7TJabVh4kj7JvtD+xYMi6wEQA4x
6SPONY4OeZ2+8o/HS8nucpWDVdPRO6ciWUlMhjmDmwIDAQABMA0GCSqGSIb3DQEB
BQUAA4GBAAy6sgTdRkTqELHBeWj69q60xHyUmsWqHAQNXKVc9ApWGG4onzuqlMbG
ETwUZ9mTq2vxlV0KvuetCDNS5u4cJsxe/TGGbYP0yP2qfMl0cCImzRI5W0gn8gog
dervfeT7nH5ih0TWEy/QDWfkQ601L4erm4yh4YQq8vcqAPSkf04N
-----END CERTIFICATE-----
China
The AWS public certificate for China (Beijing) and China (Ningxia) is as follows.
-----BEGIN CERTIFICATE-----
MIICSzCCAbQCCQCQu97teKRD4zANBgkqhkiG9w0BAQUFADBqMQswCQYDVQQGEwJV
UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEYMBYGA1UE
ChMPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQDExFlYzIuYW1hem9uYXdzLmNvbTAe
Fw0xMzA4MjExMzIyNDNaFw0yMzA4MjExMzIyNDNaMGoxCzAJBgNVBAYTAlVTMRMw
EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRgwFgYDVQQKEw9B
bWF6b24uY29tIEluYy4xGjAYBgNVBAMTEWVjMi5hbWF6b25hd3MuY29tMIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6GFQ2WoBl1xZYH85INUMaTc4D30QXM6f+
YmWZyJD9fC7Z0UlaZIKoQATqCO58KNCre+jECELYIX56Uq0lb8LRLP8tijrQ9Sp3
qJcXiH66kH0eQ44a5YdewcFOy+CSAYDUIaB6XhTQJ2r7bd4A2vw3ybbxTOWONKdO
WtgIe3M3iwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAHzQC5XZVeuD9GTJTsbO5AyH
ZQvki/jfARNrD9dgBRYZzLC/NOkWG6M9wlrmks9RtdNxc53nLxKq4I2Dd73gI0yQ
wYu9YYwmM/LMgmPlI33Rg2Ohwq4DVgT3hO170PL6Fsgiq3dMvctSImJvjWktBQaT
bcAgaZLHGIpXPrWSA2d+
-----END CERTIFICATE-----
864
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
The AWS public certificate for AWS GovCloud (US-East) and AWS GovCloud (US-West) is as
follows.
-----BEGIN CERTIFICATE-----
MIIDCzCCAnSgAwIBAgIJAIe9Hnq82O7UMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0yMTA3MTQx
NDI3NTdaFw0yNDA3MTMxNDI3NTdaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
qaIcGFFTx/SO1W5G91jHvyQdGP25n1Y91aXCuOOWAUTvSvNGpXrI4AXNrQF+CmIO
C4beBASnHCx082jYudWBBl9Wiza0psYc9flrczSzVLMmN8w/c78F/95NfiQdnUQP
pvgqcMeJo82cgHkLR7XoFWgMrZJqrcUK0gnsQcb6kakCAwEAAaOB1DCB0TALBgNV
HQ8EBAMCB4AwHQYDVR0OBBYEFNWV53gWJz72F5B1ZVY4O/dfFYBPMIGOBgNVHSME
gYYwgYOAFNWV53gWJz72F5B1ZVY4O/dfFYBPoWCkXjBcMQswCQYDVQQGEwJVUzEZ
MBcGA1UECBMQV2FzaGluZ3RvbiBTdGF0ZTEQMA4GA1UEBxMHU2VhdHRsZTEgMB4G
A1UEChMXQW1hem9uIFdlYiBTZXJ2aWNlcyBMTEOCCQCHvR56vNju1DASBgNVHRMB
Af8ECDAGAQH/AgEAMA0GCSqGSIb3DQEBCwUAA4GBACrKjWj460GUPZCGm3/z0dIz
M2BPuH769wcOsqfFZcMKEysSFK91tVtUb1soFwH4/Lb/T0PqNrvtEwD1Nva5k0h2
xZhNNRmDuhOhW1K9wCcnHGRBwY5t4lYL6hNV6hcrqYwGMjTjcAjBG2yMgznSNFle
Rwi/S3BFXISixNx9cILu
-----END CERTIFICATE-----
PS C:\> [Security.Cryptography.X509Certificates.X509Certificate2]::new((Resolve-
Path certificate.pem)).PublicKey.Key.VerifyData($Document, 'SHA256', $Signature)
If the signature is valid, the command returns True. If the signature cannot be verified, contact AWS
Support.
Prerequisites
This procedure requires the System.Security Microsoft .NET Core class. To add the class to your
PowerShell session, run the following command.
Note
The command adds the class to the current PowerShell session only. If you start a new session,
you must run the command again.
To verify the instance identity document using the RSA-2048 signature and the AWS
RSA-2048 public certificate
865
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
IMDSv2
IMDSv1
3. Retrieve the plaintext instance identity document from the instance metadata, convert it to a byte
array, and add it to a variable named $Document. Use one of the following commands depending
on the IMDS version used by the instance.
IMDSv2
IMDSv1
4. Create a new file named certificate.pem and add one of the following AWS RSA-2048 public
certificates, depending on your Region.
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJALFpzEAVWaQZMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQw
ODU5MTJaGA8yMTk1MDExNzA4NTkxMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAjS2vqZu9mEOhOq+0bRpAbCUiapbZMFNQqRg7kTlr7Cf+gDqXKpHPjsng
SfNz+JHQd8WPI+pmNs+q0Z2aTe23klmf2U52KH9/j1k8RlIbap/yFibFTSedmegX
E5r447GbJRsHUmuIIfZTZ/oRlpuIIO5/Vz7SOj22tdkdY2ADp7caZkNxhSP915fk
2jJMTBUOzyXUS2rBU/ulNHbTTeePjcEkvzVYPahD30TeQ+/A+uWUu89bHSQOJR8h
Um4cFApzZgN3aD5j2LrSMu2pctkQwf9CaWyVznqrsGYjYOY66LuFzSCXwqSnFBfv
fFBAFsjCgY24G2DoMyYkF3MyZlu+rwIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUrynSPp4uqSECwy+PiO4qyJ8TWSkwgY4GA1UdIwSBhjCBg4AUrynS
Pp4uqSECwy+PiO4qyJ8TWSmhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJALFpzEAVWaQZMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBADW/s8lXijwdP6NkEoH1m9XLrvK4YTqkNfR6
er/uRRgTx2QjFcMNrx+g87gAml11z+D0crAZ5LbEhDMs+JtZYR3ty0HkDk6SJM85
haoJNAFF7EQ/zCp1EJRIkLLsC7bcDL/Eriv1swt78/BB4RnC9W9kSp/sxd5svJMg
N9a6FAplpNRsWAnbP8JBlAP93oJzblX2LQXgykTghMkQO7NaY5hg/H5o4dMPclTK
866
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
lYGqlFUCH6A2vdrxmpKDLmTn5//5pujdD2MN0df6sZWtxwZ0osljV4rDjm9Q3VpA
NWIsDEcp3GUB4proOR+C7PNkY+VGODitBOw09qBGosCBstwyEqY=
-----END CERTIFICATE-----
• US East (Ohio)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAM07oeX4xevdMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNjA2MTAx
MjU4MThaGA8yMTk1MTExNDEyNTgxOFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA6v6kGMnRmFDLxBEqXzP4npnL65OO0kmQ7w8YXQygSdmNIoScGSU5wfh9
mZdcvCxCdxgALFsFqPvH8fqiE9ttI0fEfuZvHOs8wUsIdKr0Zz0MjSx3cik4tKET
ch0EKfMnzKOgDBavraCDeX1rUDU0Rg7HFqNAOry3uqDmnqtk00XC9GenS3z/7ebJ
fIBEPAam5oYMVFpX6M6St77WdNE8wEU8SuerQughiMVx9kMB07imeVHBiELbMQ0N
lwSWRL/61fA02keGSTfSp/0m3u+lesf2VwVFhqIJs+JbsEscPxOkIRlzy8mGd/JV
ONb/DQpTedzUKLgXbw7KtO3HTG9iXQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU2CTGYE5fTjx7gQXzdZSGPEWAJY4wgY4GA1UdIwSBhjCBg4AU2CTG
YE5fTjx7gQXzdZSGPEWAJY6hYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAM07oeX4xevdMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBANdqkIpVypr2PveqUsAKke1wKCOSuw1UmH9k
xX1/VRoHbrI/UznrXtPQOPMmHA2LKSTedwsJuorUn3cFH6qNs8ixBDrl8pZwfKOY
IBJcTFBbI1xBEFkZoO3wczzo5+8vPQ60RVqAaYb+iCa1HFJpccC3Ovajfa4GRdNb
n6FYnluIcDbmpcQePoVQwX7W3oOYLB1QLN7fE6H1j4TBIsFdO3OuKzmaifQlwLYt
DVxVCNDabpOr6Uozd5ASm4ihPPoEoKo7Ilp0fOT6fZ41U2xWA4+HF/89UoygZSo7
K+cQ90xGxJ+gmlYbLFR5rbJOLfjrgDAb2ogbFy8LzHo2ZtSe60M=
-----END CERTIFICATE-----
• US West (Oregon)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJALZL3lrQCSTMMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQw
OTAxMzJaGA8yMTk1MDExNzA5MDEzMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA02Y59qtAA0a6uzo7nEQcnJ26OKF+LRPwZfixBH+EbEN/Fx0gYy1jpjCP
s5+VRNg6/WbfqAsV6X2VSjUKN59ZMnMY9ALA/Ipz0n00Huxj38EBZmX/NdNqKm7C
qWu1q5kmIvYjKGiadfboU8wLwLcHo8ywvfgI6FiGGsEO9VMC56E/hL6Cohko11LW
dizyvRcvg/IidazVkJQCN/4zC9PUOVyKdhW33jXy8BTg/QH927QuNk+ZzD7HH//y
tIYxDhR6TIZsSnRjz3bOcEHxt1nsidc65mY0ejQty4hy7ioSiapw316mdbtE+RTN
fcH9FPIFKQNBpiqfAW5Ebp3Lal3/+wIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU7coQx8Qnd75qA9XotSWT3IhvJmowgY4GA1UdIwSBhjCBg4AU7coQ
x8Qnd75qA9XotSWT3IhvJmqhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJALZL3lrQCSTMMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAFZ1e2MnzRaXCaLwEC1pW/f0oRG8nHrlPZ9W
OYZEWbh+QanRgaikBNDtVTwARQcZm3z+HWSkaIx3cyb6vM0DSkZuiwzm1LJ9rDPc
aBm03SEt5v8mcc7sXWvgFjCnUpzosmky6JheCD4O1Cf8k0olZ93FQnTrbg62OK0h
83mGCDeVKU3hLH97FYoUq+3N/IliWFDhvibAYYKFJydZLhIdlCiiB99AM6Sg53rm
oukS3csyUxZyTU2hQfdjyo1nqW9yhvFAKjnnggiwxNKTTPZzstKW8+cnYwiiTwJN
QpVoZdt0SfbuNnmwRUMi+QbuccXweav29QeQ3ADqjgB0CZdSRKk=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJANNPkIpcyEtIMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTEwMjkw
867
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
OTAzMDdaGA8yMTk1MDQwMzA5MDMwN1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEApHQGvHvq3SVCzDrC7575BW7GWLzcj8CLqYcL3YY7Jffupz7OjcftO57Z
4fo5Pj0CaS8DtPzh8+8vdwUSMbiJ6cDd3ooio3MnCq6DwzmsY+pY7CiI3UVG7KcH
4TriDqr1Iii7nB5MiPJ8wTeAqX89T3SYaf6Vo+4GCb3LCDGvnkZ9TrGcz2CHkJsj
AIGwgopFpwhIjVYm7obmuIxSIUv+oNH0wXgDL029Zd98SnIYQd/njiqkzE+lvXgk
4h4Tu17xZIKBgFcTtWPky+POGu81DYFqiWVEyR2JKKm2/iR1dL1YsT39kbNg47xY
aR129sS4nB5Vw3TRQA2jL0ToTIxzhQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUgepyiONs8j+q67dmcWu+mKKDa+gwgY4GA1UdIwSBhjCBg4AUgepy
iONs8j+q67dmcWu+mKKDa+ihYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJANNPkIpcyEtIMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAGLFWyutf1u0xcAc+kmnMPqtc/Q6b79VIX0E
tNoKMI2KR8lcV8ZElXDb0NC6v8UeLpe1WBKjaWQtEjL1ifKg9hdY9RJj4RXIDSK7
33qCQ8juF4vep2U5TTBd6hfWxt1Izi88xudjixmbpUU4YKr8UPbmixldYR+BEx0u
B1KJi9l1lxvuc/Igy/xeHOAZEjAXzVvHp8Bne33VVwMiMxWECZCiJxE4I7+Y6fqJ
pLLSFFJKbNaFyXlDiJ3kXyePEZSc1xiWeyRB2ZbTi5eu7vMG4i3AYWuFVLthaBgu
lPfHafJpj/JDcqt2vKUKfur5edQ6j1CGdxqqjawhOTEqcN8m7us=
-----END CERTIFICATE-----
• Canada (Central)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAJNKhJhaJOuMMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNjA3Mjkx
MTM3MTdaGA8yMTk2MDEwMjExMzcxN1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAhDUh6j1ACSt057nSxAcwMaGr8Ez87VA2RW2HyY8l9XoHndnxmP50Cqld
+26AJtltlqHpI1YdtnZ6OrVgVhXcVtbvte0lZ3ldEzC3PMvmISBhHs6A3SWHA9ln
InHbToLX/SWqBHLOX78HkPRaG2k0COHpRy+fG9gvz8HCiQaXCbWNFDHZev9OToNI
xhXBVzIa3AgUnGMalCYZuh5AfVRCEeALG60kxMMC8IoAN7+HG+pMdqAhJxGUcMO0
LBvmTGGeWhi04MUZWfOkwn9JjQZuyLg6B1OD4Y6s0LB2P1MovmSJKGY4JcF8Qu3z
xxUbl7Bh9pvzFR5gJN1pjM2n3gJEPwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAJ
UNKM+gIIHNk0G0tzv6vZBT+o/vt+tIp8lEoZwaPQh1121iw/I7ZvhMLAigx7eyvf
IxUt9/nf8pxWaeGzi98RbSmbap+uxYRynqe1p5rifTamOsguuPrhVpl12OgRWLcT
rjg/K60UMXRsmg2w/cxV45pUBcyVb5h6Op5uEVAVq+CVns13ExiQL6kk3guG4+Yq
LvP1p4DZfeC33a2Rfre2IHLsJH5D4SdWcYqBsfTpf3FQThH0l0KoacGrXtsedsxs
9aRd7OzuSEJ+mBxmzxSjSwM84Ooh78DjkdpQgv967p3d+8NiSLt3/n7MgnUy6WwB
KtDujDnB+ttEHwRRngX7
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAMcyoxx4U0xxMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQw
ODU4MDJaGA8yMTk1MDExNzA4NTgwMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAw45IhGZVbQcy1fHBqzROhO8CsrDzxj/WP4cRbJo/2DAnimVrCCDs5O86
FA39Zo1xsDuJHDlwMKqeXYXkJXHYbcPWc6EYYAnR+PlLG+aNSOGUzsy202S03hT0
B20hWPCqpPp39itIRhG4id6nbNRJOzLm6evHuepMAHR4/OV7hyGOiGaV/v9zqiNA
pMCLhbh2xk0PO35HCVBuWt3HUjsgeks2eEsu9Ws6H3JXTCfiqp0TjyRWapM29OhA
cRJfJ/d/+wBTz1fkWOZ7TF+EWRIN5ITEadlDTPnF1r8kBRuDcS/lIGFwrOOHLo4C
cKoNgXkhTqDDBDu6oNBb2rS0K+sz3QIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUqBy7D847Ya/w321Dfr+rBJGsGTwwgY4GA1UdIwSBhjCBg4AUqBy7
D847Ya/w321Dfr+rBJGsGTyhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
868
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAMcyoxx4U0xxMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBACOoWSBf7b9AlcNrl4lr3QWWSc7k90/tUZal
PlT0G3Obl2x9T/ZiBsQpbUvs0lfotG0XqGVVHcIxF38EbVwbw9KJGXbGSCJSEJkW
vGCtc/jYMHXfhx67Szmftm/MTYNvnzsyQQ3v8y3Rdah+xe1NPdpFrwmfL6xe3pFF
cY33KdHA/3PNLdn9CaEsHmcmj3ctaaXLFIzZhQyyjtsrgGfTLvXeXRokktvsLDS/
YgKedQ+jFjzVJqgr4NjfY/Wt7/8kbbdhzaqlB5pCPjLLzv0zp/XmO6k+JvOePOGh
JzGk5t1QrSju+MqNPFk3+1O7o910Vrhqw1QRB0gr1ExrviLbyfU=
-----END CERTIFICATE-----
• Europe (Frankfurt)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAKD+v6LeR/WrMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQw
OTA4MTlaGA8yMTk1MDExNzA5MDgxOVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAka8FLhxs1cSJGK+Q+q/vTf8zVnDAPZ3U6oqppOW/cupCtpwMAQcky8DY
Yb62GF7+C6usniaq/9W6xPn/3o//wti0cNt6MLsiUeHqNl5H/4U/Q/fR+GA8pJ+L
npqZDG2tFi1WMvvGhGgIbScrjR4VO3TuKy+rZXMYvMRk1RXZ9gPhk6evFnviwHsE
jV5AEjxLz3duD+u/SjPp1vloxe2KuWnyC+EKInnka909sl4ZAUh+qIYfZK85DAjm
GJP4W036E9wTJQF2hZJrzsiB1MGyC1WI9veRISd30izZZL6VVXLXUtHwVHnVASrS
zZDVpzj+3yD5hRXsvFigGhY0FCVFnwIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUxC2l6pvJaRflgu3MUdN6zTuP6YcwgY4GA1UdIwSBhjCBg4AUxC2l
6pvJaRflgu3MUdN6zTuP6YehYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAKD+v6LeR/WrMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAIK+DtbUPppJXFqQMv1f2Gky5/82ZwgbbfXa
HBeGSii55b3tsyC3ZW5ZlMJ7Dtnr3vUkiWbV1EUaZGOUlndUFtXUMABCb/coDndw
CAr53XTv7UwGVNe/AFO/6pQDdPxXn3xBhF0mTKPrOGdvYmjZUtQMSVb9lbMWCFfs
w+SwDLnm5NF4yZchIcTs2fdpoyZpOHDXy0xgxO1gWhKTnYbaZOxkJvEvcckxVAwJ
obF8NyJla0/pWdjhlHafEXEN8lyxyTTyOa0BGTuYOBD2cTYYynauVKY4fqHUkr3v
Z6fboaHEd4RFamShM8uvSu6eEFD+qRmvqlcodbpsSOhuGNLzhOQ=
-----END CERTIFICATE-----
• Europe (Zurich)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJALvT012pxTxNMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMjA3MTgx
NTEyMDdaGA8yMjAxMTIyMjE1MTIwN1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAyn+Lsnq1ykrfYlZkk6aAAYNReNd9Iw8AUwCBkgOr2eBiBBepYxHwU85N
++moQ+j0EV2VaahBeTLShGZZS1HsyK8+cYT2QzpghIoamcYhrPXyIxlWiRQlaqSg
OFiE9bsqL3rCF5Vz+tOiTe5W/7ojfOFls6++g7ZpobwJlpMbuJepqyeHMPyjvO5A
age81lJewc4bxo2ntaW0HCqNksqfYB78j6X6kn3PFpX7FaYAwZA+Xx6C7UCY7rNi
UdQzfAo8htfJi4chz7frpUdQ9kl3IOQrsLshBB5fFUjl09NiFipCGBwi+8ZMeSn1
5qwBI01BWXPfG7WX6Owyjhmh6JtE1wIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU8HN4vvJrsZgPQeksMBgJb9xR1yYwgY4GA1UdIwSBhjCBg4AU8HN4
vvJrsZgPQeksMBgJb9xR1yahYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJALvT012pxTxNMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAGlHYDtcHpfBvdHx9HeQE8HgNugJUPdEqxun
t9U33p8VFrs+uLPtrOd9HDJEGvvs5h84EUie/oGJxRt7V1Vlid1PvHf6cRmpjgqY
YdggAVkZtY/PnFVmzf2bMVlSQPrqCl7U0zaw2Kvnj4zgX0rZyCetgrRZSUSxotyp
978Wy9ccXwVSeYG/YAr5rJpS6ZH7eRQvUY0IzwFNeaOPgOTEVpcjWlV6+MQEvsEx
W85q+s6AVr49eppEx8SLJsl0C23yB+L+t32tAveQImRWtJMpzZ5cxh/sYgDVeoC0
869
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
85H1NK/7H9fAzT1cPu1oHSnB0xYzzHGOAmXmusMfwUk8fL1RQkE=
-----END CERTIFICATE-----
• Europe (London)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJANBx0E2bOCEPMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNjA4MTEx
NDU2NDJaGA8yMTk2MDExNTE0NTY0MlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEArYS3mJLGaMrh2DmiPLbqr4Z+xWXTzBWCjOwpsuHE9H6dWUUyl2Bgnu+Z
d8QvW306Yleec45M4F2RA3J4hWHtShzsMlOJVRt+YulGeTf9OCPr26QmIFfs5nD4
fgsJQEry2MBSGA9Fxq3Cw6qkWcrOPsCR+bHOU0XykdKl0MnIbpBf0kTfciAupQEA
dEHnM2J1L2iI0NTLBgKxy5PXLH9weX20BFauNmHH9/J07OpwL20SN5f8TxcM9+pj
Lbk8h1V4KdIwVQpdWkbDL9BCGlYjyadQJxSxz1J343NzrnDM0M4h4HtVaKOS7bQo
Bqt2ruopLRCYgcuFHck/1348iAmbRQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBG
wujwU1Otpi3iBgmhjMClgZyMMn0aQIxMigoFNqXMUNx1Mq/e/Tx+SNaOEAu0n2FF
aiYjvY0/hXOx75ewzZvM7/zJWIdLdsgewpUqOBH4DXFhbSk2TxggSPb0WRqTBxq5
Ed7F7+7GRIeBbRzdLqmISDnfqey8ufW0ks51XcQNomDIRG5s9XZ5KHviDCar8FgL
HngBCdFI04CMagM+pwTO9XN1Ivt+NzUj208ca3oP1IwEAd5KhIhPLcihBQA5/Lpi
h1s3170z1JQ1HZbDrH1pgp+8hSI0DwwDVb3IIH8kPR/J0Qn+hvOl2HOpaUg2Ly0E
pt1RCZe+W7/dF4zsbqwK
-----END CERTIFICATE-----
• Europe (Paris)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJALWSfgHuT/ARMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNzA1MzEx
MTE4MTZaGA8yMTk2MTEwMzExMTgxNlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAy5V7KDqnEvF3DrSProFcgu/oL+QYD62b1U+Naq8aPuljJe127Sm9WnWA
EBdOSASkOaQ9fzjCPoG5SGgWKxYoZjsevHpmzjVv9+Ci+F57bSuMbjgUbvbRIFUB
bxQojVoXQPHgK5v433ODxkQ4sjRyUbf4YV1AFdfU7zabC698YgPVOExGhXPlTvco
8mlc631ubw2g52j0lzaozUkHPSbknTomhQIvO6kUfX0e0TDMH4jLDG2ZIrUB1L4r
OWKG4KetduFrRZyDHF6ILZu+s6ywiMicUd+2UllDFC6oas+a8D11hmO/rpWU/ieV
jj4rWAFrsebpn+Nhgy96iiVUGS2LuQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQDE
iYv6FQ6knXCg+svlcaQG9q59xUC5z8HvJZ1+SxzPKKC4PKQdKvIIfE8GxVXqlZG1
cl5WKTFDMapnzb9RV/DTaVzWx3cMYT77vm1Hl1XGjhx611CGcENH1egI3lOTILsa
+KfopuJEQQ9TDMAIkGjhA+KieU/U5Ctv9fdej6d0GC6OEuwKkTNzPWue6UMq8d4H
2xqJboWsE1t4nybEosvZfQJcZ8jyIYcYBnsG13vCLM+ixjuU5MVVQNMY/gBJzqJB
V+U0QiGiuT5cYgY/QihxdHt99zwGaE0ZBC7213NKrlNuLSrqhDI2NLu8NsExqOFy
OmY0v/xVmQUQl26jJXaM
-----END CERTIFICATE-----
• Europe (Ireland)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAOrmqHuaUt0vMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTEwMjkw
OTA2MTlaGA8yMTk1MDQwMzA5MDYxOVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAjE7nVu+aHLtzp9FYV25Qs1mvJ1JXD7J0iQ1Gs/RirW9a5ZECCtc4ssnf
zQHq2JRVr0GRchvDrbm1HaP/avtFQR/Thvfltwu9AROVT22dUOTvERdkNzveoFCy
hf52Rqf0DMrLXG8ZmQPPXPDFAv+sVMWCDftcChxRYZ6mP9O+TpgYNT1krD5PdvJU
7HcXrkNHDYqbsg8A+Mu2hzl0QkvUET83Csg1ibeK54HP9w+FsD6F5W+6ZSHGJ88l
FI+qYKs7xsjJQYgXWfEt6bbckWs1kZIaIOyMzYdPF6ClYzEec/UhIe/uJyUUNfpT
VIsI5OltBbcPF4c7Y20jOIwwI2SgOQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
870
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
BgNVHQ4EFgQUF2DgPUZivKQR/Zl8mB/MxIkjZDUwgY4GA1UdIwSBhjCBg4AUF2Dg
PUZivKQR/Zl8mB/MxIkjZDWhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAOrmqHuaUt0vMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAGm6+57W5brzJ3+T8/XsIdLTuiBSe5ALgSqI
qnO5usUKAeQsa+kZIJPyEri5i8LEodh46DAF1RlXTMYgXXxl0YggX88XPmPtok17
l4hib/D9/lu4IaFIyLzYNSzsETYWKWoGVe7ZFz60MTRTwY2u8YgJ5dec7gQgPSGj
avB0vTIgoW41G58sfw5b+wjXCsh0nROon79RcQFFhGnvup0MZ+JbljyhZUYFzCli
31jPZiKzqWa87xh2DbAyvj2KZrZtTe2LQ48Z4G8wWytJzxEeZdREe4NoETf+Mu5G
4CqoaPR05KWkdNUdGNwXewydb3+agdCgfTs+uAjeXKNdSpbhMYg=
-----END CERTIFICATE-----
• Europe (Milan)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAO/+DgYF78KwMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xOTA0Mjky
MDM1MjJaGA8yMTk4MTAwMjIwMzUyMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAv1ZLV+Z/P6INq+R1qLkzETBg7sFGKPiwHekbpuB6lrRxKHhj8V9vaReM
lnv1Ur5LAPpMPYDsuJ4WoUbPYAqVqyMAo7ikJHCCM1cXgZJefgN6z9bpS+uA3YVh
V/0ipHh/X2hc2S9wvxKWiSHu6Aq9GVpqL035tJQD+NJuqFd+nXrtcw4yGtmvA6wl
5Bjn8WdsP3xOTKjrByYY1BhXpP/f1ohU9jE9dstsRXLa+XTgTPWcWdCS2oRTWPGR
c5Aeh47nnDsyQfP9gLxHeYeQItV/BD9kU/2Hn6mnRg/B9/TYH8qzlRTzLapXp4/5
iNwusrTNexGl8BgvAPrfhjDpdgYuTwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQB7
5ya11K/hKgvaRTvZwVV8GlVZt0CGPtNvOi4AR/UN6TMm51BzUB5nurB4z0R2MoYO
Uts9sLGvSFALJ4otoB77hyNpH3drttU1CVVwal/yK/RQLSon/IoUkaGEbqalu+mH
nYad5IG4tEbmepX456XXcO58MKmnczNbPyw3FRzUZQtI/sf94qBwJ1Xo6XbzPKMy
xjL57LHIZCssD+XPifXay69OFlsCIgLim11HgPkRIHEOXLSf3dsW9r+4CjoZqB/Z
jj/P4TLCxbYCLkvglwaMjgEWF40Img0fhx7yT2X92MiSrs3oncv/IqfdVTiN8OXq
jgnq1bf+EZEZKvb6UCQV
-----END CERTIFICATE-----
• Europe (Spain)
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJALWSmO6DvSpQMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMjA3MTgx
MzU4NDNaGA8yMjAxMTIyMjEzNTg0M1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAuAAhuSpsHC00/fD2zNlBDpNLRndi9qbHsNeuz3WqN7Samj2aSrM2hS+i
hUxx0BspZj0tZCOsbpPZ+i74NOEQtFeqQoEGvKhB1nJiF4y5I81HDhs5qHvoIivm
7rbbik3zgm1PqS/DmDjVQaXPcD31Rd9ILwBmWEwJqHigyNVlxYtCzTQcrlBrvNZM
dnNgCDAdX/HBEFxx9O12xeu0bSt0s+PJWZ1RTbYrNe7LIH6ntUqHxP/ziQ5trXEZ
uqy7aWk1L8uK4jmyNph0lbaqBa3Y6pYmU1nC27UE4i3fnPB0LSiAr+SrwVvX1g4z
ilo8kr+tbIF+JmcgYLBvO8Jwp+EUqQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUwvGzKJL9A5LReJ4Fxo5K6I20xcowgY4GA1UdIwSBhjCBg4AUwvGz
KJL9A5LReJ4Fxo5K6I20xcqhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJALWSmO6DvSpQMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAJAZd31jyoTGLawAD2+v/vQsaB9vZIx5EImi
G8YGkd61uFWeNhAmtrwyE/i6FDSIphDrMHBkvw/D3BsqK+Ev/JOK/VYuaYDx/8fp
H4cwp9jC57CXzdIDREWNf6M9PsHFg2WA9XNNtClOZL5WJiJwel8eDSg+sqJUxE0l
MW+QChq/20F6niyaRK4bXrZq14as7h+F9u3A9xHEOVP7Zk9C2ehrBXzCMLSDt3GV
fEuMea2RxMhozwz34Hkdb6j18qoCfygubulovRNQjKw/cEmgPR16KfZPP5caILVt
9qkYPvePmbiVswZDee73cDymJYxLqILpOZwyXvUH8StiH42FHZQ=
-----END CERTIFICATE-----
• Europe (Stockholm)
871
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJALc/uRxg++EnMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xODA0MTAx
NDAwMTFaGA8yMTk3MDkxMzE0MDAxMVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAzwCGJEJIxqtr2PD2a1mA6LhRzKhTBa1AZsg3eYfpETXIVlrpojMfvVoN
qHvGshWLgrGTT6os/3gsaADheSaJKavxwX3X6tJA8fvEGqr3a1C1MffH9hBWbQqC
LbfUTAbkwis4GdTUwOwPjT1Cm3u9R/VzilCNwkj7iQ65AFAI8Enmsw3UGldEsop4
yChKB3KW3WI0FTh0+gD0YtjrqqYJxpGOYBpJp5vwdd3fZ4t1vidmDMs7liv4f9Bx
p0oSmUobU4GUlFhBchK1DukICVQdnOVzdMonYm7s+HtpFbVHR8yf6QoixBKGdSal
mBf7+y0ixjCn0pnC0VLVooGo4mi17QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQDG
4ONZiixgk2sjJctwbyD5WKLTH6+mxYcDw+3y/F0fWz561YORhP2FNnPOmEkf0Sl/
Jqk4svzJbCbQeMzRoyaya/46d7UioXMHRZam5IaGBhOdQbi97R4VsQjwQj0RmQsq
yDueDyuKTwWLK9KnvI+ZA6e6bRkdNGflK4N8GGKQ+fBhPwVELkbT9f16OJkezeeN
S+F/gDADGJgmPXfjogICb4Kvshq0H5Lm/xZlDULF2g/cYhyNY6EOI/eS5m1I7R8p
D/m6WoyZdpInxJfxW616OMkxQMRVsruLTNGtby3u1g6ScjmpFtvAMhYejBSdzKG4
FEyxIdEjoeO1jhTsck3R
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJANZkFlQR2rKqMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xOTAyMDUx
MzA2MjBaGA8yMTk4MDcxMTEzMDYyMFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAy4Vnit2eBpEjKgOKBmyupJzJAiT4fr74tuGJNwwa+Is2vH12jMZn9Il1
UpvvEUYTIboIgISpf6SJ5LmV5rCv4jT4a1Wm0kjfNbiIlkUi8SxZrPypcw24m6ke
BVuxQZrZDs+xDUYIZifTmdgD50u5YE+TLg+YmXKnVgxBU6WZjbuK2INohi71aPBw
2zWUR7Gr/ggIpf635JLU3KIBLNEmrkXCVSnDFlsK4eeCrB7+UNak+4BwgpuykSGG
Op9+2vsuNqFeU1l9daQeG9roHR+4rIWSPa0opmMxv5nctgypOrE6zKXx2dNXQldd
VULv+WH7s6Vm4+yBeG8ctPYH5GOo+QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBs
ZcViiZdFdpcXESZP/KmZNDxB/kktlIEIhsQ+MNn29jayE5oLmtGjHj5dtA3XNKlr
f6PVygVTKbtQLQqunRT83e8+7iCZMKI5ev7pITUQVvTUwI+Fc01JkYZxRFlVBuFA
WGZO+98kxCS4n6tTwVt+nSuJr9BJRVC17apfHBgSS8c5OWna0VU/Cc9ka4eAfQR4
7pYSDU3wSRE01cs30q34lXZ629IyFirSJ5TTOIc0osNL7vwMQYj8HOn4OBYqxKy8
ZJyvfXsIPh0Na76PaBIs6ZlqAOflLrjGzxBPiwRM/XrGmF8ze4KzoUqJEnK13O6A
KHKgfiigQZ1+gv5FlyXH
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAM4h7b1CVhqqMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMjA0MTEx
MDE1MDNaGA8yMjAxMDkxNTEwMTUwM1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEApybTWfMOhSoMpqPo72eqAmnn1dXGZM+G8EoZXzwHwT/+IHEXNB4q5N6k
tudYLre1bJxuzEw+iProSHjmb9bB9YscRTofjVhBlt35Fc+i8BaMeH94SR/eE8QO
mll8gnLNW3d62lyuhzuyv1e5wVlRqzYw+X2zRH4/wRDOCOpzjKoHIgyPKsMgwsw5
aTZhNMsGxZN9dbkf0iCGeQLDytwU/JTh/HqvSr3VfUOapTJJiyAxoCtZWgp1/7wC
RvOCSMRJobpUqxZgl/VsttwNkikSFz1wGkcYeSQvk+odbnYQckA8tdddoVI56eD4
qtREQvfpMAX5v7fcqLexl5d5vH8uZQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUOadrbTs+OhzwoAgUJ7RqQNdwufkwgY4GA1UdIwSBhjCBg4AUOadr
bTs+OhzwoAgUJ7RqQNdwufmhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAM4h7b1CVhqqMBIGA1UdEwEB/wQIMAYBAf8C
872
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
AQAwDQYJKoZIhvcNAQELBQADggEBAICTdAOGEOnII8HaGCpCB8us/hGFaLptJaAf
D5SJAyVy66/mdfjGzE1BKkKxnbxemEVUIzbRidOnyilB+pKwN3edAjTZtWdpVA0V
R/G/qQPmcVljtycBz4VC6SuOUYflGzLH1GZ6GJWbuDtFzw8r7HGdRN1wrEPe3UF2
sMpuVezqnRUdvVRoVQP4jFgNsE7kNvtn2NiPhb/CtrxpcwIQ7r6YeoHcBSheuV1Z
xZDHynC3KUprQGx1+Z9QqPrDf180MaoqAlTl4+W6Pr2NJYrVUFGS/ivYshMg574l
CPU6r4wWZSKwEUXq4BInYX6z6iclp/p/J5QnJp2mAwyi6M+I13Y=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAIFI+O5A6/ZIMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xOTA2MDQx
MjQ4MDRaGA8yMTk4MTEwNzEyNDgwNFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAy7/WHBBHOrk+20aumT07g8rxrSM0UXgki3eYgKauPCG4Xx//vwQbuZwI
oeVmR9nqnhfij2wOcQdbLandh0EGtbxerete3IoXzd1KXJb11PVmzrzyu5SPBPuP
iCeV4qdjjkXo2YWM6t9YQ911hcG96YSp89TBXFYUh3KLxfqAdTVhuC0NRGhXpyii
j/czo9njofHhqhTr7UEyPun8NVS2QWctLQ86N5zWR3Q0GRoVqqMrJs0cowHTrVw2
9Qr7QBjjBOVbyYmtYxm/DtiKprYV/e6bCAVok015X1sZDd3oCOQNoGlv5XbHJe2o
JFD8GRRy2rkWO/lNwVFDcwec6zC3QwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCE
goqzjpCpmMgCpszFHwvRaSMbspKtK7wNImUjrSBOfBJsfFulyg1Zgn2nDCK7kQhx
jMJmNIvXbps3yMqQ2cHUkKcKf5t+WldfeT4Vk1Rz6HSA8sd0kgVcIesIaoy2aaXU
VEB/oQziRGyKdN1d4TGYVZXG44CkrzSDvlbmfiTq5tL+kAieznVF3bzHgPZW6hKP
EXC3G/IXrXicFEe6YyE1Rakl62VncYSXiGe/i2XvsiNH3Qlmnx5XS7W0SCN0oAxW
EH9twibauv82DVg1WOkQu8EwFw8hFde9X0Rkiu0qVcuU8lJgFEvPWMDFU5sGB6ZM
gkEKTzMvlZpPbBhg99Jl
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAL2bOgb+dq9rMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTEwMjkw
OTAwNTdaGA8yMTk1MDQwMzA5MDA1N1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAmRcyLWraysQS8yDC1b5Abs3TUaJabjqWu7d5gHik5Icd6dKl8EYpQSeS
vz6pLhkgO4xBbCRGlgE8LS/OijcZ5HwdrxBiKbicR1YvIPaIyEQQvF5sX6UWkGYw
Ma5IRGj4YbRmJkBybw+AAV9Icb5LJNOMWPi34OWM+2tMh+8L234v/JA6ogpdPuDr
sM6YFHMZ0NWo58MQ0FnEj2D7H58Ti//vFPl0TaaPWaAIRF85zBiJtKcFJ6vPidqK
f2/SDuAvZmyHC8ZBHg1moX9bR5FsU3QazfbW+c+JzAQWHj2AaQrGSCITxCMlS9sJ
l51DeoZBjnx8cnRe+HCaC4YoRBiqIQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU/wHIo+r5U31VIsPoWoRVsNXGxowwgY4GA1UdIwSBhjCBg4AU/wHI
o+r5U31VIsPoWoRVsNXGxoyhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAL2bOgb+dq9rMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBACobLvj8IxlQyORTz/9q7/VJL509/p4HAeve
92riHp6+Moi0/dSEYPeFTgdWB9W3YCNc34Ss9TJq2D7t/zLGGlbI4wYXU6VJjL0S
hCjWeIyBXUZOZKFCb0DSJeUElsTRSXSFuVrZ9EAwjLvHni3BaC9Ve34iP71ifr75
8Tpk6PEj0+JwiijFH8E4GhcV5chB0/iooU6ioQqJrMwFYnwo1cVZJD5v6D0mu9bS
TMIJLJKv4QQQqPsNdjiB7G9bfkB6trP8fUVYLHLsVlIy5lGx+tgwFEYkG1N8IOO/
2LCawwaWm8FYAFd3IZl04RImNs/IMG7VmH1bf4swHOBHgCN1uYo=
-----END CERTIFICATE-----
873
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAL9KIB7Fgvg/MA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQw
OTAwMjVaGA8yMTk1MDExNzA5MDAyNVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAz0djWUcmRW85C5CiCKPFiTIvj6y2OuopFxNE5d3Wtab10bm06vnXVKXu
tz3AndG+Dg0zIL0gMlU+QmrSR0PH2PfV9iejfLak9iwdm1WbwRrCEAj5VxPe0Q+I
KeznOtxzqQ5Wo5NLE9bA61sziUAFNVsTFUzphEwRohcekYyd3bBC4v/RuAjCXHVx
40z6AIksnAOGN2VABMlTeMNvPItKOCIeRLlllSqXX1gbtL1gxSW40JWdF3WPB68E
e+/1U3F7OEr7XqmNODOL6yh92QqZ8fHjG+afOL9Y2Hc4g+P1nk4w4iohQOPABqzb
MPjK7B2Rze0f9OEc51GBQu13kxkWWQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU5DS5IFdU/QwYbikgtWvkU3fDwRgwgY4GA1UdIwSBhjCBg4AU5DS5
IFdU/QwYbikgtWvkU3fDwRihYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAL9KIB7Fgvg/MBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAG/N7ua8IE9IMyno0n5T57erBvLTOQ79fIJN
Mf+mKRM7qRRsdg/eumFft0rLOKo54pJ+Kim2cngCWNhkzctRHBV567AJNt4+ZDG5
hDgV0IxWO1+eaLE4qzqWP/9VrO+p3reuumgFZLVpvVpwXBBeBFUf2drUR14aWfI2
L/6VGINXYs7uP8v/2VBS7r6XZRnPBUy/R4hv5efYXnjwA9gq8+a3stC2ur8m5ySl
faKSwE4H320yAyaZWH4gpwUdbUlYgPHtm/ohRtiWPrN7KEG5Wq/REzMIjZCnxOfS
6KR6PNjlhxBsImQhmBvz6j5PLQxOxBZIpDoiK278e/1Wqm9LrBc=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJANuCgCcHtOJhMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA5MTQx
NTU3NDRaGA8yMTk1MDIxNzE1NTc0NFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA66iNv6pJPmGM20W8HbVYJSlKcAg2vUGx8xeAbzZIQdpGfkabVcUHGB6m
Gy59VXDMDlrJckDDk6dxUOhmcX9z785TtVZURq1fua9QosdbTzX4kAgHGdp4xQEs
mO6QZqg5qKjBP6xr3+PshfQ1rB8Bmwg0gXEm22CC7o77+7N7Mu2sWzWbiUR7vil4
9FjWS8XmMNwFTlShp4l1TDTevDWW/uYmC30RThM9S4QPvTZ0rAS18hHVam8BCTxa
LHaVCH/Yy52rsz0hM/FlghnSnK105ZKj+b+KIp3adBL8OMCjgc/Pxi0+j3HQLdYE
32+FaXWU84D2iP2gDT28evnstzuYTQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQC1
mA4q+12pxy7By6g3nBk1s34PmWikNRJBwOqhF8ucGRv8aiNhRRye9lokcXomwo8r
KHbbqvtK85l0xUZp/Cx4sm4aTgcMvfJP29jGLclDzeqADIvkWEJ4+xncxSYVlS9x
+78TvF/+8h9U2LnSl64PXaKdxHy2IsHIVRN4GtoaP2Xhpa1S0M328Jykq/571nfN
1WRD1c/fQf1edgzRjhQ4whcAhv7WRRF+qTbfQJ/vDxy8lkiOsvU9XzUaZ0fZSfXX
wXxZamQbONvFcxVHY/0PSiM8nQoUmkkBQuKleDwRWvkoJKYKyr3jvXK7HIWtMrO4
jmXe0aMy3thyK6g5sJVg
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAMn1yPk22ditMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNzA3MTkx
MTEyNThaGA8yMTk2MTIyMjExMTI1OFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEArznEYef8IjhrJoazI0QGZkmlmHm/4rEbyQbMNifxjsDE8YWtHNwaM91z
zmyK6Sk/tKlWxcnl3g31iq305ziyFPEewe5Qbwf1iz2cMsvfNBcTh/E6u+mBPH3J
gvGanqUJt6c4IbipdEouIjjnynyVWd4D6erLl/ENijeR1OxVpaqSW5SBK7jms49E
pw3wtbchEl3qsE42Ip4IYmWxqjgaxB7vps91n4kfyzAjUmklcqTfMfPCkzmJCRgp
Vh1C79vRQhmriVKD6BXwfZ8tG3a7mijeDn7kTsQzgO07Z2SAE63PIO48JK8HcObH
tXORUQ/XF1jzi/SIaUJZT7kq3kWl8wIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBj
874
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
ThtO9dLvU2QmKuXAhxXjsIdlQgGG3ZGh/Vke4If1ymgLx95v2Vj9Moxk+gJuUSRL
BzFte3TT6b3jPolbECgmAorjj8NxjC17N8QAAI1d0S0gI8kqkG7V8iRyPIFekv+M
pcai1+cIv5IV5qAz8QOMGYfGdYkcoBjsgiyvMJu/2N2UbZJNGWvcEGkdjGJUYYOO
NaspCAFm+6HA/K7BD9zXB1IKsprLgqhiIUgEaW3UFEbThJT+z8UfHG9fQjzzfN/J
nT6vuY/0RRu1xAZPyh2gr5okN/s6rnmh2zmBHU1n8cbCc64MVfXe2g3EZ9Glq/9n
izPrI09hMypJDP04ugQc
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAPRYyD8TtmC0MA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNjAzMDcx
MDQ1MDFaGA8yMTk1MDgxMTEwNDUwMVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA0LSS5I/eCT2PM0+qusorBx67QL26BIWQHd/yF6ARtHBb/1DdFLRqE5Dj
07Xw7eENC+T79mOxOAbeWg91KaODOzw6i9I/2/HpK0+NDEdD6sPKDA1d45jRra+v
CqAjI+nV9Vw91wv7HjMk3RcjWGziM8/hw+3YNIutt7aQzZRwIWlBpcqx3/AFd8Eu
2UsRMSHgkGUW6UzUF+h/U8218XfrauKNGmNKDYUhtmyBrHT+k6J0hQ4pN7fe6h+Z
w9RVHm24BGhlLxLHLmsOIxvbrF277uX9Dxu1HfKfu5D2kimTY7xSZDNLR2dt+kNY
/+iWdIeEFpPT0PLSILt52wP6stF+3QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBI
E6w+WWC2gCfoJO6c9HMyGLMFEpqZmz1n5IcQt1h9iyO7Vkm1wkJiZsMhXpk73zXf
TPxuXEacTX3SOEa07OIMCFwkusO5f6leOyFTynHCzBgZ3U0UkRVZA3WcpbNB6Dwy
h7ysVlqyT9WZd7EOYm5j5oue2G2xdei+6etgn5UjyWm6liZGrcOF6WPTdmzqa6WG
ApEqanpkQd/HM+hUYex/ZS6zEhd4CCDLgYkIjlrFbFb3pJ1OVLztIfSN5J4Oolpu
JVCfIq5u1NkpzL7ys/Ub8eYipbzI6P+yxXiUSuF0v9b98ymczMYjrSQXIf1e8In3
OP2CclCHoZ8XDQcvvKAh
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAMoxixvs3YssMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xODA3MjAw
ODQ0NDRaGA8yMTk3MTIyMzA4NDQ0NFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA4T1PNsOg0FDrGlWePoHeOSmOJTA3HCRy5LSbYD33GFU2eBrOIxoU/+SM
rInKu3GghAMfH7WxPW3etIAZiyTDDU5RLcUq2Qwdr/ZpXAWpYocNc/CEmBFtfbxF
z4uwBIN3/drM0RSbe/wP9EcgmNUGQMMZWeAji8sMtwpOblNWAP9BniUG0Flcz6Dp
uPovwDTLdAYT3TyhzlohKL3f6O48TR5yTaV+3Ran2SGRhyJjfh3FRpP4VC+z5LnT
WPQHN74Kdq35UgrUxNhJraMGCzznolUuoR/tFMwR93401GsM9fVA7SW3jjCGF81z
PSzjy+ArKyQqIpLW1YGWDFk3sf08FQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQDK
2/+C3nPMgtyOFX/I3Cyk+Pui44IgOwCsIdNGwuJysdqp5VIfnjegEu2zIMWJSKGO
lMZoQXjffkVZZ97J7RNDW06oB7kj3WVE8a7U4WEOfnO/CbMUf/x99CckNDwpjgW+
K8V8SzAsQDvYZs2KaE+18GFfLVF1TGUYK2rPSZMHyX+v/TIlc/qUceBycrIQ/kke
jDFsihUMLqgmOV2hXKUpIsmiWMGrFQV4AeV0iXP8L/ZhcepLf1t5SbsGdUA3AUY1
3If8s81uTheiQjwY5t9nM0SY/1Th/tL3+RaEI79VNEVfG1FQ8mgqCK0ar4m0oZJl
tmmEJM7xeURdpBBx36Di
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAJVMGw5SHkcvMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTEwMjkw
ODU3MTlaGA8yMTk1MDQwMzA4NTcxOVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAlaSSLfBl7OgmikjLReHuNhVuvM20dCsVzptUyRbut+KmIEEc24wd/xVy
875
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
2RMIrydGedkW4tUjkUyOyfET5OAyT43jTzDPHZTkRSVkYjBdcYbe9o/0Q4P7IVS3
XlvwrUu0qo9nSID0mxMnOoF1l8KAqnn10tQ0W+lNSTkasW7QVzcb+3okPEVhPAOq
MnlY3vkMQGI8zX4iOKbEcSVIzf6wuIffXMGHVC/JjwihJ2USQ8fq6oy686g54P4w
ROg415kLYcodjqThmGJPNUpAZ7MOc5Z4pymFuCHgNAZNvjhZDA842Ojecqm62zcm
Tzh/pNMNeGCRYq2EQX0aQtYOIj7bOQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU6SSB+3qALorPMVNjToM1Bj3oJMswgY4GA1UdIwSBhjCBg4AU6SSB
+3qALorPMVNjToM1Bj3oJMuhYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAJVMGw5SHkcvMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAF/0dWqkIEZKg5rca8o0P0VS+tolJJE/FRZO
atHOeaQbWzyac6NEwjYeeV2kY63skJ+QPuYbSuIBLM8p/uTRIvYM4LZYImLGUvoO
IdtJ8mAzq8CZ3ipdMs1hRqF5GRp8lg4w2QpX+PfhnW47iIOBiqSAUkIr3Y3BDaDn
EjeXF6qS4iPIvBaQQ0cvdddNh/pE33/ceghbkZNTYkrwMyBkQlRTTVKXFN7pCRUV
+L9FuQ9y8mP0BYZa5e1sdkwebydU+eqVzsil98ntkhpjvRkaJ5+Drs8TjGaJWlRw
5WuOr8unKj7YxdL1bv7//RtVYVVi296ldoRUYv4SCvJF11z0OdQ=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAMtdyRcH51j9MA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMjA0MDgx
MjM5MTZaGA8yMjAxMDkxMjEyMzkxNlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAvUsKCxoH6KXRYJLeYTWAQfaBQeCwhJaR56mfUeFHJE4g8aFjWkiN4uc1
TvOyYNnIZKTHWmzmulmdinWNbwP0GiROHb/i7ro0HhvnptyycGt8ag8affiIbx5X
7ohdwSN2KJ6G0IKflIx7f2NEI0oAMM/9k+T1eVF+MVWzpZoiDp8frLNkqp8+RAgz
ScZsbRfwv3u/if5xJAvdg2nCkIWDMSHEVPoz0lJo7v0ZuDtWWsL1LHnL5ozvsKEk
+ZJyEi23r+U1hIT1NTBdp4yoigNQexedtwCSr7q36oOdDwvZpqYlkLi3uxZ4ta+a
01pzOSTwMLgQZSbKWQrpMvsIAPrxoQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQU1GgnGdNpbnL3lLF30Jomg7Ji9hYwgY4GA1UdIwSBhjCBg4AU1Ggn
GdNpbnL3lLF30Jomg7Ji9hahYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAMtdyRcH51j9MBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBACVl00qQlatBKVeiWMrhpczsJroxDxlZTOba
6wTMZk7c3akb6XMOSZFbGaifkebPZqTHEhDlrClM2j9AIlYcCx6YCrTf4cuhn2mD
gcJN33143eOWSaeRY3ee4j+V9ne98y3kO2wLz95VrRgclPFR8po2iWGzGhwUi+FG
q8dXeCH3N0DZgQsSgQWwmdNQXZZej6RHLU/8In5trHKLY0ppnLBjn/UZQbeTyW5q
RJB3GaveXjfgFUWj2qOcDuRGaikdS+dYaLsi5z9cA3FolHzWxx9MOs8io8vKqQzV
XUrLTNWwuhZy88cOlqGPxnoRbw7TmifwPw/cunNrsjUUOgs6ZTk=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIJAN4GTQ64zVs8MA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0yMjA3MTMx
MzMzMDBaGA8yMjAxMTIxNzEzMzMwMFowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA2BYgeCr+Rk/jIAEDOHS7wJql62vc83QEwjuzk0qOFEReIZzlN1fBRNXK
g0T178Kd3gLYcE59wEFbTe/X5yOA1Lo95x1anSAo7R+Cisf9C2HQuJp+gVb+zx71
lniPF7gHziGpm0M8DdAU/IW+wkZwGbP4z7Hq9+bJ0P2ltvPJ5yxSgkFuDsI9VBHa
CLoprHsCHh2VdP8KcMgQQMmHe1NmBpyTk0ul/aLmQkCQEX6ZIRGOeq228fwlh/t+
Ho+jv87duihVKic6MrL32SlD+maX0LSDUydWdaOLLTGkh7oV7+bFuH6msrXUu+Ur
ZEP1r/MidCWMhfgrFzeTBzOHA97qxQIDAQABo4HUMIHRMAsGA1UdDwQEAwIHgDAd
BgNVHQ4EFgQUcHMd1cHqzmsQ5hpUK3EMLhHdsi4wgY4GA1UdIwSBhjCBg4AUcHMd
1cHqzmsQ5hpUK3EMLhHdsi6hYKReMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBX
YXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6
b24gV2ViIFNlcnZpY2VzIExMQ4IJAN4GTQ64zVs8MBIGA1UdEwEB/wQIMAYBAf8C
AQAwDQYJKoZIhvcNAQELBQADggEBAI4PFyVN+7EGSObioiPnv0LL0f70SSzUZJ8p
876
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
XO90d4rWea7jIbgZ2AKb+ErynkU9xVg7XQQ5k6KDWgp/4jYFL2dqnt/YAY4PS0un
RSrYElawxLT0BcLn4rcSDC79vQe1xGC5//wDdV6b399COAHRAK6axWYy5w32u9PL
uw0cIp3Ch8JoNwcgTHKRRGzePmBeR4PNqhHTArG4/dJk6/aUO4OpX0WzI6L67CGY
6Nex3dau+gkLCK93dTEkrXtyXHu4wB0J9zd1w+iQ0SEa9eKc78/NjEsF/FZdGrWC
t57lIMOOXJhQ1kRgSwNeZdQWV1dRakvO6sfcvVYkfj1wAvZvvAw=
-----END CERTIFICATE-----
• China (Ningxia)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAPu4ssY3BlzcMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTEyMDMy
MTI5MzJaGA8yMTk1MDUwODIxMjkzMlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAsOiGi4A6+YTLzCdIyP8b8SCT2M/6PGKwzKJ5XbSBoL3gsnSWiFYqPg9c
uJPNbiy9wSA9vlyfWMd90qvTfiNrT6vewP813QdJ3EENZOx4ERcf/Wd22tV72kxD
yw1Q3I1OMH4bOItGQAxU5OtXCjBZEEUZooOkU8RoUQOU2Pql4NTiUpzWacNutAn5
HHS7MDc4lUlsJqbN+5QW6fFrcNG/0Mrib3JbwdFUNhrQ5j+Yq5h78HarnUivnX/3
Ap+oPbentv1qd7wvPJu556LZuhfqI0TohiIT1Ah+yUdN5osoaMxTHKKtf/CsSJ1F
w3qXqFJQA0VWsqjFyHXFI32I/GOupwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCn
Um00QHvUsJSN6KATbghowLynHn3wZSQsuS8E0COpcFJFxP2SV0NYkERbXu0n/Vhi
yq5F8v4/bRA2/xpedLWmvFs7QWlomuXhSnYFkd33Z5gnXPb9vRkLwiMSw4uXls35
qQraczUJ9EXDhrv7VmngIk9H3YsxYrlDGEqh/oz4Ze4ULOgnfkauanHikk+BUEsg
/jsTD+7e+niEzJPihHdsvKFDlud5pakEzyxovHwNJ1GS2I//yxrJFIL91mehjqEk
RLPdNse7N6UvSnuXcOokwu6l6kfzigGkJBxkcq4gre3szZFdCQcUioj7Z4xtuTL8
YMqfiDtN5cbD8R8ojw9Y
-----END CERTIFICATE-----
• China (Beijing)
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJAOtrM5XLDSjCMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA4MTQx
MDAxNDJaGA8yMTk1MDExNzEwMDE0MlowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
877
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAvVBz+WQNdPiM9S+aUULOQEriTmNDUrjLWLr7SfaOJScBzis5D5ju0jh1
+qJdkbuGKtFX5OTWTm8pWhInX+hIOoS3exC4BaANoa1A3o6quoG+Rsv72qQf8LLH
sgEi6+LMlCN9TwnRKOToEabmDKorss4zFl7VSsbQJwcBSfOcIwbdRRaW9Ab6uJHu
79L+mBR3Ea+G7vSDrVIA8goAPkae6jY9WGw9KxsOrcvNdQoEkqRVtHo4bs9fMRHU
Etphj2gh4ObXlFN92VtvzD6QBs3CcoFWgyWGvzg+dNG5VCbsiiuRdmii3kcijZ3H
Nv1wCcZoEAqH72etVhsuvNRC/xAP8wIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQA8
ezx5LRjzUU9EYWYhyYIEShFlP1qDHs7F4L46/5lc4pL8FPoQm5CZuAF31DJhYi/b
fcV7i3n++/ymQbCLC6kAg8DUB7NrcROll5ag8d/JXGzcTCnlDXLXx1905fPNa+jI
0q5quTmdmiSi0taeaKZmyUdhrB+a7ohWdSdlokEIOtbH1P+g5yll3bI2leYE6Tm8
LKbyfK/532xJPqO9abx4Ddn89ZEC6vvWVNDgTsxERg992Wi+/xoSw3XxkgAryIv1
zQ4dQ6irFmXwCWJqc6kHg/M5W+z60S/94+wGTXmp+19U6Rkq5jVMLh16XJXrXwHe
4KcgIS/aQGVgjM6wivVA
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJANCOF0Q6ohnuMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xNTA5MTAx
OTQyNDdaGA8yMTk1MDIxMzE5NDI0N1owXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAzIcGTzNqie3f1olrrqcfzGfbymSM2QfbTzDIOG6xXXeFrCDAmOq0wUhi
3fRCuoeHlKOWAPu76B9os71+zgF22dIDEVkpqHCjBrGzDQZXXUwOzhm+PmBUI8Z1
qvbVD4ZYhjCujWWzrsX6Z4yEK7PEFjtf4M4W8euw0RmiNwjy+knIFa+VxK6aQv94
lW98URFP2fD84xedHp6ozZlr3+RZSIFZsOiyxYsgiwTbesRMI0Y7LnkKGCIHQ/XJ
OwSISWaCddbu59BZeADnyhl4f+pWaSQpQQ1DpXvZAVBYvCH97J1oAxLfH8xcwgSQ
/se3wtn095VBt5b7qTVjOvy6vKZazwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQA/
S8+a9csfASkdtQUOLsBynAbsBCH9Gykq2m8JS7YE4TGvqlpnWehz78rFTzQwmz4D
fwq8byPkl6DjdF9utqZ0JUo/Fxelxom0h6oievtBlSkmZJNbgc2WYm1zi6ptViup
Y+4S2+vWZyg/X1PXD7wyRWuETmykk73uEyeWFBYKCHWsO9sI+62O4Vf8Jkuj/cie
1NSJX8fkervfLrZSHBYhxLbL+actVEo00tiyZz8GnhgWx5faCY38D/k4Y/j5Vz99
7lUX/+fWHT3+lTL8ZZK7fOQWh6NQpI0wTP9KtWqfOUwMIbgFQPoxkP00TWRmdmPz
WOwTObEf9ouTnjG9OZ20
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJALPB6hxFhay8MA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0
dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAgFw0xODA0MTAx
MjMyNDlaGA8yMTk3MDkxMzEyMzI0OVowXDELMAkGA1UEBhMCVVMxGTAXBgNVBAgT
EFdhc2hpbmd0b24gU3RhdGUxEDAOBgNVBAcTB1NlYXR0bGUxIDAeBgNVBAoTF0Ft
YXpvbiBXZWIgU2VydmljZXMgTExDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAva9xsI9237KYb/SPWmeCVzi7giKNron8hoRDwlwwMC9+uHPd53UxzKLb
pTgtJWAPkZVxEdl2Gdhwr3SULoKcKmkqE6ltVFrVuPT33La1UufguT9k8ZDDuO9C
hQNHUdSVEuVrK3bLjaSsMOS7Uxmnn7lYT990IReowvnBNBsBlcabfQTBV04xfUG0
/m0XUiUFjOxDBqbNzkEIblW7vK7ydSJtFMSljga54UAVXibQt9EAIF7B8k9l2iLa
mu9yEjyQy+ZQICTuAvPUEWe6va2CHVY9gYQLA31/zU0VBKZPTNExjaqK4j8bKs1/
7dOV1so39sIGBz21cUBec1o+yCS5SwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBt
hO2W/Lm+Nk0qsXW6mqQFsAou0cASc/vtGNCyBfoFNX6aKXsVCHxq2aq2TUKWENs+
mKmYu1lZVhBOmLshyllh3RRoL3Ohp3jCwXytkWQ7ElcGjDzNGc0FArzB8xFyQNdK
MNvXDi/ErzgrHGSpcvmGHiOhMf3UzChMWbIr6udoDlMbSIO7+8F+jUJkh4Xl1lKb
YeN5fsLZp7T/6YvbFSPpmbn1YoE2vKtuGKxObRrhU3h4JHdp1Zel1pZ6lh5iM0ec
SD11SximGIYCjfZpRqI3q50mbxCd7ckULz+UUPwLrfOds4VrVVSj+x0ZdY19Plv2
9shw5ez6Cn7E3IfzqNHO
878
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance metadata and user data
-----END CERTIFICATE-----
5. Extract the certificate from the certificate file and store it in a variable named $Store.
PS C:\> $Store =
[Security.Cryptography.X509Certificates.X509Certificate2Collection]::new([Security.Cryptography.X5
Path certificate.pem)))
PS C:\> $SignatureDocument.Decode($Signature)
If the signature is valid, the command returns no output. If the signature cannot be verified, the
command returns Exception calling "CheckSignature" with "2" argument(s):
"Cannot find the original signer. If your signature cannot be verified, contact AWS
Support.
7. Validate the content of the instance identity document.
PS C:
\> [Linq.Enumerable]::SequenceEqual($SignatureDocument.ContentInfo.Content, $Document)
If the content of the instance identity document is valid, the command returns True. If instance
identity document cannot be validated, contact AWS Support.
The instance identity role credentials are accessible from the Instance Metadata Service (IMDS) at /
identity-credentials/ec2/security-credentials/ec2-instance. The credentials consist of
an AWS temporary access key pair and a session token. They are used to sign AWS Sigv4 requests to the
AWS services that use the instance identity role. The credentials are present in the instance metadata
regardless of whether a service or feature that makes use of instance identity roles is enabled on the
instance.
Instance identity roles are automatically created when an instance is launched, have no role-trust policy
document, and are not subject to any identity or resource policy.
Supported services
The following AWS services use the instance identity role:
• Amazon EC2 – EC2 Instance Connect uses the instance identity role to update the host keys for a Linux
instance.
• Amazon GuardDuty – EKS Runtime Monitoring uses the instance identity role to allow the runtime
agent to send security telemetry to the GuardDuty VPC endpoint.
• AWS Security Token Service (AWS STS) – Instance identity role credentials can be used with the AWS
STS GetCallerIdentity action.
879
Amazon Elastic Compute Cloud
User Guide for Windows Instances
SQL Server Clustering in EC2
Instance identity roles can’t be used with other AWS services or features because they do not have an
integration with instance identity roles.
arn:aws-partition:iam::account-number:assumed-role/aws:ec2-instance/instance-id
For example:
arn:aws:iam::0123456789012:assumed-role/aws:ec2-instance/i-0123456789example
For more information about ARNs, see Amazon Resource Names (ARNs) in the IAM User Guide.
For more information about WSL, see the Windows Subsystem for Linux Documentation on the Microsoft
Build website.
Limitations
• WSL is available in two versions: WSL 1 and WSL 2.
• For .metal EC2 instances, you can install either WSL 1 or WSL 2.
• For virtualized EC2 instances, you must install WSL 1.
• For Windows Server operating systems, WSL can only be installed on instances running the following:
• Windows Server 2019
• Windows Server 2022
Install WSL
To install WSL 1
1. To install WSL, run the following standard installation command on your EC2 instance, but make
sure to enable WSL 1 by including --enable-wsl1. By default, WSL 2 is installed. If your instance
880
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Upgrade Windows instances
was launched using a virtualized instance type, you must complete step 3 in this procedure to set
the version to WSL 1.
wsl --set-default-version 1
To install WSL 2
• To install WSL, run the following standard installation command on your EC2 instance. By default,
WSL 2 is installed. If you are installing WSL on a .metal instance, then this is the only step to
perform.
wsl --install
For more information, see Install Linux on Windows with WSL on the Microsoft Build website.
Microsoft has traditionally recommended migrating to a newer version of Windows Server instead
of upgrading. Migrating can result in fewer upgrade errors or issues, but can take longer than an in-
place upgrade because of the need to provision a new instance, plan for and port applications, and
adjust configurations settings on the new instance. An in-place upgrade can be faster, but software
incompatibilities can produce errors.
Contents
• Perform an in-place upgrade (p. 881)
• Perform an automated upgrade (p. 886)
• Migrate to latest generation instance types (p. 894)
• Windows to Linux replatforming assistant for Microsoft SQL Server Databases (p. 899)
• Troubleshoot an upgrade (p. 907)
881
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an in-place upgrade
Automated upgrades
For steps on how to use AWS Systems Manager to automate the upgrade of your Windows Server 2008
R2 to Server 2012 R2 or from SQL Server 2008 R2 on Windows Server 2012 R2 to SQL Server 2016, see
Upgrade Your End of Support Microsoft 2008 Workloads in AWS with Ease.
• Read the Microsoft documentation to understand the upgrade requirements, known issues, and
restrictions. Also review the official instructions for upgrading.
• Upgrading to Windows Server 2008 R2
• Upgrade Options for Windows Server 2012
• Upgrade Options for Windows Server 2012 R2
• Upgrade and conversion options for Windows Server 2016
• Upgrade and conversion options for Windows Server 2019
• Upgrade and conversion options for Windows Server 2022
• Windows Server Upgrade Center
• We recommend performing an operating system upgrade on instances with at least 2 vCPUs and 4GB
of RAM. If needed, you can change the instance to a larger size of the same type (t2.small to t2.large,
for example), perform the upgrade, and then resize it back to the original size. If you are required to
retain the instance size, you can monitor the progress using the instance console screenshot (p. 1934).
For more information, see Change the instance type (p. 331).
• Verify that the root volume on your Windows instance has enough free disk space. The Windows Setup
process might not warn you of insufficient disk space. For information about how much disk space
is required to upgrade a specific operating system, see the Microsoft documentation. If the volume
does not have enough space, it can be expanded. For more information, see Amazon EBS Elastic
Volumes (p. 1720).
• Determine your upgrade path. You must upgrade the operating system to the same architecture. For
example, you must upgrade a 32-bit system to a 32-bit system. Windows Server 2008 R2 and later are
64-bit only.
• Disable antivirus and anti-spyware software and firewalls. These types of software can conflict with
the upgrade process. Re-enable antivirus and anti-spyware software and firewalls after the upgrade
completes.
• Update to the latest drivers as described in Migrate to latest generation instance types (p. 894).
• The Upgrade Helper Service only supports instances running Citrix PV drivers. If the instance is running
Red Hat drivers, you must manually upgrade those drivers (p. 745) first.
1. Create an AMI of the system you plan to upgrade for either backup or testing purposes. You can
then perform the upgrade on the copy to simulate a test environment. If the upgrade completes,
you can switch traffic to this instance with little downtime. If the upgrade fails, you can revert to the
backup. For more information, see Create a custom Windows AMI (p. 143).
882
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an in-place upgrade
2. Ensure that your Windows Server instance is using the latest network drivers. See Upgrade PV
drivers on Windows instances (p. 745) for information on upgrading your AWS PV driver.
3. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
4. In the navigation pane, choose Instances. Locate the instance. Make a note of the instance ID and
Availability Zone for the instance. You need this information later in this procedure.
5. If you are upgrading from Windows Server 2012 or 2012 R2 to Windows Server 2016, 2019, or
2022, perform the following on your instance before proceeding:
a. Uninstall the EC2Config service. For more information, see Stop, restart, delete, or uninstall
EC2Config (p. 715).
b. Install EC2Launch v1 or the EC2Launch v2 agent. For more information, see Configure a
Windows instance using EC2Launch (p. 702) and Configure a Windows instance using
EC2Launch v2 (p. 653).
c. Install the AWS Systems Manager SSM Agent. For more information, see Working with SSM
Agent in the AWS Systems Manager User Guide.
6. Create a new volume from a Windows Server installation media snapshot.
a. In the left navigation pane, under Elastic Block Store, choose Snapshots. In the search bar
filter, choose Public Snapshots.
b. Add the Owner alias filter to the search bar and choose amazon.
c. Add the Description filter and enter Windows. Select Enter.
d. Select the snapshot that matches the system architecture and language preference you are
upgrading to. For example, select Windows 2019 English Installation Media to upgrade to
Windows Server 2019.
e. Choose Actions, Create Volume.
f. In the Create Volume dialog box, choose the Availability Zone that matches your Windows
instance, and choose Create Volume.
7. In the Create Volume Request Succeeded message, choose the volume that you just created.
8. Choose Actions, Attach Volume.
9. In the Attach Volume dialog box, enter the instance ID of your Windows instance and choose
Attach.
10. Make the new volume available for use by following the steps at Make an Amazon EBS volume
available for use on Windows.
Important
Do not initialize the disk because doing so will delete the existing data.
11. In Windows PowerShell, switch to the new volume drive. Begin the upgrade by opening the
installation media volume you attached to the instance.
a. If you are upgrading to Windows Server 2016 or later, run the following:
Note
Running the setup.exe with the /dynamicupdate option set to disabled prevents
Windows from installing updates during the Windows Server upgrade process, as
installing updates during the upgrade can cause failures. You can install updates with
Windows Update after the upgrade completes.
If you are upgrading to an earlier version of Windows Server, run the following:
Sources\setup.exe
883
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an in-place upgrade
b. For Select the operating system you want to install, select the full installation SKU for your
Windows Server instance, and choose Next.
c. For Which type of installation do you want?, choose Upgrade.
d. Complete the wizard.
Windows Server Setup copies and processes files. After several minutes, your Remote Desktop session
closes. The time it takes to upgrade depends on the number of applications and server roles running on
your Windows Server instance. The upgrade process could take as little as 40 minutes or several hours.
The instance fails status check 1 of 2 during the upgrade process. When the upgrade completes, both
status checks pass. You can check the system log for console output or use Amazon CloudWatch metrics
for disk and CPU activity to determine whether the upgrade is progressing.
Note
If upgrading to Windows Server 2019, after the upgrade is complete you can change the
desktop background manually to remove the previous operating system name if desired.
If the instance has not passed both status checks after several hours, see Troubleshoot an
upgrade (p. 907).
When you run Upgrade Helper Service on the system before the upgrade, it performs the following tasks:
When you run Upgrade Helper Service on the system after the upgrade, it performs the following tasks:
• Enables the RealTimeIsUniversal registry key for the correct time synchronization.
• Restores the missing PV driver by executing the following command:
884
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an in-place upgrade
a. In the navigation pane, choose Snapshots, and next to the filter field, choose Public snapshots.
b. From the Search field, choose Owner alias, then =, then amazon (new console), or choose
Owner and then Amazon images (old console).
c. From the Search field, choose Description, then : (contains), and then enter Windows (new
console), or choose Description and then enter Windows (old console). Press Enter.
d. Select the snapshot that matches the system architecture of your instance. For example,
Windows 2012 Installation Media.
e. Choose Actions, Create volume from snapshot (new console) or Create Volume (old console).
f. In the Create volume dialog box, select the Availability Zone that matches your Windows
instance, and choose Create volume.
4. (New console) From the navigation pane, choose Volumes, and then choose the volume that you just
created
(Old console) In the Volume Successfully Created dialog box, choose the volume that you just
created.
5. Choose Actions, Attach volume.
6. In the Attach volume dialog box, enter the instance ID and choose Attach volume.
7. On your Windows instance, on the C:\ drive, create a folder named temp.
Important
This folder must be available in the same location after the upgrade. Creating the folder
in a Windows system folder or a user profile folder, such as the desktop, can cause the
upgrade to fail.
8. Download OSUpgrade.zip and extract the files into the C:\temp folder.
9. Run C:\temp\UpgradeHelperService.exe and review the C:\temp\Log.txt file for any
warnings.
10. Use Knowledge Base article 950376 from Microsoft to uninstall PowerShell from a Windows 2003
instance.
11. Begin the upgrade by using Windows Explorer to open the installation media volume that you
attached to the instance.
12. Run the Sources\Setup.exe file.
13. For Select the operating system you want to install, select the full installation SKU for your
Windows Server instance, and then choose Next.
14. For Which type of installation do you want?, choose Upgrade.
15. Complete the wizard.
Windows Server Setup copies and processes files. After several minutes, your Remote Desktop session
closes. The time it takes to upgrade depends on the number of applications and server roles running on
your Windows Server instance. The upgrade process could take as little as 40 minutes or several hours.
The instance fails status check 1 of 2 during the upgrade process. When the upgrade completes, both
885
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
status checks pass. You can check the system log for console output or use Amazon CloudWatch metrics
for disk and CPU activity to determine whether the upgrade is progressing.
Contents
• Related services (p. 886)
• Execution options (p. 886)
• Upgrade Windows Server (p. 888)
• Upgrade SQL Server (p. 891)
Related services
The following AWS services are used in the automated upgrade process:
• AWS Systems Manager. AWS Systems Manager is a powerful, unified interface for centrally managing
your AWS resources. For more information, see the AWS Systems Manager User Guide.
• AWS Systems Manager Agent (SSM Agent) is Amazon software that can be installed and configured
on an Amazon EC2 instance, an on-premises server, or a virtual machine (VM). SSM Agent makes it
possible for Systems Manager to update, manage, and configure these resources. The agent processes
requests from the Systems Manager service in the AWS Cloud, and then runs them as specified in the
request. For more information, see Working with SSM Agent in the AWS Systems Manager User Guide.
• AWS Systems Manager SSM runbooks. An SSM runbook defines the actions that Systems Manager
performs on your managed instances. SSM runbooks use JavaScript Object Notation (JSON) or YAML,
and they include steps and parameters that you specify. This topic uses two Systems Manager SSM
runbooks for automation. For more information, see AWS Systems Manager Automation runbook
reference in the AWS Systems Manager User Guide.
Execution options
When you select Automation on the Systems Manager console, select Execute. After you select an
Automation document, you are then prompted to choose an automation execution option. You choose
886
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
from the following options. In the steps for the paths provided later in this topic, we use the Simple
execution option.
Simple execution
Choose this option if you want to update a single instance but do not want to go through each
automation step to audit the results. This option is explained in further detail in the upgrade steps that
follow.
Rate control
Choose this option if you want to apply the upgrade to more than one instance. You define the following
settings.
• Parameter
This setting, which is also set in Multi-Account and Region settings, defines how your automation
branches out.
• Targets
Select the target to which you want to apply the automation. This setting is also set in Multi-Account
and Region settings.
• Parameter Values
In AWS, a resource is an entity you can work with. Examples include Amazon EC2 instances, AWS
CloudFormation stacks, or Amazon S3 buckets. If you work with multiple resources, it might be useful
to manage them as a group as opposed to moving from one AWS service to another for every task.
In some cases, you may want to manage large numbers of related resources, such as EC2 instances
that make up an application layer. In this case, you will likely need to perform bulk actions on these
resources at one time.
• Tags
Tags help you categorize your AWS resources in different ways, for example, by purpose, owner, or
environment. This categorization is useful when you have many resources of the same type. You can
quickly identify a specific resource using the assigned tags.
• Rate Control
Rate Control is also set in Multi-Account and Region settings. When you set the rate control
parameters, you define how many of your fleet to apply the automation to, either by target count or
by percentage of the fleet.
In addition to the parameters specified under Rate Control that are also used in the Multi-Account and
Region settings, there are two additional settings:
Specify multiple AWS Regions where you want to run the automation.
Manual execution
887
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
This option is similar to Simple execution, but allows you to step through each automation step and
audit the results.
To upgrade your Windows Server 2008 R2 instance to Windows Server 2016, 2019, or 2022, an in-place
upgrade is performed twice, first from Windows Server 2008 R2 to Windows Server 2012 R2, and then
from Windows Server 2012 R2 to Windows Server 2016, 2019, or 2022. Directly upgrading Windows
Server 2008 R2 to Windows Server 2016, 2019, or 2022 is not supported.
In this workflow, the automation creates an AMI from the instance and then launches the new AMI in
the subnet you provide. The automation workflow performs an in-place upgrade from Windows Server
2008 R2, 2016, 2019 to the selected version (Windows Server 2012 R2, 2016, 2019, or 2022). It also
updates or installs the AWS drivers required by the upgraded instance. After the upgrade is complete, the
workflow creates a new AMI and terminates the upgraded instance. If you upgrade from Windows Server
2008 R2 to Windows Server 2016, 2019, or 2022, the automation creates two AMIs because the in-place
upgrade is performed twice.
• Current running instance. The first AMI is the current running instance, which is not upgraded. This
AMI is used to launch another instance to run the in-place upgrade. When the process is complete, this
AMI is deleted from your account, unless you specifically request to keep the original instance. This
setting is handled by the parameter KeepPreUpgradeImageBackUp (default value is false, which
means the AMI is deleted by default).
• Upgraded AMI. This AMI is the outcome of the automation process.
The final result is one AMI, which is the upgraded instance of the AMI.
When the upgrade is complete, you can test your application functionality by launching the new AMI
in your Amazon VPC. After testing, and before you perform another upgrade, schedule application
downtime before completely switching to the upgraded instance.
Prerequisites
In order to automate your Windows Server upgrade with the AWS Systems Manager Automation
document, you must perform the following tasks:
888
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
• Create an IAM role with the specified IAM policies to allow Systems Manager to perform automation
tasks on your Amazon EC2 instances and verify that you meet the prerequisites to use Systems
Manager. For more information, see Creating a role to delegate permissions to an AWS service in the
AWS Identity and Access Management User Guide.
• Select the option for how you want the automation to be run (p. 886). The options for execution
are Simple execution, Rate control, Multi-account and Region, and Manual execution. For more
information about these options, see Execution options (p. 886).
• Verify that SSM Agent is installed on your instance. For more information see Installing and
configuring SSM Agent on Amazon EC2 instances for Windows Server.
• Windows PowerShell 3.0 or later must be installed on your instance.
• For instances that are joined to a Microsoft Active Directory domain, we recommend specifying
a SubnetId that does not have connectivity to your domain controllers to help avoid hostname
conflicts.
• The SubnetId specified must be a public subnet with the auto-assign public IPv4 address set to true.
For more information, see Modifying the Public IPv4 Addressing Attribute for Your Subnet in the
Amazon VPC User Guide.
• This Automation works with only Windows Server 2008 R2, 2012 R2, 2016, and 2019 instances.
• This Automation works on only Amazon EC2 instances with an unencrypted Amazon EBS root volume.
If the specified instance has an encrypted root volume, the automation fails.
• Verify that the instance has 20 GB of free disk space in the boot disk.
• If the instance does not use a Windows license provided by AWS, then specify an Amazon EBS
snapshot ID that includes Windows Server 2012 R2 installation media. To do this:
1. Verify that the Amazon EC2 instance is running Windows Server 2012 or later.
2. Create a 6 GB Amazon EBS volume in the same Availability Zone where the instance is running.
Attach the volume to the instance. Mount it, for example, as drive D.
3. Right-click the ISO and mount it to an instance as, for example, drive E.
4. Copy the content of the ISO from drive E:\ to drive D:\
5. Create an Amazon EBS snapshot of the 6 GB volume created in step 2 above.
889
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
6. Choose Execute automation to input the parameters for this document. Leave Simple execution
selected at the top of the page.
7. Enter the requested parameters based on the following guidance.
• InstanceID
Type: String
(Required) The instance running Windows Server 2008 R2, 2012 R2, 2016, or 2019 with the SSM
agent installed.
• InstanceProfile.
Type: String
(Required) The IAM instance profile. This is the IAM role used to perform the Systems Manager
automation against the Amazon EC2 instance and AWS AMIs. For more information, see Create an
IAM Instance Profile for Systems Manager in the AWS Systems Manager User Guide.
• TargetWindowsVersion
Type: String
Type: String
(Required) This is the subnet for the upgrade process and where your source EC2 instance resides.
Verify that the subnet has outbound connectivity to AWS services, including Amazon S3, and also
to Microsoft (in order to download patches).
• KeepPreUpgradedBackUp
Type: String
(Optional) If this parameter is set to true, the automation retains the image created from the
instance. The default setting is false.
• RebootInstanceBeforeTakingImage
Type: String
(Optional) The default is false (no reboot). If this parameter is set to true, Systems Manager
reboots the instance before creating an AMI for the upgrade.
8. After you have entered the parameters, choose Execute. When the automation begins, you can
monitor the execution progress.
9. When the automation completes, you will see the AMI ID. You can launch the AMI to verify that the
Windows OS is upgraded.
Note
It is not necessary for the automation to run all of the steps. The steps are conditional
based on the behavior of the automation and instance. Systems Manager might skip some
steps that are not required.
Additionally, some steps may time out. Systems Manager attempts to upgrade and install
all of the latest patches. Sometimes, however, patches time out based on a definable
timeout setting for the given step. When this happens, the Systems Manager automation
continues to the next step to ensure that the internal OS is upgraded to the target Windows
Server version.
890
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
10. After the automation completes, you can launch an Amazon EC2 instance using the AMI ID to review
your upgrade. For more information about how to create an Amazon EC2 instance from an AWS AMI,
see How do I launch an EC2 instance from a custom Amazon Machine Image (AMI)?
In this workflow, the automation creates an AMI from the instance and then launches the new AMI in the
subnet you provide. The automation then performs an in-place upgrade of SQL Server. After the upgrade
is complete, the automation creates a new AMI before terminating the upgraded instance.
• Current running instance. The first AMI is the current running instance, which is not upgraded. This
AMI is used to launch another instance to run the in-place upgrade. When the process is complete, this
AMI is deleted from your account, unless you specifically request to keep the original instance. This
setting is handled by the parameter KeepPreUpgradeImageBackUp (default value is false, which
means the AMI is deleted by default).
• Upgraded AMI. This AMI is the outcome of the automation process.
The final result is one AMI, which is the upgraded instance of the AMI.
When the upgrade is complete, you can test your application functionality by launching the new AMI
in your Amazon VPC. After testing, and before you perform another upgrade, schedule application
downtime before completely switching to the upgraded instance.
Prerequisites
In order to automate your SQL Server upgrade with the AWS Systems Manager Automation document,
you must perform the following tasks:
• Create an IAM role with the specified IAM policies to allow Systems Manager to perform automation
tasks on your Amazon EC2 instances and verify that you meet the prerequisites to use Systems
Manager. For more information, see Creating a role to delegate permissions to an AWS service in the
AWS Identity and Access Management User Guide.
• Select the option for how you want the automation to be run (p. 886). The options for execution
are Simple execution, Rate control, Multi-account and Region, and Manual execution. For more
information about these options, see Execution options (p. 886).
891
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
• The Amazon EC2 instance must use Windows Server 2008 R2 or later and SQL Server 2008 or later.
• Verify that SSM Agent is installed on your instance. For more information, see Working with SSM
Agent on Amazon EC2 instances for Windows Server.
• Verify that the instance has 20 GB of free disk space in the instance boot disk.
• For instances that use a Bring Your Own License (BYOL) SQL Server version, the following additional
prerequisites apply:
• Provide an Amazon EBS snapshot ID that includes the target SQL Server installation media. To do
this:
1. Verify that the Amazon EC2 instance is running Windows Server 2008 R2 or later.
2. Create a 6 GB Amazon EBS volume in the same Availability Zone where the instance is running.
Attach the volume to the instance. Mount it, for example, as drive D.
3. Right-click the ISO and mount it to an instance as, for example, drive E.
4. Copy the content of the ISO from drive E:\ to drive D:\
5. Create an Amazon EBS snapshot of the 6 GB volume created in step 2.
• The upgrade can be performed on only a SQL Server using Windows authentication.
• Verify that no security patch updates are pending on the instances. Open Control Panel, then choose
Check for updates.
• SQL Server deployments in HA and mirroring mode are not supported.
1. If you haven't already, download the SQL Server 2016 .iso file and mount it to the source server.
2. After the .iso file is mounted, copy all of the component files and place them on any volume of your
choice.
3. Take an Amazon EBS snapshot of the volume and copy the snapshot ID onto a clipboard for later
use. For more information about creating an EBS snapshot, see Create Amazon EBS snapshots.
4. Attach the instance profile to the Amazon EC2 source instance. This allows Systems Manager
to communicate with the EC2 instance and run commands on it after it is added to the AWS
Systems Manager service. For this example, we named the role SSM-EC2-Profile-Role with the
AmazonSSMManagedInstanceCore policy attached to the role. See Create an IAM instance profile
for Systems Manager in the AWS Systems Manager User Guide.
5. In the AWS Systems Manager console, in the left navigation pane, choose Managed Instances. Verify
that your EC2 instance is in the list of managed instance. If you don't see your instance after a few
minutes, see Where Are My Instances? in the AWS Systems Manager User Guide.
6. In the left navigation pane, under Change Management choose Automation.
7. Choose Execute automation.
8. Search for the automation document called AWSEC2-CloneInstanceAndUpgradeSQLServer.
9. Choose the AWSEC2-CloneInstanceAndUpgradeSQLServer SSM document, and then choose
Next.
10. Ensure that the Simple execution option is selected.
892
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Perform an automated upgrade
• InstanceId
Type: String
Type: String
Type: String
(Required) The Snapshot ID for the target SQL Server installation media. This parameter is not
required for SQL Server license-included instances.
• SubnetId
Type: String
(Required) This is the subnet for the upgrade process and where your source EC2 instance resides.
Verify that the subnet has outbound connectivity to AWS services, including Amazon S3, and also
to Microsoft (in order to download patches).
• KeepPreUpgradedBackUp
Type: String
(Optional) If this parameter is set to true, the automation retains the image created from the
instance. The default setting is false.
• RebootInstanceBeforeTakingImage
Type: String
(Optional) The default is false (no reboot). If this parameter is set to true, Systems Manager
reboots the instance before creating an AMI for the upgrade.
• TargetSQLVersion
Type: String
893
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate to latest generation instance types
When migrating to Nitro-based (p. 210) instances, including bare metal instances, we recommend that
you follow the steps in this topic in the following cases:
For more information, see Amazon EC2 Update — Additional Instance Types, Nitro System, and CPU
Options.
Note
The following migration procedures can be performed on Windows Server version 2008 R2
and later. To migrate Linux instances to the latest generation instance types, see Change the
instance type.
Contents
• Part 1: Install and upgrade AWS PV drivers (p. 895)
• Part 2: Install and upgrade ENA (p. 895)
• Part 3: Upgrade AWS NVMe drivers (p. 896)
• Part 4: Update EC2Config and EC2Launch (p. 896)
• Part 5: Install the serial port driver for bare metal instances (p. 897)
• Part 6: Update power management settings (p. 897)
• Part 7: Update Intel chipset drivers for new instance types (p. 897)
• (Alternative) Upgrade the AWS PV, ENA, and NVMe drivers using AWS Systems Manager (p. 898)
• Migrate to Xen instance types from Nitro instance types (p. 899)
Note
Alternatively, you can use the AWSSupport-UpgradeWindowsAWSDrivers automation
document to automate the procedures described in Part 1, Part 2, and Part 3. If you choose to
use the automated procedure, see (Alternative) Upgrade the AWS PV, ENA, and NVMe drivers
using AWS Systems Manager (p. 898), and then continue with Part 4 and Part 5.
This procedure assumes that you are currently running on a previous generation Xen-based instance
type, such as an M4 or C4, and you are migrating to an instance based on the Nitro System (p. 210), such
as an M5 or C5.
You must use PowerShell version 3.0 or later to successfully perform the upgrade.
894
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate to latest generation instance types
Note
When migrating to the latest generation instances, the static IP or custom DNS network settings
on the existing ENI may be lost as the instance will default to a new Enhanced Networking
Adapter device.
Before following the steps in this procedure, we recommend that you create a backup of the instance.
From the EC2 console, choose the instance that requires the migration, open the context (right-click)
menu, and choose Instance State, Stop.
Warning
When you stop an instance, the data on any instance store volumes is erased. To preserve data
on instance store volumes, ensure that you back up the data to persistent storage.
Open the context (right-click) menu for the instance in the EC2 console, choose Image, and then choose
Create Image.
Note
Parts 4 and 5 of these instructions can be completed after you migrate or change the instance
type to the latest generation, such as M5 or C5. However, we recommend that you complete
them before you migrate if you are migrating specifically to an EC2 Bare Metal instance type.
Use the following procedure to perform an in-place upgrade of AWS PV drivers, or to upgrade from Citrix
PV drivers to AWS PV drivers on Windows Server 2008 R2, Windows Server 2012, Windows Server 2012
R2, Windows Server 2016, or Windows Server 2019. For more information, see Upgrade PV drivers on
Windows instances (p. 745).
To upgrade a Domain Controller, see Upgrade a domain controller (AWS PV upgrade) (p. 746).
1. Connect to the instance using Remote Desktop and prepare the instance for upgrade. Take all non-
system disks offline before you perform the upgrade. If you are performing an in-place update
of AWS PV drivers, this step is not required. Set non-essential services to Manual start-up in the
Services console.
2. Download the latest driver package to the instance.
3. Extract the contents of the folder and run AWSPVDriverSetup.msi.
After running the MSI, the instance automatically reboots and upgrades the driver. The instance may not
be available for up to 15 minutes.
After the upgrade is complete and the instance passes both health checks in the Amazon EC2 console,
connect to the instance using Remote Desktop and verify that the new driver was installed. In Device
Manager, under Storage Controllers, locate AWS PV Storage Host Adapter. Verify that the driver
version is the same as the latest version listed in the Driver Version History table. For more information,
see AWS PV driver package history (p. 741).
895
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate to latest generation instance types
instance attribute to activate enhanced networking. You can only enable this attribute on supported
instance types and only if the ENA driver is installed. For more information, see Enable enhanced
networking with the Elastic Network Adapter (ENA) on Windows instances (p. 1279).
When the EC2Config and EC2Launch services are updated, new Windows AMIs from AWS include the
latest version of the service. However, you must update your own Windows AMIs and instances with the
latest version of EC2Config and EC2Launch.
896
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate to latest generation instance types
2. Run EC2Install.exe. For a complete list of options, run EC2Install with the /? option. By
default, setup displays prompts. To run the command with no prompts, use the /quiet option.
For more information, see Install the latest version of EC2Config (p. 713).
1. If you have already installed and configured EC2Launch on an instance, make a backup of the
EC2Launch configuration file. The installation process does not preserve changes in this file. By
default, the file is located in the C:\ProgramData\Amazon\EC2-Windows\Launch\Config
directory.
2. Download EC2-Windows-Launch.zip to a directory on the instance.
3. Download install.ps1 to the same directory where you downloaded EC2-Windows-Launch.zip.
4. Run install.ps1.
Note
To avoid installation errors, run the install.ps1 script as an administrator.
5. If you made a backup of the EC2Launch configuration file, copy it to the C:\ProgramData\Amazon
\EC2-Windows\Launch\Config directory.
For more information, see Configure a Windows instance using EC2Launch (p. 702).
Part 5: Install the serial port driver for bare metal instances
The i3.metal instance type uses a PCI-based serial device rather than an I/O port-based serial device.
The latest Windows AMIs automatically use the PCI-based serial device and have the serial port driver
installed. If you are not using an instance launched from an Amazon-provided Windows AMI dated
2018.04.11 or later, you must install the Serial Port Driver to enable the serial device for EC2 features
such as Password Generation and Console Output. The latest EC2Config and EC2Launch utilities also
support i3.metal and provide additional functionality. Follow the steps in Part 4, if you have not yet done
so.
897
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate to latest generation instance types
(Alternative) Upgrade the AWS PV, ENA, and NVMe drivers using
AWS Systems Manager
The AWSSupport-UpgradeWindowsAWSDrivers automation document automates the steps described
in Part 1, Part 2, and Part 3. This method can also repair an instance where the driver upgrades have
failed.
To automatically upgrade the AWS PV, ENA, and NVMe drivers using AWS Systems Manager
Instance ID
898
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
• False — (Default) To perform an online installation, leave this option selected. The instance
is restarted during the upgrade process.
Important
Online and offline upgrades create an AMI before attempting the upgrade operations.
The AMI persists after the automation completes. Secure your access to the AMI, or
delete it if it is no longer needed.
SubnetId
1. AWS PV drivers must be installed and upgraded on a Nitro instance before you migrate to a Xen
instance. For steps to install and upgrade AWS PV drivers, see Part 1: Install and upgrade AWS PV
drivers (p. 895).
2. Update to the latest EC2Launch v2 version. See Migrate to EC2Launch v2 (p. 660) for steps.
3. Open a PowerShell session and run the following command as an administrator to sysprep the
device drivers. Running sysprep ensures that early boot storage drivers required for booting on Xen
instances are properly registered with Windows.
Note
Running the command using PowerShell (x86) versions will result in an error. This command
adds only the boot-critical device drivers to the critical device database. It does not run the
full sysprep preparation.
4. Perform the migration to a Xen instance type when the sysprep process completes.
899
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
system. You can use the replatforming assistant with any Windows Server virtual machines (VMs) hosted
in the cloud, or with on-premises environments running Microsoft SQL Server 2008 and later. The tool
checks for common incompatibilities, exports databases from the Windows VM, and imports into an EC2
instance running Microsoft SQL Server 2017 on Ubuntu 16.04. The automated process results in a ready-
to-use Linux VM configured with your selected SQL Server databases that can be used for experimenting
and testing.
Contents
• Concepts (p. 900)
• Related services (p. 900)
• How Windows to Linux replatforming assistant for Microsoft SQL Server works (p. 900)
• Components (p. 901)
• Setting up (p. 901)
• Get started (p. 903)
Concepts
The following terminology and concepts are central to your understanding and use of the Windows to
Linux replatforming assistant for Microsoft SQL Server Databases.
Backup
A Microsoft SQL Server backup copies data or log records from a Microsoft SQL Server database or its
transaction log to a backup device, such as a disk. For more information, see Backup Overview (Microsoft
SQL Server).
Restore
A logical and meaningful sequence for restoring a set of Microsoft SQL Server backups. For more
information, see Restore and recovery overview ( SQL Server).
Replatform
A Microsoft SQL Server database can be replatformed from an EC2 Windows instance to an EC2 Linux
instance running Microsoft SQL Server. It can also be replatformed to the VMware Cloud running
Microsoft SQL Server Linux on AWS.
Related services
AWS Systems Manager (Systems Manager) gives you visibility and control of your infrastructure on AWS.
The Windows to Linux replatforming assistant for Microsoft SQL Server Databases uses Systems Manager
to move your Microsoft SQL databases to Microsoft SQL Server on EC2 Linux. For more information
about Systems Manager, see the AWS Systems Manager User Guide.
900
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
When you run the PowerShell script for the Windows to Linux replatforming assistant for Microsoft
SQL Server Databases on the source Microsoft SQL Server databases, the Windows instance backs up
the databases to an encrypted Amazon Simple Storage Service (S3) storage bucket. It then restores the
backups to an existing Microsoft SQL Server on EC2 Linux instance, or it launches a new Microsoft SQL
Server on EC2 Linux instance and restores the backups to the newly created instance. This process can be
used to replatform your 2-tier databases running enterprise applications. It also enables you to replicate
your database to Microsoft SQL Server on Linux to test the application while the source Microsoft SQL
Server remains online. After testing, you can schedule application downtime and rerun the PowerShell
backup script during your final cutover.
The entire replatforming process can also be automated and run unattended. You can run the Systems
Manager SSM document AWSEC2-SQLServerDBRestore to import your existing database backup files
into Microsoft SQL Server on EC2 Linux without using the PowerShell backup script.
Components
The Windows to Linux replatforming assistant for Microsoft SQL Server Databases script consists of two
main components:
1. A PowerShell backup script, which backs up on-premises Microsoft SQL Server databases
to an Amazon S3 storage bucket. It then invokes the SSM Automation document AWSEC2-
SQLServerDBRestore to restore the backups to a Microsoft SQL Server on EC2 Linux instance.
2. An SSM Automation document named AWSEC2-SQLServerDBRestore, which restores database
backups to Microsoft SQL Server on EC2 Linux. This automation restores Microsoft SQL Server
database backups stored in Amazon S3 to Microsoft SQL Server 2017 running on an EC2 Linux
instance. You can provide your own EC2 instance running Microsoft SQL Server 2017 Linux, or
the automation launches and configures a new EC2 instance with Microsoft SQL Server 2017 on
Ubuntu 16.04. The automation supports the restoration of full, differential, and transactional log
backups, and accepts multiple database backup files. The automation automatically restores the
most recent valid backup of each database in the files provided. For more information, see AWSEC2-
SQLServerDBRestore.
Setting up
This section covers the steps necessary to run the Windows to Linux replatforming script.
Contents
• Prerequisites (p. 901)
• Prerequisites for replatforming to an existing EC2 instance (p. 902)
Prerequisites
In order to run the Windows to Linux replatforming assistant for Microsoft SQL Server Databases script,
you must do the following:
To install the AWS PowerShell module, follow the steps listed in Installing the AWS Tools for
PowerShell on Windows. We recommend that you use PowerShell 3.0 or later for the backup script
to work properly.
2. Install the Windows to Linux replatforming assistant PowerShell backup script
To run the Windows to Linux replatforming assistant, download the PowerShell backup script:
MigrateSQLServerToEC2Linux.ps1.
901
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
To add and configure the AWS user profile, see the steps listed in Managing Profiles in the AWS Tools
for PowerShell User Guide. Set the following IAM policy for your user profile.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::123456789012:role/DevTeam*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"ec2:RebootInstances",
"ssm:SendCommand",
"ssm:GetAutomationExecution",
"ec2:DescribeInstances",
"ssm:ListCommands",
"ec2:CreateTags",
"s3:CreateBucket",
"ec2:RunInstances",
"s3:ListBucket",
"ssm:GetCommandInvocation",
"s3:PutEncryptionConfiguration",
"ec2:DescribeImages",
"s3:PutObject",
"s3:GetObject",
"ssm:StartAutomationExecution",
"ssm:DescribeInstanceInformation",
"s3:DeleteObject",
"ssm:ListCommandInvocations",
"s3:DeleteBucket",
"ec2:DescribeInstanceStatus"
],
"Resource": "*"
}
]
}
To create an IAM instance profile role in order to run Systems Manager on EC2 Linux, see the steps
listed under Create an IAM instance profile for Systems Manager in the AWS Systems Manager User
Guide.
1. Configure the EC2 instance with an AWS Identity and Access Management (IAM) instance profile and
attach the AmazonSSMManagedInstanceCore managed policy.
For information about creating an IAM instance profile for Systems Manager and attaching it to an
instance, see the following topics in the AWS Systems Manager User Guide:
902
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
2. Verify that SSM Agent is installed on your EC2 instance. For more information, see Working with
SSM Agent on EC2 instances for Windows Server in the AWS Systems Manager User Guide.
3. Verify that the EC2 instance has enough free disk space to download and restore the Microsoft SQL
Server backups.
Get started
This section contains the PowerShell parameter definitions and scripts for replatforming your databases.
For more information about how to use PowerShell scripts, see PowerShell.
Topics
• Run the Windows to Linux replatforming assistant for Microsoft SQL Server script (p. 903)
• Parameters (p. 904)
Run the Windows to Linux replatforming assistant for Microsoft SQL Server
script
The following common scenarios and example PowerShell scripts demonstrate how to replatform your
Microsoft SQL Server databases using Windows to Linux replatforming assistant for Microsoft SQL
Server Databases.
Important
The Windows to Linux Replatforming Assistant for Microsoft SQL Server Databases resets the
SQL Server server administrator (SA) user password on the target instance every time that it is
run. After the replatform process is complete, you must set your own SA user password before
you can connect to the target SQL Server instance.
Syntax
The Windows to Linux replatforming assistant for Microsoft SQL Server Databases script adheres to the
syntax shown in the following example.
The following example shows how to move a database named AdventureDB to an EC2 Microsoft SQL
Server on Linux instance, with an instance ID of i-024689abcdef, from the Microsoft SQL Server
Instance named MSSQLSERVER. The backup directory to be used is D:\\Backup and the AWS Region is
us-east-2.
Example 2: Move a database to an EC2 instance using the AWS credentials profile
903
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
The following example shows how to move the database in Example 1 using the AWS credentials profile:
DBMigration.
The following example shows how to create an m5.large type EC2 Linux instance in subnet-abc127
using the Key Pair customer-ec2-keypair and then moving AdventureDB and TestDB to the new
instance from the database used in Examples 1 and 2.
The following example shows how to create an m5.large type EC2 Linux instance in subnet-abc127
using the Key Pair customer-ec2-keypair and then migrating all databases to the instance from
databases used in Examples 1 and 2.
Parameters
The following parameters are used by the PowerShell script to replatform your Microsoft SQL Server
databases.
-SqlServerInstanceName
The name of the Microsoft SQL Server instance to be backed up. If a value for
SqlServerInstanceName is not provided, $env:ComputerName is used by default.
Type: String
Required: No
-DBNames
The names of the databases to be backed up and restored. Specify the names of the databases
in a comma-separated list (for example, adventureDB,universityDB). Either the DBNames or
MigrateAllDBs parameter is required.
Type: Object
Required: No
904
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
-MigrateAllDBs
This switch is disabled by default. If this switch is enabled, the automation migrates all databases except
for the system databases (master, msdb, tempdb). Either the DBNames or MigrateAllDBs parameter is
required.
Type: SwitchParameter
Required: No
-PathForBackup
Type: String
Required: Yes
-SetSourceDBModeReadOnly
This switch is disabled by default. If this switch is enabled, it makes the database read-only during
migration.
Type: SwitchParameter
Required: No
-IamInstanceProfileName
Enter the AWS IAM instance role with permissions to run Systems Manager Automation on your behalf.
See Getting Started with Automation in the AWS Systems Manager User Guide.
Type: String
Required: Yes
-AWSRegion
Enter the AWS Region where your Amazon S3 buckets are created to store database backups.
Type: String
Required: Yes
-EC2InstanceId
To restore Microsoft SQL Server databases to an existing EC2 instance running Microsoft SQL Server
Linux, enter the instance ID of the instance. Make sure that the EC2 instance already has the AWS
Systems Manager SSM Agent installed and running.
Type: String
Required: No
-EC2InstanceType
To restore Microsoft SQL Server databases to a new EC2 Linux instance, enter the instance type of the
instance to be launched.
905
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate Microsoft SQL Server from Windows to Linux
Type: String
Required: No
-EC2KeyPair
To restore Microsoft SQL Server databases to a new EC2 Linux instance, enter the name of the EC2 Key
Pair to be used to access the instance. This parameter is recommended if you are creating a new EC2
Linux instance.
Type: String
Required: No
-SubnetId
This parameter is required when creating a new EC2 Linux instance. When creating a new EC2 Linux
instance, if SubnetId is not provided, the AWS user default subnet is used to launch the EC2 Linux
instance.
Type: String
Required: No
-AWSProfileName
The name of the AWS profile that the automation uses when connecting to AWS services. For more
information on the required user permissions, see Getting Started with Automation in the AWS Systems
Manager User Guide. If a profile is not entered, the automation uses your default AWS profile.
Type: String
Required: No
-AWSProfileLocation
The location of the AWS Profile if the AWS Profile is not stored in the default location.
Type: String
Required: No
-GeneratePresignedUrls
This parameter is only used when replatforming to non-EC2 instances, such as to VMware Cloud on AWS
or on-premises VMs.
Type: SwitchParameter
Required: No
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more
information, see About Common Parameters in the Microsoft PowerShell documentation.
Required: No
906
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Troubleshoot an upgrade
Troubleshoot an upgrade
AWS provides upgrade support for issues or problems with the Upgrade Helper Service, an AWS utility
that helps you perform in-place upgrades involving Citrix PV drivers.
After the upgrade, the instance might temporarily experience higher than average CPU utilization while
the .NET Runtime Optimization service optimizes the .NET framework. This is expected behavior.
If the instance has not passed both status checks after several hours, check the following.
• If you upgraded to Windows Server 2008 and both status checks fail after several hours, the upgrade
may have failed and be presenting a prompt to Click OK to confirm rolling back. Because the console
is not accessible at this state, there is no way to click the button. To get around this, perform a reboot
via the Amazon EC2 console or API. The reboot takes ten minutes or more to initiate. The instance
might become available after 25 minutes.
• Remove applications or server roles from the server and try again.
If the instance does not pass both status checks after removing applications or server roles from the
server, do the following.
• Stop the instance and attach the root volume to another instance. For more information, see the
description of how to stop and attach the root volume to another instance in "Waiting for the
metadata service" (p. 1918).
• Analyze Windows Setup log files and event logs for failures.
For other issues or problems with an operating system upgrade or migration, we recommend reviewing
the articles listed in Before you begin an in-place upgrade (p. 882).
For information about identifying Linux instances, see Identify EC2 Linux instances in the Amazon EC2
User Guide for Linux Instances.
907
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Inspect the system virtual machine generation identifier
Alternatively, if you're using Windows PowerShell, use the Get-WmiObject cmdlet as follows:
In the following example output, the UUID starts with "EC2", which indicates that the system is probably
an EC2 instance.
EC2AE145-D1DC-13B2-94ED-012345ABCDEF
For instances using SMBIOS 2.4, the UUID might be represented in little-endian format; for example:
45E12AEC-DCD1-B213-94ED-012345ABCDEF
You can create a sample application to retrieve the virtual machine generation identifier from your
instances running Windows. For more information, see Obtaining the virtual machine generation
identifier in the Microsoft documentation.
To set up a Windows HPC cluster on Amazon EC2, complete the following tasks:
For more information about high performance computing, see High Performance Computing (HPC) on
AWS.
908
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Prerequisites
Prerequisites
You must launch your instances in a VPC. You can use the default VPC or create a nondefault VPC. For
more information, see Getting Started in the Amazon VPC User Guide.
1. Use the New-EC2SecurityGroup cmdlet to create the security group for the domain controller. Note
the ID of the security group in the output.
2. Use the New-EC2SecurityGroup cmdlet to create the security group for the domain members. Note
the ID of the security group in the output.
3. Use the New-EC2SecurityGroup cmdlet to create the security group for the HPC cluster. Note the ID
of the security group in the output.
1. Create the following rules to add to the domain controller security group. Replace the placeholder
security group ID with the ID of the domain member security group and the placeholder CIDR block
with the CIDR block of your network.
909
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 1: Create your security groups
2. Use the Grant-EC2SecurityGroupIngress cmdlet to add the rules to the domain controller security
group.
For more information about these security group rules, see the following Microsoft article: How to
configure a firewall for domains and trusts.
3. Create the following rules to add to the domain member security group. Replace the placeholder
security group ID with the ID of the domain controller security group.
4. Use the Grant-EC2SecurityGroupIngress cmdlet to add the rules to the domain member security
group.
5. Create the following rules to add to the HPC cluster security group. Replace the placeholder security
group ID with the ID of the HPC cluster security group and the placeholder CIDR block with the CIDR
block of your network.
910
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 2: Set up your Active Directory domain controller
6. Use the Grant-EC2SecurityGroupIngress cmdlet to add the rules to the HPC cluster security group.
For more information about these security group rules, see the following Microsoft article: HPC
Cluster Networking: Windows Firewall configuration.
7. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
8. In the navigation pane, choose Security Groups. Verify that the all three security groups appear in
the list and have the required rules.
911
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 3: Configure your head node
Connect to the instance you created, and configure the server as a domain controller for the HPC cluster.
1. Connect to your Domain Controller instance. For more information, see Connect to your
Windows instance.
2. Open Server Manager, and add the Active Directory Domain Services role.
3. Promote the server to a domain controller using Server Manager or by running DCPromo.exe.
4. Create a new domain in a new forest.
5. Type hpc.local as the fully qualified domain name (FQDN).
6. Select Forest Functional Level as Windows Server 2008 R2.
7. Ensure that the DNS Server option is selected, and then choose Next.
8. Select Yes, the computer will use an IP address automatically assigned by a DHCP server (not
recommended).
9. When prompted, choose Yes to continue.
10. Complete the wizard and then select Reboot on Completion.
11. Connect to the instance as hpc.local\administrator.
12. Create a domain user hpc.local\hpcuser.
Launch an instance and then configure it as a member of the hpc.local domain and with the necessary
user accounts.
1. Launch an instance and name it HPC-Head. When you launch the instance, select both of these
security groups: SG - Windows HPC Cluster and SG - Domain Member.
2. Connect to the instance and get the existing DNS server address using the following command:
IPConfig /all
912
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 4: Set up the compute node
3. Update the TCP/IPv4 properties of the HPC-Head NIC to include the Elastic IP address for the
Domain Controller instance as the primary DNS, and then add the additional DNS IP address
from the previous step.
4. Join the machine to the hpc.local domain using the credentials for hpc.local\administrator
(the domain administrator account).
5. Add hpc.local\hpcuser as the local administrator. When prompted for credentials, use
hpc.local\administrator, and then restart the instance.
6. Connect to HPC-Head as hpc.local\hpcuser.
a. Download the HPC Pack to HPC-Head from the Microsoft Download Center. Choose the HPC
Pack for the version of Windows Server on HPC-Head.
b. Extract the files to a folder, open the folder, and double-click setup.exe.
c. On the Installation page, select Create a new HPC cluster by creating a head node, and then
choose Next.
d. Accept the default settings to install all the databases on the Head Node, and then choose Next.
e. Complete the wizard.
a. In the wizard, select the default option (5), and then choose Next.
b. Complete the wizard accepting default values on all screens, and choose how you want to
update the server and participate in customer feedback.
c. Choose Configure.
3. Select Provide Network Credentials, then provide the hpc.local\hpcuser credentials.
4. Select Configure the naming of new nodes, and then choose OK.
5. Select Create a node template.
First, launch an instance, and then configure it as a member of the hpc.local domain with the
necessary user accounts.
913
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 4: Set up the compute node
1. Launch an instance and name it HPC-Compute. When you launch the instance, select the following
security groups: SG - Windows HPC Cluster and SG - Domain Member.
2. Log in to the instance and get the existing DNS server address from HPC-Compute using the
following command:
IPConfig /all
3. Update the TCP/IPv4 properties of the HPC-Compute NIC to include the Elastic IP address of the
Domain Controller instance as the primary DNS. Then add the additional DNS IP address from
the previous step.
4. Join the machine to the hpc.local domain using the credentials for hpc.local\administrator
(the domain administrator account).
5. Add hpc.local\hpcuser as the local administrator. When prompted for credentials, use
hpc.local\administrator, and then restart.
6. Connect to HPC-Compute as hpc.local\hpcuser.
a. Download the HPC Pack to HPC-Compute from the Microsoft Download Center. Choose the
HPC Pack for the version of Windows Server on HPC-Compute.
b. Extract the files to a folder, open the folder, and double-click setup.exe.
c. On the Installation page, select Join an existing HPC cluster by creating a new compute node,
and then choose Next.
d. Specify the fully-qualified name of the HPC-Head instance, and then choose the defaults.
e. Complete the wizard.
To complete your cluster configuration, from the head node, add the compute node to your cluster.
a. Select Add compute nodes or broker nodes that have already been configured.
b. Select the check box next to the node and choose Add.
5. Right-click the node and choose Bring Online.
914
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Step 5: Scale your HPC compute nodes (optional)
5. Save sysprep2008.xml.
6. Choose Start, All Programs, EC2ConfigService Settings.
a. Choose the General tab, and clear the Set Computer Name check box.
b. Choose the Bundle tab, and then choose Run Sysprep and Shutdown Now.
7. Open the Amazon EC2 console.
8. In the navigation pane, choose Instances.
9. Wait for the instance status to show Stopped.
10. Select the instance, choose Actions, Image and templates, Create image.
11. Specify an image name and image description, and then choose Create image to create an AMI from
the instance.
12. Start the original HPC-Compute instance that was shut down.
13. Connect to the head node using the hpc.local\hpcuser account.
14. From HPC Cluster Manager, delete the old node that now appears in an error state.
15. In the Amazon EC2 console, in the navigation pane, choose AMIs.
16. Use the AMI you created to add additional nodes to the cluster.
You can launch additional compute nodes from the AMI that you created. These nodes are automatically
joined to the domain, but you must add them to the cluster as already configured nodes in HPC Cluster
Manager using the head node and then bring them online.
915
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet
Topics
• EC2 Fleet (p. 916)
• Spot Fleet (p. 979)
• Monitor fleet events using Amazon EventBridge (p. 1033)
• Tutorials for EC2 Fleet and Spot Fleet (p. 1049)
• Example configurations for EC2 Fleet and Spot Fleet (p. 1060)
• Fleet quotas (p. 1087)
EC2 Fleet
An EC2 Fleet contains the configuration information to launch a fleet—or group—of instances. In a single
API call, a fleet can launch multiple instance types across multiple Availability Zones, using the On-
Demand Instance, Reserved Instance, and Spot Instance purchasing options together. Using EC2 Fleet,
you can:
• Define separate On-Demand and Spot capacity targets and the maximum amount you’re willing to pay
per hour
• Specify the instance types that work best for your applications
• Specify how Amazon EC2 should distribute your fleet capacity within each purchasing option
You can also set a maximum amount per hour that you’re willing to pay for your fleet, and EC2 Fleet
launches instances until it reaches the maximum amount. When the maximum amount you're willing to
pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
The EC2 Fleet attempts to launch the number of instances that are required to meet the target capacity
specified in your request. If you specified a total maximum price per hour, it fulfills the capacity until it
reaches the maximum amount that you’re willing to pay. The fleet can also attempt to maintain its target
Spot capacity if your Spot Instances are interrupted. For more information, see How Spot Instances
work (p. 388).
916
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet limitations
You can specify an unlimited number of instance types per EC2 Fleet. Those instance types can be
provisioned using both On-Demand and Spot purchasing options. You can also specify multiple
Availability Zones, specify different maximum Spot prices for each instance, and choose additional
Spot options for each fleet. Amazon EC2 uses the specified options to provision capacity when the fleet
launches.
While the fleet is running, if Amazon EC2 reclaims a Spot Instance because of a price increase or instance
failure, EC2 Fleet can try to replace the instances with any of the instance types that you specify. This
makes it easier to regain capacity during a spike in Spot pricing. You can develop a flexible and elastic
resourcing strategy for each fleet. For example, within specific fleets, your primary capacity can be On-
Demand supplemented with less-expensive Spot capacity if available.
If you have Reserved Instances and you specify On-Demand Instances in your fleet, EC2 Fleet uses your
Reserved Instances. For example, if your fleet specifies an On-Demand Instance as c4.large, and you
have Reserved Instances for c4.large, you receive the Reserved Instance pricing.
There is no additional charge for using EC2 Fleet. You pay only for the EC2 instances that the fleet
launches for you.
Contents
• EC2 Fleet limitations (p. 917)
• Burstable performance instances (p. 917)
• EC2 Fleet request types (p. 918)
• EC2 Fleet configuration strategies (p. 936)
• Work with EC2 Fleets (p. 960)
• EC2 Fleet is available only through the Amazon EC2 API, AWS CLI, AWS SDKs, and AWS
CloudFormation.
• An EC2 Fleet request can't span AWS Regions. You need to create a separate EC2 Fleet for each Region.
• An EC2 Fleet request can't span different subnets from the same Availability Zone.
Unlimited mode is suitable for burstable performance Spot Instances only if the instance runs long
enough to accrue CPU credits for bursting. Otherwise, paying for surplus credits makes burstable
performance Spot Instances more expensive than using other instances. For more information, see When
to use unlimited mode versus fixed CPU (p. 244).
Launch credits are meant to provide a productive initial launch experience for T2 instances by providing
sufficient compute resources to configure the instance. Repeated launches of T2 instances to access new
917
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
launch credits is not permitted. If you require sustained CPU, you can earn credits (by idling over some
period), use Unlimited mode (p. 242) for T2 Spot Instances, or use an instance type with dedicated CPU.
instant
If you configure the request type as instant, EC2 Fleet places a synchronous one-time request for
your desired capacity. In the API response, it returns the instances that launched, along with errors
for those instances that could not be launched. For more information, see Use an EC2 Fleet of type
'instant' (p. 918).
request
If you configure the request type as request, EC2 Fleet places an asynchronous one-time request
for your desired capacity. Thereafter, if capacity is diminished because of Spot interruptions, the
fleet does not attempt to replenish Spot Instances, nor does it submit requests in alternative Spot
capacity pools if capacity is unavailable.
maintain
(Default) If you configure the request type as maintain, EC2 Fleet places an asynchronous request
for your desired capacity, and maintains capacity by automatically replenishing any interrupted Spot
Instances.
All three types of requests benefit from an allocation strategy. For more information, see Allocation
strategies for Spot Instances (p. 937).
For workloads that need a launch-only API to launch EC2 instances, you can use the RunInstances API.
However, with RunInstances, you can only launch On-Demand Instances or Spot Instances, but not
both in the same request. Furthermore, when you use RunInstances to launch Spot Instances, your Spot
Instance request is limited to one instance type and one Availability Zone. This targets a single Spot
capacity pool (a set of unused instances with the same instance type and Availability Zone). If the Spot
capacity pool does not have sufficient Spot Instance capacity for your request, the RunInstances call fails.
Instead of using RunInstances to launch Spot Instances, we recommend that you rather use the
CreateFleet API with the type parameter set to instant for the following benefits:
• Launch On-Demand Instances and Spot Instances in one request. An EC2 Fleet can launch On-
Demand Instances, Spot Instances, or both. The request for Spot Instances is fulfilled if there is
available capacity and the maximum price per hour for your request exceeds the Spot price.
• Increase the availability of Spot Instances. By using an EC2 Fleet of type instant, you can launch
Spot Instances following Spot best practices with the resulting benefits:
• Spot best practice: Be flexible about instance types and Availability Zones.
Benefit: By specifying several instance types and Availability Zones, you increase the number of Spot
capacity pools. This gives the Spot service a better chance of finding and allocating your desired
Spot compute capacity. A good rule of thumb is to be flexible across at least 10 instance types for
each workload and make sure that all Availability Zones are configured for use in your VPC.
918
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
Benefit: The capacity-optimized allocation strategy automatically provisions instances from the
most-available Spot capacity pools. Because your Spot Instance capacity is sourced from pools with
optimal capacity, this decreases the possibility that your Spot Instances will be interrupted when
Amazon EC2 needs the capacity back.
• Get access to a wider set of capabilities. For workloads that need a launch-only API, and where you
prefer to manage the lifecycle of your instance rather than let EC2 Fleet manage it for you, use the EC2
Fleet of type instant instead of the RunInstances API. EC2 Fleet provides a wider set of capabilities
than RunInstances, as demonstrated in the following examples. For all other workloads, you should
use Amazon EC2 Auto Scaling because it supplies a more comprehensive feature set for a wide variety
of workloads, like ELB-backed applications, containerized workloads, and queue processing jobs.
AWS services like Amazon EC2 Auto Scaling and Amazon EMR use EC2 Fleet of type instant to launch EC2
instances.
1. Configure the CreateFleet request type as instant. For more information, see Create an EC2
Fleet (p. 967). Note that after you make the API call, you can't modify it.
2. When you make the API call, EC2 Fleet places a synchronous one-time request for your desired
capacity.
3. The API response lists the instances that launched, along with errors for those instances that could not
be launched.
4. You can describe your EC2 Fleet, list the instances associated with your EC2 Fleet, and view the history
of your EC2 Fleet.
5. After your instances have launched, you can delete the fleet request. When deleting the fleet request,
you can also choose to terminate the associated instances, or leave them running.
6. You can terminate the instances at any time.
Examples
The following examples show how to use EC2 Fleet of type instant for different use cases. For more
information about using the EC2 CreateFleet API parameters, see CreateFleet in the Amazon EC2 API
Reference.
Examples
• Example 1: Launch Spot Instances with the capacity-optimized allocation strategy (p. 920)
• Example 2: Launch a single Spot Instance with the capacity-optimized allocation strategy (p. 921)
• Example 3: Launch Spot Instances using instance weighting (p. 922)
• Example 4: Launch Spot Instances within single Availability zone (p. 924)
• Example 5: Launch Spot Instances of single instance type within single Availability zone (p. 925)
• Example 6: Launch Spot Instances only if minimum target capacity can be launched (p. 926)
• Example 7: Launch Spot Instances only if minimum target capacity can be launched of same Instance
Type in a single Availability Zone (p. 928)
• Example 8: Launch instances with multiple Launch Templates (p. 929)
• Example 9: Launch Spot Instance with a base of On-Demand Instances (p. 931)
919
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
• Example 10: Launch Spot Instances using capacity-optimized allocation strategy with a base of On-
Demand Instances using Capacity Reservations and the prioritized allocation strategy (p. 932)
• Example 11: Launch Spot Instances using capacity-optimized-prioritized allocation strategy (p. 934)
The following example specifies the parameters required in an EC2 Fleet of type instant: a launch
template, target capacity, default purchasing option, and launch template overrides.
• The launch template is identified by its launch template name and version number.
• The 12 launch template overrides specify 4 different instance types and 3 different subnets, each in a
separate Availability Zone. Each instance type and subnet combination defines a Spot capacity pool,
resulting in 12 Spot capacity pools.
• The target capacity for the fleet is 20 instances.
• The default purchasing option is spot, which results in the fleet attempting to launch 20 Spot
Instances into the Spot capacity pool with optimal capacity for the number of instances that are
launching.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-e7188bab"
920
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
Example 2: Launch a single Spot Instance with the capacity-optimized allocation strategy
You can optimally launch one Spot Instance at a time by making multiple EC2 Fleet API calls of type
instant, by setting the TotalTargetCapacity to 1.
The following example specifies the parameters required in an EC2 Fleet of type instant: a launch
template, target capacity, default purchasing option, and launch template overrides. The launch
template is identified by its launch template name and version number. The 12 launch template
overrides have 4 different instance types and 3 different subnets, each in a separate Availability Zone.
The target capacity for the fleet is 1 instance, and the default purchasing option is spot, which results
in the fleet attempting to launch a Spot Instance from one of the 12 Spot capacity pools based on the
capacity-optimized allocation strategy, to launch a Spot Instance from the most-available capacity pool.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-49e41922"
},
921
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
The following examples use instance weighting, which means that the price is per unit hour instead of
per instance hour. Each launch configuration lists a different instance type and a different weight based
on how many units of the workload can run on the instance assuming a unit of the workload requires
a 15 GB of memory and 4 vCPUs. For example an m5.xlarge (4 vCPUs and 16 GB of memory) can run
one unit and is weighted 1, m5.2xlarge (8 vCPUs and 32 GB of memory) can run 2 units and is weighted
2, and so on. The total target capacity is set to 40 units. The default purchasing option is spot, and the
allocation strategy is capacity-optimized, which results in either 40 m5.xlarge (40 divided by 1), 20
m5.2xlarge (40 divided by 2), 10 m5.4xlarge (40 divided by 4), 5 m5.8xlarge (40 divided by 8), or a mix
of the instance types with weights adding up to the desired capacity based on the capacity-optimized
allocation strategy.
For more information, see EC2 Fleet instance weighting (p. 959).
{
"SpotOptions":{
922
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
"AllocationStrategy":"capacity-optimized"
},
"LaunchTemplateConfigs":[
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"m5.xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":1
},
{
"InstanceType":"m5.xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":1
},
{
"InstanceType":"m5.xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":1
},
{
"InstanceType":"m5.2xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":2
},
{
"InstanceType":"m5.2xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":2
},
{
"InstanceType":"m5.2xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":2
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":4
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":4
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":4
},
{
"InstanceType":"m5.8xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":8
},
{
"InstanceType":"m5.8xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":8
},
{
"InstanceType":"m5.8xlarge",
923
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
"SubnetId":"subnet-49e41922",
"WeightedCapacity":8
}
]
}
],
"TargetCapacitySpecification":{
"TotalTargetCapacity":40,
"DefaultTargetCapacityType":"spot"
},
"Type":"instant"
}
The 12 launch template overrides have different instance types and subnets (each in a separate
Availability Zone) but the same weighted capacity. The total target capacity is 20 instances, the default
purchasing option is spot, and the Spot allocation strategy is capacity-optimized. The EC2 Fleet launches
20 Spot Instances all in a single AZ, from the Spot capacity pool(s) with optimal capacity using the
launch specifications.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"SingleAvailabilityZone": true
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
924
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
Example 5: Launch Spot Instances of single instance type within single Availability zone
You can configure a fleet to launch all instances of the same instance type and in a single Availability
Zone by setting the SpotOptions SingleInstanceType to true and SingleAvailabilityZone to true.
The 12 launch template overrides have different instance types and subnets (each in a separate
Availability Zone) but the same weighted capacity. The total target capacity is 20 instances, the default
purchasing option is spot, the Spot allocation strategy is capacity-optimized. The EC2 Fleet launches
20 Spot Instances of the same instance type all in a single AZ from the Spot Instance pool with optimal
capacity using the launch specifications.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"SingleInstanceType": true,
"SingleAvailabilityZone": true
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.4xlarge",
925
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
Example 6: Launch Spot Instances only if minimum target capacity can be launched
You can configure a fleet to launch instances only if the minimum target capacity can be launched
by setting the Spot options MinTargetCapacity to the minimum target capacity you want to launch
together.
The 12 launch template overrides have different instance types and subnets (each in a separate
Availability Zone) but the same weighted capacity. The total target capacity and the minimum target
capacity are both set to 20 instances, the default purchasing option is spot, the Spot allocation strategy
is capacity-optimized. The EC2 Fleet launches 20 Spot Instances from the Spot capacity pool with
optimal capacity using the launch template overrides, only if it can launch all 20 instances at the same
time.
{
"SpotOptions": {
926
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
"AllocationStrategy": "capacity-optimized",
"MinTargetCapacity": 20
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
927
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
Example 7: Launch Spot Instances only if minimum target capacity can be launched of same
Instance Type in a single Availability Zone
You can configure a fleet to launch instances only if the minimum target capacity can be launched
with a single instance type in a single Availability Zone by setting the Spot options MinTargetCapacity
to the minimum target capacity you want to launch together along with SingleInstanceType and
SingleAvailabilityZone options.
The 12 launch specifications which override the launch template, have different instance types and
subnets (each in a separate Availability Zone) but the same weighted capacity. The total target capacity
and the minimum target capacity are both set to 20 instances, the default purchasing option is spot, the
Spot allocation strategy is capacity-optimized, the SingleInstanceType is true and SingleAvailabilityZone
is true. The EC2 Fleet launches 20 Spot Instances of the same Instance type all in a single AZ from the
Spot capacity pool with optimal capacity using the launch specifications, only if it can launch all 20
instances at the same time.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"SingleInstanceType": true,
"SingleAvailabilityZone": true,
"MinTargetCapacity": 20
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-e7188bab"
928
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
},
{
"InstanceType":"m5.4xlarge",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5d.4xlarge",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
You can configure a fleet to launch instances with different launch specifications for different instance
types or a group of instance types, by specifying multiple launch templates. In this example we want
have different EBS volume sizes for different instance types and we have that configured in the launch
templates ec2-fleet-lt-4xl, ec2-fleet-lt-9xl and ec2-fleet-lt-18xl.
In this example, we are using 3 different launch templates for the 3 instance types based on their size.
The launch specification overrides on all the launch templates use instance weights based on the vCPUs
on the instance type. The total target capacity is 144 units, the default purchasing option is spot, and
the Spot allocation strategy is capacity-optimized. The EC2 Fleet can either launch 9 c5n.4xlarge (144
divided by 16) using the launch template ec2-fleet-4xl or 4 c5n.9xlarge (144 divided by 36) using the
launch template ec2-fleet-9xl, or 2 c5n.18xlarge (144 divided by 72) using the launch template ec2-
fleet-18xl, or a mix of the instance types with weights adding up to the desired capacity based on the
capacity-optimized allocation strategy.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt-18xl",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5n.18xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":72
},
{
"InstanceType":"c5n.18xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":72
929
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
},
{
"InstanceType":"c5n.18xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":72
}
]
},
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt-9xl",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5n.9xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":36
},
{
"InstanceType":"c5n.9xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":36
},
{
"InstanceType":"c5n.9xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":36
}
]
},
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt-4xl",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5n.4xlarge",
"SubnetId":"subnet-fae8c380",
"WeightedCapacity":16
},
{
"InstanceType":"c5n.4xlarge",
"SubnetId":"subnet-e7188bab",
"WeightedCapacity":16
},
{
"InstanceType":"c5n.4xlarge",
"SubnetId":"subnet-49e41922",
"WeightedCapacity":16
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 144,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
930
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
The following example specifies the total target capacity of 20 instances for the fleet, and a target
capacity of 5 On-Demand Instances. The default purchasing option is spot. The fleet launches
5 On-Demand Instance as specified, but needs to launch 15 more instances to fulfill the total
target capacity. The purchasing option for the difference is calculated as TotalTargetCapacity –
OnDemandTargetCapacity = DefaultTargetCapacityType, which results in the fleet launching 15 Spot
Instances form one of the 12 Spot capacity pools based on the capacity-optimized allocation strategy.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-e7188bab"
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-49e41922"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-fae8c380"
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-e7188bab"
},
931
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-49e41922"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"OnDemandTargetCapacity": 5,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
Example 10: Launch Spot Instances using capacity-optimized allocation strategy with a base of
On-Demand Instances using Capacity Reservations and the prioritized allocation strategy
You can configure a fleet to use On-Demand Capacity Reservations first when launching a base of
On-Demand Instances with the default target capacity type as spot by setting the usage strategy for
Capacity Reservations to use-capacity-reservations-first. And if multiple instance pools have unused
Capacity Reservations, the chosen On-Demand allocation strategy is applied. In this example, the On-
Demand allocation strategy is prioritized.
In this example, there are 6 available unused Capacity Reservations. This is less than the fleet's target
On-Demand capacity of 10 On-Demand Instances.
The account has the following 6 unused Capacity Reservations in 2 pools. The number of Capacity
Reservations in each pool is indicated by AvailableInstanceCount.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 3,
"InstanceMatchCriteria": "open",
"State": "active"
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "c5.large",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 3,
"InstanceMatchCriteria": "open",
"State": "active"
}
The following fleet configuration shows only the pertinent configurations for this example. The On-
Demand allocation strategy is prioritized, and the usage strategy for Capacity Reservations is use-
capacity-reservations-first. The Spot allocation strategy is capacity-optimized. The total target capacity
is 20, the On-Demand target capacity is 10, and the default target capacity type is spot.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized"
},
"OnDemandOptions":{
"CapacityReservationOptions": {
932
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
"UsageStrategy": "use-capacity-reservations-first"
},
"AllocationStrategy":"prioritized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.large",
"SubnetId":"subnet-fae8c380",
"Priority": 1.0
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-e7188bab",
"Priority": 2.0
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-49e41922",
"Priority": 3.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-fae8c380",
"Priority": 4.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-e7188bab",
"Priority": 5.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-49e41922",
"Priority": 6.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-fae8c380",
"Priority": 7.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-e7188bab",
"Priority": 8.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-49e41922",
"Priority": 9.0
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-fae8c380",
"Priority": 10.0
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-e7188bab",
"Priority": 11.0
},
933
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-49e41922",
"Priority": 12.0
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"OnDemandTargetCapacity": 10,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
After you create the instant fleet using the preceding configuration, the following 20 instances are
launched to meet the target capacity:
• 7 c5.large On-Demand Instances in us-east-1a – c5.large in us-east-1a is prioritized first, and there are
3 available unused c5.large Capacity Reservations. The Capacity Reservations are used first to launch
3 On-Demand Instances plus 4 additional On-Demand Instances are launched according to the On-
Demand allocation strategy, which is prioritized in this example.
• 3 m5.large On-Demand Instances in us-east-1a – m5.large in us-east-1a is prioritized second, and there
are 3 available unused c3.large Capacity Reservations.
• 10 Spot Instances from one of the 12 Spot capacity pools that has the optimal capacity according to
the capacity-optimized allocation strategy.
After the fleet is launched, you can run describe-capacity-reservations to see how many unused Capacity
Reservations are remaining. In this example, you should see the following response, which shows that all
of the c5.large and m5.large Capacity Reservations were used.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "c5.large",
"AvailableInstanceCount": 0
}
The following example specifies the parameters required in an EC2 Fleet of type instant: a launch
template, target capacity, default purchasing option, and launch template overrides. The launch
template is identified by its launch template name and version number. The 12 launch specifications
which override the launch template have 4 different instance types with a priority assigned, and 3
different subnets, each in a separate Availability Zone. The target capacity for the fleet is 20 instances,
and the default purchasing option is spot, which results in the fleet attempting to launch 20 Spot
Instances from one of the 12 Spot capacity pools based on the capacity-optimized-prioritized allocation
strategy, which implements priorities on a best-effort basis, but optimizes for capacity first.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized-prioritized"
934
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet request types
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification":{
"LaunchTemplateName":"ec2-fleet-lt1",
"Version":"$Latest"
},
"Overrides":[
{
"InstanceType":"c5.large",
"SubnetId":"subnet-fae8c380",
"Priority": 1.0
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-e7188bab",
"Priority": 1.0
},
{
"InstanceType":"c5.large",
"SubnetId":"subnet-49e41922",
"Priority": 1.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-fae8c380",
"Priority": 2.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-e7188bab",
"Priority": 2.0
},
{
"InstanceType":"c5d.large",
"SubnetId":"subnet-49e41922",
"Priority": 2.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-fae8c380",
"Priority": 3.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-e7188bab",
"Priority": 3.0
},
{
"InstanceType":"m5.large",
"SubnetId":"subnet-49e41922",
"Priority": 3.0
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-fae8c380",
"Priority": 4.0
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-e7188bab",
"Priority": 4.0
},
{
"InstanceType":"m5d.large",
"SubnetId":"subnet-49e41922",
935
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"Priority": 4.0
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
The EC2 Fleet attempts to launch the number of instances that are required to meet the target capacity
that you specify in the fleet request. The fleet can comprise only On-Demand Instances, only Spot
Instances, or a combination of both On-Demand Instances and Spot Instances. The request for Spot
Instances is fulfilled if there is available capacity and the maximum price per hour for your request
exceeds the Spot price. The fleet also attempts to maintain its target capacity if your Spot Instances are
interrupted.
You can also set a maximum amount per hour that you’re willing to pay for your fleet, and EC2 Fleet
launches instances until it reaches the maximum amount. When the maximum amount you're willing to
pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
A Spot capacity pool is a set of unused EC2 instances with the same instance type and Availability Zone.
When you create an EC2 Fleet, you can include multiple launch specifications, which vary by instance
type, Availability Zone, subnet, and maximum price. The fleet selects the Spot capacity pools that
are used to fulfill the request, based on the launch specifications included in your request, and the
configuration of the request. The Spot Instances come from the selected pools.
An EC2 Fleet enables you to provision large amounts of EC2 capacity that makes sense for your
application based on number of cores or instances, or amount of memory. For example, you can specify
an EC2 Fleet to launch a target capacity of 200 instances, of which 130 are On-Demand Instances and
the rest are Spot Instances.
Use the appropriate configuration strategies to create an EC2 Fleet that meets your needs.
Contents
• Plan an EC2 Fleet (p. 936)
• Allocation strategies for Spot Instances (p. 937)
• Attribute-based instance type selection for EC2 Fleet (p. 940)
• Configure EC2 Fleet for On-Demand backup (p. 953)
• Capacity Rebalancing (p. 955)
• Maximum price overrides (p. 958)
• Control spending (p. 958)
• EC2 Fleet instance weighting (p. 959)
936
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
• Determine whether you want to create an EC2 Fleet that submits a synchronous or asynchronous one-
time request for the desired target capacity, or one that maintains a target capacity over time. For
more information, see EC2 Fleet request types (p. 918).
• Determine the instance types that meet your application requirements.
• If you plan to include Spot Instances in your EC2 Fleet, review Spot Best Practices before you create
the fleet. Use these best practices when you plan your fleet so that you can provision the instances at
the lowest possible price.
• Determine the target capacity for your EC2 Fleet. You can set target capacity in instances or in custom
units. For more information, see EC2 Fleet instance weighting (p. 959).
• Determine what portion of the EC2 Fleet target capacity must be On-Demand capacity and Spot
capacity. You can specify 0 for On-Demand capacity or Spot capacity, or both.
• Determine your price per unit, if you are using instance weighting. To calculate the price per unit,
divide the price per instance hour by the number of units (or weight) that this instance represents. If
you are not using instance weighting, the default price per unit is the price per instance hour.
• Determine the maximum amount per hour that you’re willing to pay for your fleet. For more
information, see Control spending (p. 958).
• Review the possible options for your EC2 Fleet. For information about the fleet parameters, see create-
fleet in the AWS CLI Command Reference. For EC2 Fleet configuration examples, see EC2 Fleet example
configurations (p. 1060).
price-capacity-optimized (recommended)
EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that
are launching. This means that we will request Spot Instances from the pools that we believe have
the lowest chance of interruption in the near term. EC2 Fleet then requests Spot Instances from the
lowest priced of these pools.
The price-capacity-optimized allocation strategy is the best choice for most Spot workloads,
such as stateless containerized applications, microservices, web applications, data and analytics jobs,
and batch processing.
capacity-optimized
EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that
are launching. This means that we will request Spot Instances from the pools that we believe have
the lowest chance of interruption in the near term. You can optionally set a priority for each instance
type in your fleet using capacity-optimized-prioritized. EC2 Fleet optimizes for capacity
first, but honors instance type priorities on a best-effort basis.
With Spot Instances, pricing changes slowly over time based on long-term trends in supply and
demand, but capacity fluctuates in real time. The capacity-optimized strategy automatically
launches Spot Instances into the most available pools by looking at real-time capacity data and
predicting which are the most available. This works well for workloads that may have a higher cost
of interruption associated with restarting work, such as long Continuous Integration (CI), image and
media rendering, Deep Learning, and High Performance Compute (HPC) workloads that may have
a higher cost of interruption associated with restarting work. By offering the possibility of fewer
interruptions, the capacity-optimized strategy can lower the overall cost of your workload.
937
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
The Spot Instances are distributed across all Spot capacity pools.
lowest-price
The Spot Instances come from the lowest priced pool that has available capacity. This is the
default strategy. However, we recommend that you override the default by specifying the price-
capacity-optimized allocation strategy.
If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next
lowest priced pool that has available capacity.
If a pool runs out of capacity before fulfilling your desired capacity, EC2 Fleet will continue to fulfill
your request by drawing from the next lowest priced pool. To ensure that your desired capacity is
met, you might receive Spot Instances from several pools.
Because this strategy only considers instance price and not capacity availability, it might lead to high
interruption rates.
InstancePoolsToUseCount
The number of Spot pools across which to allocate your target Spot capacity. Valid only when the
allocation strategy is set to lowest-price. EC2 Fleet selects the lowest priced Spot pools and
evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on
a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet
will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your
target capacity is met, you might receive Spot Instances from more than the number of pools that
you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target
capacity from fewer than the number of pools that you specified.
To balance the trade-offs between the lowest priced Spot capacity pools and the Spot capacity pools
with the highest capacity availability, we recommend that you use the price-capacity-optimized
allocation strategy. This strategy makes decisions about which pools to request Spot Instances from
based on both the price of the pools and the capacity availability of Spot Instances in those pools. This
means that we will request Spot Instances from the pools that we believe have the lowest chance of
interruption in the near term, while still taking price into consideration.
938
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
If your fleet runs resilient and stateless workloads, including containerized applications, microservices,
web applications, data and analytics jobs, and batch processing, then use the price-capacity-
optimized allocation strategy for optimal cost savings and capacity availability.
If your fleet runs workloads that might have a higher cost of interruption associated with restarting
work, then you should implement checkpointing so that applications can restart from that point if
they're interrupted. By using checkpointing, you make the price-capacity-optimized allocation
strategy a good fit for these workloads because it allocates capacity from the lowest priced pools that
also offer a low Spot Instance interruption rate.
For an example configuration that uses the price-capacity-optimized allocation strategy, see
Example 11: Launch Spot Instances in a price-capacity-optimized fleet (p. 1073).
You can optionally use the capacity-optimized strategy if you run workloads that either use similarly
priced instance types, or where the cost of interruption is so significant that any cost saving is inadequate
in comparison to a marginal increase in interruptions. This strategy allocates capacity from the most
available Spot capacity pools that offer the possibility of fewer interruptions, which can lower the overall
cost of your workload. For an example configuration that uses the capacity-optimized allocation
strategy, see Example 9: Launch Spot Instances in a capacity-optimized fleet (p. 1071).
When the possibility of interruptions must be minimized but the preference for certain instance types
matters, you can express your pool priorities by using the capacity-optimized-prioritized
allocation strategy and then setting the order of instance types to use from highest to lowest priority.
For an example configuration, see Example 10: Launch Spot Instances in a capacity-optimized fleet with
priorities (p. 1072).
Note that using priorities is supported only if your fleet uses a launch template. Also note that when you
set priorities for capacity-optimized-prioritized, the same priorities are also applied to your On-
Demand Instances if the On-Demand AllocationStrategy is set to prioritized.
When your workload is time flexible and capacity availability is not a factor
If your fleet is small or runs for a short time, you can use price-capacity-optimized to maximize
cost savings while still considering capacity availability.
If your workload is time flexible and capacity availability is not a factor, you can optionally use the
lowest-price allocation strategy to maximize cost savings. Note, however, that because the lowest-
price allocation strategy only considers instance price and not capacity availability, it might lead to high
Spot Instance interruption rates.
If your fleet is large or runs for a long time, you can improve the availability of your fleet by distributing
the Spot Instances across multiple pools using the diversified strategy. For example, if your EC2 Fleet
specifies 10 pools and a target capacity of 100 instances, the fleet launches 10 Spot Instances in each
pool. If the Spot price for one pool exceeds your maximum price for this pool, only 10% of your fleet is
affected. Using this strategy also makes your fleet less sensitive to increases in the Spot price in any one
pool over time. With the diversified strategy, the EC2 Fleet does not launch Spot Instances into any
pools with a Spot price that is equal to or higher than the On-Demand price.
To create an inexpensive and diversified fleet, use the lowest-price strategy in combination with
InstancePoolsToUseCount. For example, if your target capacity is 10 Spot Instances, and you specify
2 Spot capacity pools (for InstancePoolsToUseCount), EC2 Fleet will draw on the two lowest priced
pools to fulfill your Spot capacity.
You can use a low or high number of Spot capacity pools across which to allocate your Spot Instances.
For example, if you run batch processing, we recommend specifying a low number of Spot capacity
939
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
pools (for example, InstancePoolsToUseCount=2) to ensure that your queue always has compute
capacity while maximizing savings. If you run a web service, we recommend specifying a high number of
Spot capacity pools (for example, InstancePoolsToUseCount=10) to minimize the impact if a Spot
capacity pool becomes temporarily unavailable.
Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on
a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet
will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your
target capacity is met, you might receive Spot Instances from more than the number of pools that you
specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity
from fewer than the number of pools that you specified.
Attribute-based instance type selection is ideal for workloads and frameworks that can be flexible about
what instance types they use, such as when running containers or web fleets, processing big data, and
implementing continuous integration and deployment (CI/CD) tooling.
Benefits
• With so many instance types available, finding the right instance types for your workload can be
time consuming. When you specify instance attributes, the instance types will automatically have the
required attributes for your workload.
• To manually specify multiple instance types for an EC2 Fleet, you must create a separate launch
template override for each instance type. But with attribute-based instance type selection, to provide
940
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
multiple instance types, you need only specify the instance attributes in the launch template or in a
launch template override.
• When you specify instance attributes rather than instance types, your fleet can use newer generation
instance types as they’re released, "future proofing" the fleet's configuration.
• When you specify instance attributes rather than instance types, EC2 Fleet can select from a wide
range of instance types for launching Spot Instances, which adheres to the Spot best practice of
instance type flexibility (p. 386).
Topics
• How attribute-based instance type selection works (p. 941)
• Considerations (p. 943)
• Create an EC2 Fleet with attribute-based instance type selection (p. 943)
• Examples of configurations that are valid and not valid (p. 944)
• Preview instance types with specified attributes (p. 950)
Topics
• Types of instance attributes (p. 941)
• Where to configure attribute-based instance type selection (p. 941)
• How EC2 Fleet uses attribute-based instance type selection when provisioning a fleet (p. 942)
• Price protection (p. 942)
There are several instance attributes that you can specify to express your compute requirements. For a
description of each attribute and the default values, see InstanceRequirements in the Amazon EC2 API
Reference.
Depending on whether you use the console or the AWS CLI, you can specify the instance attributes for
attribute-based instance type selection as follows:
In the console, you can specify the instance attributes in the following fleet configuration component:
• In a launch template, and then reference the launch template in the fleet request
In the AWS CLI, you can specify the instance attributes in one or all of the following fleet configuration
components:
• In a launch template, and then reference the launch template in the fleet request
• In a launch template override
If you want a mix of instances that use different AMIs, you can specify instance attributes in multiple
launch template overrides. For example, different instance types can use x86 and Arm-based
processors.
941
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
• In a launch specification
How EC2 Fleet uses attribute-based instance type selection when provisioning a fleet
• EC2 Fleet identifies the instance types that have the specified attributes.
• EC2 Fleet uses price protection to determine which instance types to exclude.
• EC2 Fleet determines the capacity pools from which it will consider launching the instances based on
the AWS Regions or Availability Zones that have matching instance types.
• EC2 Fleet applies the specified allocation strategy to determine from which capacity pools to launch
the instances.
Note that attribute-based instance type selection does not pick the capacity pools from which to
provision the fleet; that's the job of the allocation strategies. There might be a large number of
instance types with the specified attributes, and some of them might be expensive. The default
allocation strategy of lowest-price for Spot and On-Demand guarantees that EC2 Fleet will launch
instances from the least expensive capacity pools.
If you specify an allocation strategy, EC2 Fleet will launch instances according to the specified
allocation strategy.
• For Spot Instances, attribute-based instance type selection supports the price-capacity-
optimized, capacity-optimized, and lowest-price allocation strategies.
• For On-Demand Instances, attribute-based instance type selection supports the lowest-price
allocation strategy.
• If there is no capacity for the instance types with the specified instance attributes, no instances can be
launched, and the fleet returns an error.
Price protection
Price protection is a feature that prevents your EC2 Fleet from using instance types that you would
consider too expensive even if they happen to fit the attributes that you specified. When you create a
fleet with attribute-based instance type selection, price protection is enabled by default, with separate
thresholds for On-Demand Instances and Spot Instances. When Amazon EC2 selects instance types with
your attributes, it excludes instance types priced above your threshold. The thresholds represent the
maximum you'll pay, expressed as a percentage above the least expensive current generation M, C, or R
instance type with your specified attributes.
If you don't specify a threshold, the following thresholds are used by default:
While creating the EC2 Fleet, configure the fleet for attribute-based instance type selection, and then do
the following:
• To specify the On-Demand Instance price protection threshold, in the JSON configuration file, in the
InstanceRequirements structure, for OnDemandMaxPricePercentageOverLowestPrice, enter
the price protection threshold as a percentage.
• To specify the Spot Instance price protection threshold, in the JSON configuration file, in the
InstanceRequirements structure, for SpotMaxPricePercentageOverLowestPrice, enter the
price protection threshold as a percentage.
942
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
For more information about creating the fleet, see Create an EC2 Fleet with attribute-based instance
type selection (p. 943).
Note
When creating the EC2 Fleet, if you set TargetCapacityUnitType to vcpu or memory-mib,
the price protection threshold is applied based on the per-vCPU or per-memory price instead of
the per-instance price.
Considerations
• You can specify either instance types or instance attributes in an EC2 Fleet, but not both at the same
time.
When using the CLI, the launch template overrides will override the launch template. For example,
if the launch template contains an instance type and the launch template override contains instance
attributes, the instances that are identified by the instance attributes will override the instance type in
the launch template.
• When using the CLI, when you specify instance attributes as overrides, you can't also specify weights or
priorities.
• You can specify a maximum of four InstanceRequirements structures in a request configuration.
To create an EC2 Fleet with attribute-based instance type selection (AWS CLI)
Use the create-fleet (AWS CLI) command to create an EC2 Fleet. Specify the fleet configuration in a JSON
file.
The following example contains the parameters that configure an EC2 Fleet to use attribute-based
instance type selection, and is followed by a text explanation.
{
"SpotOptions": {
"AllocationStrategy": "price-capacity-optimized"
},
"LaunchTemplateConfigs": [{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2
},
"MemoryMiB": {
"Min": 4
}
}
}]
943
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
}],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
The attributes for attribute-based instance type selection are specified in the InstanceRequirements
structure. In this example, two attributes are specified:
Any instance types that have 2 or more vCPUs and 4 MiB or more of memory will be identified. However,
price protection and the allocation strategy might exclude some instance types when EC2 Fleet
provisions the fleet (p. 942).
For a list and descriptions of all the possible attributes that you can specify, see InstanceRequirements in
the Amazon EC2 API Reference.
Note
When InstanceRequirements is included in the fleet configuration, InstanceType and
WeightedCapacity must be excluded; they cannot determine the fleet configuration at the
same time as instance attributes.
Configurations are considered not valid when they contain the following:
Example configurations
• Valid configuration: Single launch template with overrides (p. 945)
• Valid configuration: Single launch template with multiple InstanceRequirements (p. 946)
944
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
• Valid configuration: Two launch templates, each with overrides (p. 946)
• Valid configuration: Only InstanceRequirements specified, no overlapping attribute values (p. 947)
• Configuration not valid: Overrides contain InstanceRequirements and InstanceType (p. 948)
• Configuration not valid: Two Overrides contain InstanceRequirements and InstanceType (p. 949)
• Configuration not valid: Overlapping attribute values (p. 949)
The following configuration is valid. It contains one launch template and one Overrides structure
containing one InstanceRequirements structure. A text explanation of the example configuration
follows.
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "My-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2,
"Max": 8
},
"MemoryMib": {
"Min": 0,
"Max": 10240
},
"MemoryGiBPerVCpu": {
"Max": 10000
},
"RequireHibernateSupport": true
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 5000,
"DefaultTargetCapacityType": "spot",
"TargetCapacityUnitType": "vcpu"
}
}
}
InstanceRequirements
To use attribute-based instance selection, you must include the InstanceRequirements structure in
your fleet configuration, and specify the desired attributes for the instances in the fleet.
• VCpuCount – The instance types must have a minimum of 2 and a maximum of 8 vCPUs.
• MemoryMiB – The instance types must have a maximum of 10240 MiB of memory. A minimum of 0
indicates no minimum limit.
• MemoryGiBPerVCpu – The instance types must have a maximum of 10,000 GiB of memory per vCPU.
The Min parameter is optional. By omitting it, you indicate no minimum limit.
945
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
TargetCapacityUnitType
The TargetCapacityUnitType parameter specifies the unit for the target capacity. In the example,
the target capacity is 5000 and the target capacity unit type is vcpu, which together specify a desired
target capacity of 5,000 vCPUs. EC2 Fleet will launch enough instances so that the total number of
vCPUs in the fleet is 5,000 vCPUs.
The following configuration is valid. It contains one launch template and one Overrides
structure containing two InstanceRequirements structures. The attributes specified
in InstanceRequirements are valid because the values do not overlap—the first
InstanceRequirements structure specifies a VCpuCount of 0-2 vCPUs, while the second
InstanceRequirements structure specifies 4-8 vCPUs.
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 4,
"Max": 8
},
"MemoryMiB": {
"Min": 0
}
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
The following configuration is valid. It contains two launch templates, each with one Overrides
structure containing one InstanceRequirements structure. This configuration is useful for arm and
x86 architecture support in the same fleet.
946
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "armLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "x86LaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
947
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
]
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyOtherLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 4,
"Max": 8
},
"MemoryMiB": {
"Min": 0
}
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
The following configuration is not valid. The Overrides structure contains both
InstanceRequirements and InstanceType. For the Overrides, you can specify either
InstanceRequirements or InstanceType, but not both.
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"InstanceType": "m5.large"
948
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
]
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyOtherLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "m5.large"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
949
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
},
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
}
To preview a list of instance types by specifying attributes using the AWS CLI
1. (Optional) To generate all of the possible attributes that can be specified, use the get-instance-
types-from-instance-requirements command and the --generate-cli-skeleton parameter. You
can optionally direct the output to a file to save it by using input > attributes.json.
Expected output
{
"DryRun": true,
950
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"ArchitectureTypes": [
"i386"
],
"VirtualizationTypes": [
"hvm"
],
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 0
},
"MemoryMiB": {
"Min": 0,
"Max": 0
},
"CpuManufacturers": [
"intel"
],
"MemoryGiBPerVCpu": {
"Min": 0.0,
"Max": 0.0
},
"ExcludedInstanceTypes": [
""
],
"InstanceGenerations": [
"current"
],
"SpotMaxPricePercentageOverLowestPrice": 0,
"OnDemandMaxPricePercentageOverLowestPrice": 0,
"BareMetal": "included",
"BurstablePerformance": "included",
"RequireHibernateSupport": true,
"NetworkInterfaceCount": {
"Min": 0,
"Max": 0
},
"LocalStorage": "included",
"LocalStorageTypes": [
"hdd"
],
"TotalLocalStorageGB": {
"Min": 0.0,
"Max": 0.0
},
"BaselineEbsBandwidthMbps": {
"Min": 0,
"Max": 0
},
"AcceleratorTypes": [
"gpu"
],
"AcceleratorCount": {
"Min": 0,
"Max": 0
},
"AcceleratorManufacturers": [
"nvidia"
],
"AcceleratorNames": [
"a100"
],
"AcceleratorTotalMemoryMiB": {
"Min": 0,
"Max": 0
},
951
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"NetworkBandwidthGbps": {
"Min": 0.0,
"Max": 0.0
},
"AllowedInstanceTypes": [
""
]
},
"MaxResults": 0,
"NextToken": ""
}
2. Create a JSON configuration file using the output from the previous step, and configure it as follows:
Note
You must provide values for ArchitectureTypes, VirtualizationTypes, VCpuCount,
and MemoryMiB. You can omit the other attributes; when omitted, the default values are
used.
For a description of each attribute and their default values, see get-instance-types-from-
instance-requirements in the Amazon EC2 Command Line Reference.
In this example, the required attributes are included in the JSON file. They are
ArchitectureTypes, VirtualizationTypes, VCpuCount, and MemoryMiB. In addition, the
optional InstanceGenerations attribute is also included. Note that for MemoryMiB, the Max
value can be omitted to indicate that there is no limit.
"ArchitectureTypes": [
"x86_64"
],
"VirtualizationTypes": [
"hvm"
],
"InstanceRequirements": {
"VCpuCount": {
"Min": 4,
"Max": 6
},
"MemoryMiB": {
952
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
"Min": 2048
},
"InstanceGenerations": [
"current"
]
}
}
Example output
------------------------------------------
|GetInstanceTypesFromInstanceRequirements|
+----------------------------------------+
|| InstanceTypes ||
|+--------------------------------------+|
|| InstanceType ||
|+--------------------------------------+|
|| c4.xlarge ||
|| c5.xlarge ||
|| c5a.xlarge ||
|| c5ad.xlarge ||
|| c5d.xlarge ||
|| c5n.xlarge ||
|| d2.xlarge ||
...
4. After identifying instance types that meet your needs, make note of the instance attributes that you
used so that you can use them when configuring your fleet request.
Topics
• Prioritize instance types for On-Demand capacity (p. 953)
• Use Capacity Reservations for On-Demand Instances (p. 954)
In this example, you configure three launch template overrides, each with a different instance type.
The On-Demand price for the instance types range in price. The following are the instance types used in
this example, listed in order of price, starting with the least expensive instance type:
953
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
• m5.large
• m5a.large
If you do not use priority to determine the order, the fleet fulfills the On-Demand capacity by starting
with the least expensive instance type.
However, say you have unused m5.large Reserved Instances that you want to use first. You can set the
launch template override priority so that the instance types are used in the order of priority, as follows:
• m5.large – priority 1
• m4.large – priority 2
• m5a.large – priority 3
Capacity Reservations are configured as either open or targeted. EC2 Fleet can launch On-Demand
Instances into either open or targeted Capacity Reservations, as follows:
• If a Capacity Reservation is open, On-Demand Instances that have matching attributes automatically
run in the reserved capacity.
• If a Capacity Reservation is targeted, On-Demand Instances must specifically target it to run in the
reserved capacity. This is useful for using up specific Capacity Reservations or for controlling when to
use specific Capacity Reservations.
If you use targeted Capacity Reservations in your EC2 Fleet, there must be enough Capacity
Reservations to fulfil the target On-Demand capacity, otherwise the launch fails. To avoid a launch
fail, rather add the targeted Capacity Reservations to a resource group, and then target the resource
group. The resource group doesn't need to have enough Capacity Reservations; if it runs out of Capacity
Reservations before the target On-Demand capacity is fulfilled, the fleet can launch the remaining target
capacity into regular On-Demand capacity.
1. Configure the fleet as type instant. You can't use Capacity Reservations for fleets of other types.
2. Configure the usage strategy for Capacity Reservations as use-capacity-reservations-first.
3. In the launch template, for Capacity reservation, choose either Open or Target by group. If you
choose Target by group, specify the Capacity Reservations resource group ID.
When the fleet attempts to fulfil the On-Demand capacity, if it finds that multiple instance pools have
unused matching Capacity Reservations, it determines the pools in which to launch the On-Demand
Instances based on the On-Demand allocation strategy (lowest-price or prioritized).
For examples of how to configure a fleet to use Capacity Reservations to fulfil On-Demand capacity, see
EC2 Fleet example configurations (p. 1060), specifically Examples 5 through 7.
For information about configuring Capacity Reservations, see On-Demand Capacity Reservations (p. 492)
and the On-Demand Capacity Reservation FAQs.
954
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
Capacity Rebalancing
You can configure EC2 Fleet to launch a replacement Spot Instance when Amazon EC2 emits a rebalance
recommendation to notify you that a Spot Instance is at an elevated risk of interruption. Capacity
Rebalancing helps you maintain workload availability by proactively augmenting your fleet with a new
Spot Instance before a running instance is interrupted by Amazon EC2. For more information, see EC2
instance rebalance recommendations (p. 418).
To configure EC2 Fleet to launch a replacement Spot Instance, use the create-fleet (AWS CLI) command
and the relevant parameters in the MaintenanceStrategies structure. For more information, see the
example launch configuration (p. 1070).
Limitations
• Capacity Rebalancing is available only for fleets of type maintain.
• When the fleet is running, you can't modify the Capacity Rebalancing setting. To change the Capacity
Rebalancing setting, you must delete the fleet and create a new fleet.
Configuration options
The ReplacementStrategy for EC2 Fleet supports the following two values:
launch-before-terminate
Amazon EC2 terminates the Spot Instances that receive a rebalance notification after new
replacement Spot Instances are launched. When you specify launch-before-terminate, you
must also specify a value for termination-delay. After the new replacement instances are
launched, Amazon EC2 waits for the duration of the termination-delay, and then terminates
the old instances. For termination-delay, the minimum is 120 seconds (2 minutes), and the
maximum is 7200 seconds (2 hours).
We recommend that you use launch-before-terminate only if you can predict how long your
instance shutdown procedures will take to complete. This will ensure that the old instances are
terminated only after the shutdown procedures are completed. Note that Amazon EC2 can interrupt
the old instances with a two-minute warning before the termination-delay.
Amazon EC2 launches replacement Spot Instances when a rebalance notification is emitted for
existing Spot Instances. Amazon EC2 does not terminate the instances that receive a rebalance
notification. You can terminate the old instances, or you can leave them running. You are charged for
all instances while they are running.
Considerations
If you configure an EC2 Fleet for Capacity Rebalancing, consider the following:
Configure your EC2 Fleet to use multiple instance types and Availability Zones. This provides the
flexibility to launch Spot Instances in various Spot capacity pools. For more information, see Be
flexible about instance types and Availability Zones (p. 386).
955
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
Your replacement Spot Instances may be at an elevated risk of interruption if you use the lowest-
price allocation strategy. This is because Amazon EC2 will always launch instances in the lowest
priced pool that has available capacity at that moment, even if your replacement Spot Instances
are likely to be interrupted soon after being launched. To avoid an elevated risk of interruption, we
strongly recommend against using the lowest-price allocation strategy, and instead recommend
the capacity-optimized or capacity-optimized-prioritized allocation strategy. These
strategies ensure that replacement Spot Instances are launched in the most optimal Spot capacity
pools, and are therefore less likely to be interrupted in the near future. For more information, see
Use the price and capacity optimized allocation strategy (p. 386).
Amazon EC2 will only launch a new instance if availability is the same or better
One of the goals of Capacity Rebalancing is to improve a Spot Instance's availability. If an existing
Spot Instance receives a rebalance recommendation, Amazon EC2 will only launch a new instance
if the new instance provides the same or better availability than the existing instance. If the risk of
interruption of a new instance will be worse than the existing instance, then Amazon EC2 will not
launch a new instance. Amazon EC2 will, however, continue to assess the Spot capacity pools, and
will launch a new instance if availability improves.
There is a chance that your existing instance will be interrupted without Amazon EC2 proactively
launching a new instance. When this happens, Amazon EC2 will attempt to launch a new instance
regardless of whether the new instance has a high risk of interruption.
Capacity Rebalancing does not increase your Spot Instance interruption rate
When you enable Capacity Rebalancing, it does not increase your Spot Instance interruption
rate (p. 421) (the number of Spot Instances that are reclaimed when Amazon EC2 needs the capacity
back). However, if Capacity Rebalancing detects an instance is at risk of interruption, Amazon EC2
will immediately attempt to launch a new instance. The result is that more instances might be
replaced than if you’d waited for Amazon EC2 to launch a new instance after the at-risk instance was
interrupted.
While you might replace more instances with Capacity Rebalancing enabled, you benefit from
being proactive rather than reactive by having more time to take action before your instances are
interrupted. With a Spot Instance interruption notice (p. 429), you typically only have up to two
minutes to gracefully shut down your instance. With Capacity Rebalancing launching a new instance
in advance, you give existing processes a better chance of completing on your at-risk instance,
you can start your instance shutdown procedures, and prevent new work from being scheduled
on your at-risk instance. You can also start preparing the newly-launched instance to take over
the application. With Capacity Rebalancing’s proactive replacement, you benefit from graceful
continuity.
As a theoretical example to demonstrate the risks and benefits of using Capacity Rebalancing,
consider the following scenario:
• 2:00 PM – A rebalance recommendation is received for instance-A, and Amazon EC2 immediately
starts attempting to launch a replacement instance-B, giving you time to start your shutdown
procedures.*
• 2:30 PM – A rebalance recommendation is received for instance-B, replaced with instance-C, giving
you time to start your shutdown procedures.*
• 2:32 PM – If Capacity Rebalancing wasn’t enabled, and if a Spot Instance interruption notice
would've been received at 2:32 PM for instance-A, you would only have had up to two minutes to
take action, but Instance-A would have been running up till this time.
* If launch-before-terminate is specified, Amazon EC2 will terminate the at-risk instance after
the replacement instance comes online.
956
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
Amazon EC2 can launch new replacement Spot Instances until fulfilled capacity is double target
capacity
When an EC2 Fleet is configured for Capacity Rebalancing, the fleet attempts to launch a new
replacement Spot Instance for every Spot Instance that receives a rebalance recommendation. After
a Spot Instance receives a rebalance recommendation, it is no longer counted as part of the fulfilled
capacity. Depending on the replacement strategy, Amazon EC2 either terminates the instance after
a preconfigured termination delay, or leaves it running. This gives you the opportunity to perform
rebalancing actions (p. 418) on the instance.
If your fleet reaches double its target capacity, it stops launching new replacement instances even if
the replacement instances themselves receive a rebalance recommendation.
For example, you create an EC2 Fleet with a target capacity of 100 Spot Instances. All of the
Spot Instances receive a rebalance recommendation, which causes Amazon EC2 to launch 100
replacement Spot Instances. This raises the number of fulfilled Spot Instances to 200, which is
double the target capacity. Some of the replacement instances receive a rebalance recommendation,
but no more replacement instances are launched because the fleet cannot exceed double its target
capacity.
Note that you are charged for all of the instances while they are running.
We recommend that you configure EC2 Fleet to terminate Spot Instances that receive a rebalance
recommendation
If you configure your EC2 Fleet for Capacity Rebalancing, we recommend that you choose launch-
before-terminate with an appropriate termination delay only if you can predict how long your
instance shutdown procedures will take to complete. This will ensure that the old instances are
terminated only after the shutdown procedures are completed.
If you choose to terminate the instances that are recommended for rebalance yourself, we
recommend that you monitor the rebalance recommendation signal that is received by the Spot
Instances in the fleet. By monitoring the signal, you can quickly perform rebalancing actions (p. 418)
on the affected instances before Amazon EC2 interrupts them, and then you can manually
terminate them. If you do not terminate the instances, you continue paying for them while they
are running. Amazon EC2 does not automatically terminate the instances that receive a rebalance
recommendation.
You can set up notifications using Amazon EventBridge or instance metadata. For more information,
see Monitor rebalance recommendation signals (p. 419).
EC2 Fleet does not count instances that receive a rebalance recommendation when calculating
fulfilled capacity during scale in or out
If your EC2 Fleet is configured for Capacity Rebalancing, and you change the target capacity to either
scale in or scale out, the fleet does not count the instances that are marked for rebalance as part of
the fulfilled capacity, as follows:
• Scale in – If you decrease your desired target capacity, Amazon EC2 terminates instances that are
not marked for rebalance until the desired capacity is reached. The instances that are marked for
rebalance are not counted towards the fulfilled capacity.
For example, you create an EC2 Fleet with a target capacity of 100 Spot Instances. 10 instances
receive a rebalance recommendation, so Amazon EC2 launches 10 new replacement instances,
resulting in a fulfilled capacity of 110 instances. You then reduce the target capacity to 50 (scale
in), but the fulfilled capacity is actually 60 instances because the 10 instances that are marked for
rebalance are not terminated by Amazon EC2. You need to manually terminate these instances, or
you can leave them running.
• Scale out – If you increase your desired target capacity, Amazon EC2 launches new instances until
the desired capacity is reached. The instances that are marked for rebalance are not counted
towards the fulfilled capacity.
957
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
For example, you create an EC2 Fleet with a target capacity of 100 Spot Instances. 10 instances
receive a rebalance recommendation, so the fleet launches 10 new replacement instances,
resulting in a fulfilled capacity of 110 instances. You then increase the target capacity to 200
(scale out), but the fulfilled capacity is actually 210 instances because the 10 instances that are
marked for rebalance are not counted by the fleet as part of the target capacity. You need to
manually terminate these instances, or you can leave them running.
You can optionally specify a maximum price in one or more launch specifications. This price is specific
to the launch specification. If a launch specification includes a specific price, the EC2 Fleet uses this
maximum price, overriding the global maximum price. Any other launch specifications that do not
include a specific maximum price still use the global maximum price.
Control spending
EC2 Fleet stops launching instances when it has met one of the following parameters: the
TotalTargetCapacity or the MaxTotalPrice (the maximum amount you’re willing to pay). To
control the amount you pay per hour for your fleet, you can specify the MaxTotalPrice. When the
maximum total price is reached, EC2 Fleet stops launching instances even if it hasn’t met the target
capacity.
The following examples show two different scenarios. In the first, EC2 Fleet stops launching instances
when it has met the target capacity. In the second, EC2 Fleet stops launching instances when it has
reached the maximum amount you’re willing to pay (MaxTotalPrice).
EC2 Fleet launches 10 On-Demand Instances because the total of $1.00 (10 instances x $0.10) does not
exceed the MaxTotalPrice of $1.50 for On-Demand Instances.
If EC2 Fleet launches the On-Demand target capacity (10 On-Demand Instances), the total cost per
hour would be $1.00. This is more than the amount ($0.80) specified for MaxTotalPrice for On-
Demand Instances. To prevent spending more than you're willing to pay, EC2 Fleet launches only 8 On-
Demand Instances (below the On-Demand target capacity) because launching more would exceed the
MaxTotalPrice for On-Demand Instances.
958
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet configuration strategies
By default, the price that you specify is per instance hour. When you use the instance weighting feature,
the price that you specify is per unit hour. You can calculate your price per unit hour by dividing your
price for an instance type by the number of units that it represents. EC2 Fleet calculates the number of
instances to launch by dividing the target capacity by the instance weight. If the result isn't an integer,
the fleet rounds it up to the next integer, so that the size of your fleet is not below its target capacity.
The fleet can select any pool that you specify in your launch specification, even if the capacity of the
instances launched exceeds the requested target capacity.
The following table includes examples of calculations to determine the price per unit for an EC2 Fleet
with a target capacity of 10.
Instance Instance Target Number of Price per Price per unit hour
type weight capacity instances instance
launched hour
Use EC2 Fleet instance weighting as follows to provision the target capacity that you want in the pools
with the lowest price per unit at the time of fulfillment:
1. Set the target capacity for your EC2 Fleet either in instances (the default) or in the units of your
choice, such as virtual CPUs, memory, storage, or throughput.
2. Set the price per unit.
3. For each launch specification, specify the weight, which is the number of units that the instance type
represents toward the target capacity.
• A target capacity of 24
• A launch specification with an instance type r3.2xlarge and a weight of 6
• A launch specification with an instance type c3.xlarge and a weight of 5
The weights represent the number of units that instance type represents toward the target capacity. If
the first launch specification provides the lowest price per unit (price for r3.2xlarge per instance hour
divided by 6), the EC2 Fleet would launch four of these instances (24 divided by 6).
959
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
If the second launch specification provides the lowest price per unit (price for c3.xlarge per instance
hour divided by 5), the EC2 Fleet would launch five of these instances (24 divided by 5, result rounded
up).
The EC2 Fleet would launch four instances (30 divided by 8, result rounded up). With the lowest-
price strategy, all four instances come from the pool that provides the lowest price per unit. With
the diversified strategy, the fleet launches one instance in each of the three pools, and the fourth
instance in whichever of the three pools provides the lowest price per unit.
The EC2 Fleet launches On-Demand Instances when there is available capacity, and launches Spot
Instances when your maximum price exceeds the Spot price and capacity is available.
If your fleet includes Spot Instances, Amazon EC2 can attempt to maintain your fleet target capacity as
Spot prices change.
An EC2 Fleet request of type maintain or request remains active until it expires or you delete it. When
you delete a fleet of type maintain or request, you can specify whether deletion terminates the
instances in that fleet. Otherwise, the On-Demand Instances run until you terminate them, and the Spot
Instances run until they are interrupted or you terminate them.
Contents
• EC2 Fleet request states (p. 960)
• EC2 Fleet prerequisites (p. 961)
• EC2 Fleet health checks (p. 964)
• Generate an EC2 Fleet JSON configuration file (p. 965)
• Create an EC2 Fleet (p. 967)
• Tag an EC2 Fleet (p. 970)
• Describe your EC2 Fleet (p. 972)
• Modify an EC2 Fleet (p. 974)
• Delete an EC2 Fleet (p. 975)
960
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
submitted
The EC2 Fleet request is being evaluated and Amazon EC2 is preparing to launch the target number
of instances. The request can include On-Demand Instances, Spot Instances, or both.
active
The EC2 Fleet request has been validated and Amazon EC2 is attempting to maintain the target
number of running instances. The request remains in this state until it is modified or deleted.
modifying
The EC2 Fleet request is being modified. The request remains in this state until the modification is
fully processed or the request is deleted. Only a maintain fleet type can be modified. This state
does not apply to other request types.
deleted_running
The EC2 Fleet request is deleted and does not launch additional instances. Its existing instances
continue to run until they are interrupted or terminated manually. The request remains in this state
until all instances are interrupted or terminated. Only an EC2 Fleet of type maintain or request
can have running instances after the EC2 Fleet request is deleted. A deleted instant fleet with
running instances is not supported. This state does not apply to instant fleets.
deleted_terminating
The EC2 Fleet request is deleted and its instances are terminating. The request remains in this state
until all instances are terminated.
deleted
The EC2 Fleet is deleted and has no running instances. The request is deleted two days after its
instances are terminated.
The following illustration represents the transitions between the EC2 Fleet request states. If you exceed
your fleet limits, the request is deleted immediately.
961
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
Launch template
A launch template includes information about the instances to launch, such as the instance type,
Availability Zone, and the maximum price that you are willing to pay. For more information, see Launch
an instance from a launch template (p. 554).
Ensure that this role exists before you use the AWS CLI or an API to create an EC2 Fleet.
Note
An instant EC2 Fleet does not require this role.
If you no longer need to use EC2 Fleet, we recommend that you delete the AWSServiceRoleForEC2Fleet
role. After this role is deleted from your account, you can create the role again if you create another fleet.
For more information, see Using service-linked roles in the IAM User Guide.
Grant access to customer managed keys for use with encrypted AMIs and EBS
snapshots
If you specify an encrypted AMI (p. 185) or an encrypted Amazon EBS snapshot (p. 1732) in your EC2
Fleet and you use an AWS KMS key for encryption, you must grant the AWSServiceRoleForEC2Fleet role
962
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
permission to use the customer managed key so that Amazon EC2 can launch instances on your behalf.
To do this, you must add a grant to the customer managed key, as shown in the following procedure.
When providing permissions, grants are an alternative to key policies. For more information, see Using
grants and Using key policies in AWS KMS in the AWS Key Management Service Developer Guide.
To grant the AWSServiceRoleForEC2Fleet role permissions to use the customer managed key
• Use the create-grant command to add a grant to the customer managed key and to specify the
principal (the AWSServiceRoleForEC2Fleet service-linked role) that is given permission to perform
the operations that the grant permits. The customer managed key is specified by the key-id
parameter and the ARN of the customer managed key. The principal is specified by the grantee-
principal parameter and the ARN of the AWSServiceRoleForEC2Fleet service-linked role.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"iam:PassRole",
"iam:ListInstanceProfiles"
],
"Resource":"arn:aws:iam::123456789012:role/DevTeam*"
}
]
}
The ec2:* grants a user permission to call all Amazon EC2 API actions. To limit the user to specific
Amazon EC2 API actions, specify those actions instead.
963
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
The user must have permission to call the iam:ListRoles action to enumerate existing IAM roles,
the iam:PassRole action to specify the EC2 Fleet role, and the iam:ListInstanceProfiles
action to enumerate existing instance profiles.
(Optional) To enable a user to create roles or instance profiles using the IAM console, you must also
add the following actions to the policy:
• iam:AddRoleToInstanceProfile
• iam:AttachRolePolicy
• iam:CreateInstanceProfile
• iam:CreateRole
• iam:GetRole
• iam:ListPolicies
5. On the Review policy page, enter a policy name and description, and choose Create policy.
6. To provide access, add permissions to your users, groups, or roles:
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party
identity provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM
user in the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
EC2 Fleet determines the health status of an instance by using the status checks provided by Amazon
EC2. An instance is determined as unhealthy when the status of either the instance status check or the
system status check is impaired for three consecutive health status checks. For more information, see
Status checks for your instances (p. 1107).
You can configure your fleet to replace unhealthy Spot Instances. After setting
ReplaceUnhealthyInstances to true, a Spot Instance is replaced when it is reported as unhealthy.
The fleet can go below its target capacity for up to a few minutes while an unhealthy Spot Instance is
being replaced.
Requirements
• Health check replacement is supported only for EC2 Fleets that maintain a target capacity (fleets of
type maintain), and not for fleets of type request or instant.
• Health check replacement is supported only for Spot Instances. This feature is not supported for On-
Demand Instances.
• You can configure your EC2 Fleet to replace unhealthy instances only when you create it.
964
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
• Users can use health check replacement only if they have permission to call the
ec2:DescribeInstanceStatus action.
1. Follow the steps for creating an EC2 Fleet. For more information, see Create an EC2 Fleet (p. 967).
2. To configure the fleet to replace unhealthy Spot Instances, in the JSON file, for
ReplaceUnhealthyInstances, enter true.
To generate a JSON file with all possible EC2 Fleet parameters using the command line
• Use the create-fleet (AWS CLI) command and the --generate-cli-skeleton parameter to
generate an EC2 Fleet JSON file, and direct the output to a file to save it.
Example output
{
"DryRun": true,
"ClientToken": "",
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"MaintenanceStrategies": {
"CapacityRebalance": {
"ReplacementStrategy": "launch"
}
},
"InstanceInterruptionBehavior": "hibernate",
"InstancePoolsToUseCount": 0,
"SingleInstanceType": true,
"SingleAvailabilityZone": true,
"MinTargetCapacity": 0,
"MaxTotalPrice": ""
},
"OnDemandOptions": {
"AllocationStrategy": "prioritized",
"CapacityReservationOptions": {
"UsageStrategy": "use-capacity-reservations-first"
},
"SingleInstanceType": true,
"SingleAvailabilityZone": true,
"MinTargetCapacity": 0,
"MaxTotalPrice": ""
},
"ExcessCapacityTerminationPolicy": "termination",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "",
"LaunchTemplateName": "",
"Version": ""
},
965
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
"Overrides": [
{
"InstanceType": "r5.metal",
"MaxPrice": "",
"SubnetId": "",
"AvailabilityZone": "",
"WeightedCapacity": 0.0,
"Priority": 0.0,
"Placement": {
"AvailabilityZone": "",
"Affinity": "",
"GroupName": "",
"PartitionNumber": 0,
"HostId": "",
"Tenancy": "dedicated",
"SpreadDomain": "",
"HostResourceGroupArn": ""
},
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 0
},
"MemoryMiB": {
"Min": 0,
"Max": 0
},
"CpuManufacturers": [
"amd"
],
"MemoryGiBPerVCpu": {
"Min": 0.0,
"Max": 0.0
},
"ExcludedInstanceTypes": [
""
],
"InstanceGenerations": [
"previous"
],
"SpotMaxPricePercentageOverLowestPrice": 0,
"OnDemandMaxPricePercentageOverLowestPrice": 0,
"BareMetal": "included",
"BurstablePerformance": "required",
"RequireHibernateSupport": true,
"NetworkInterfaceCount": {
"Min": 0,
"Max": 0
},
"LocalStorage": "excluded",
"LocalStorageTypes": [
"ssd"
],
"TotalLocalStorageGB": {
"Min": 0.0,
"Max": 0.0
},
"BaselineEbsBandwidthMbps": {
"Min": 0,
"Max": 0
},
"AcceleratorTypes": [
"inference"
],
"AcceleratorCount": {
"Min": 0,
966
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
"Max": 0
},
"AcceleratorManufacturers": [
"amd"
],
"AcceleratorNames": [
"a100"
],
"AcceleratorTotalMemoryMiB": {
"Min": 0,
"Max": 0
}
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 0,
"OnDemandTargetCapacity": 0,
"SpotTargetCapacity": 0,
"DefaultTargetCapacityType": "on-demand",
"TargetCapacityUnitType": "memory-mib"
},
"TerminateInstancesWithExpiration": true,
"Type": "instant",
"ValidFrom": "1970-01-01T00:00:00",
"ValidUntil": "1970-01-01T00:00:00",
"ReplaceUnhealthyInstances": true,
"TagSpecifications": [
{
"ResourceType": "fleet",
"Tags": [
{
"Key": "",
"Value": ""
}
]
}
],
"Context": ""
}
You can specify multiple launch specifications that override the launch template. The launch
specifications can vary by instance type, Availability Zone, subnet, and maximum price, and can include
a different weighted capacity. Alternatively, you can specify the attributes that an instance must have,
and Amazon EC2 will identify all the instance types with those attributes. For more information, see
Attribute-based instance type selection for EC2 Fleet (p. 940).
967
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
If you do not specify a parameter, the fleet uses the default value for the parameter.
Specify the fleet parameters in a JSON file. For more information, see Generate an EC2 Fleet JSON
configuration file (p. 965).
• Use the create-fleet (AWS CLI) command to create an EC2 Fleet and specify the JSON file that
contains the fleet configuration parameters.
For example configuration files, see EC2 Fleet example configurations (p. 1060).
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE"
}
The following is example output for a fleet of type instant that launched the target capacity.
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE",
"Errors": [],
"Instances": [
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c5.large",
"AvailabilityZone": "us-east-1a"
}
},
"Lifecycle": "on-demand",
"InstanceIds": [
"i-1234567890abcdef0",
"i-9876543210abcdef9"
],
"InstanceType": "c5.large",
"Platform": null
},
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c4.large",
"AvailabilityZone": "us-east-1a"
}
},
"Lifecycle": "on-demand",
"InstanceIds": [
968
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
"i-5678901234abcdef0",
"i-5432109876abcdef9"
]
]
}
The following is example output for a fleet of type instant that launched part of the target capacity
with errors for instances that were not launched.
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE",
"Errors": [
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c4.xlarge",
"AvailabilityZone": "us-east-1a",
}
},
"Lifecycle": "on-demand",
"ErrorCode": "InsufficientInstanceCapacity",
"ErrorMessage": ""
},
],
"Instances": [
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c5.large",
"AvailabilityZone": "us-east-1a"
}
},
"Lifecycle": "on-demand",
"InstanceIds": [
"i-1234567890abcdef0",
"i-9876543210abcdef9"
]
]
}
The following is example output for a fleet of type instant that launched no instances.
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE",
"Errors": [
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c4.xlarge",
"AvailabilityZone": "us-east-1a",
}
969
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
},
"Lifecycle": "on-demand",
"ErrorCode": "InsufficientCapacity",
"ErrorMessage": ""
},
{
"LaunchTemplateAndOverrides": {
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-01234a567b8910abcEXAMPLE",
"Version": "1"
},
"Overrides": {
"InstanceType": "c5.large",
"AvailabilityZone": "us-east-1a",
}
},
"Lifecycle": "on-demand",
"ErrorCode": "InsufficientCapacity",
"ErrorMessage": ""
},
],
"Instances": []
}
When you tag a fleet request, the instances and volumes that are launched by the fleet are not
automatically tagged. You need to explicitly tag the instances and volumes launched by the fleet. You
can choose to assign tags to only the fleet request, or to only the instances launched by the fleet, or to
only the volumes attached to the instances launched by the fleet, or to all three.
Note
For instant fleet types, you can tag volumes that are attached to On-Demand Instances
and Spot Instances. For request or maintain fleet types, you can only tag volumes that are
attached to On-Demand Instances.
For more information about how tags work, see Tag your Amazon EC2 resources (p. 1894).
Prerequisite
Grant the user the permission to tag resources. For more information, see Example: Tag
resources (p. 1445).
• The ec2:CreateTags action. This grants the user permission to create tags.
• The ec2:CreateFleet action. This grants the user permission to create an EC2 Fleet request.
• For Resource, we recommend that you specify "*". This allows users to tag all resource types.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TagEC2FleetRequest",
"Effect": "Allow",
970
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
"Action": [
"ec2:CreateTags",
"ec2:CreateFleet"
],
"Resource": "*"
}
Important
We currently do not support resource-level permissions for the create-fleet resource. If you
specify create-fleet as a resource, you will get an unauthorized exception when you try to
tag the fleet. The following example illustrates how not to set the policy.
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:CreateFleet"
],
"Resource": "arn:aws:ec2:us-east-1:111122223333:create-fleet/*"
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
To tag an EC2 Fleet request when you create it, specify the key-value pair in the JSON file (p. 965) used
to create the fleet. The value for ResourceType must be fleet. If you specify another value, the fleet
request fails.
To tag instances and volumes when they are launched by the fleet, specify the tags in the launch
template (p. 556) that is referenced in the EC2 Fleet request.
Note
You can't tag volumes attached to Spot Instances that are launched by a request or maintain
fleet type.
To tag an existing EC2 Fleet request, instance, and volume (AWS CLI)
971
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
--resources fleet-12a34b55-67cd-8ef9-
ba9b-9208dEXAMPLE i-1234567890abcdef0 vol-1234567890EXAMPLE \
--tags Key=purpose,Value=test
Important
If a fleet is of type instant, you must specify the fleet ID, otherwise it does not appear in the
response. Include --fleet-ids as follows:
Example output
{
"Fleets": [
{
"ActivityStatus": "fulfilled",
"CreateTime": "2022-02-09T03:35:52+00:00",
"FleetId": "fleet-364457cd-3a7a-4ed9-83d0-7b63e51bb1b7",
"FleetState": "active",
"ExcessCapacityTerminationPolicy": "termination",
"FulfilledCapacity": 2.0,
"FulfilledOnDemandCapacity": 0.0,
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "$Latest"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"OnDemandTargetCapacity": 0,
"SpotTargetCapacity": 2,
"DefaultTargetCapacityType": "spot"
},
"TerminateInstancesWithExpiration": false,
"Type": "maintain",
"ReplaceUnhealthyInstances": false,
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"InstanceInterruptionBehavior": "terminate"
},
"OnDemandOptions": {
"AllocationStrategy": "lowestPrice"
}
}
]
}
972
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
Use the describe-fleet-instances command to describe the instances for the specified EC2 Fleet. The
returned list of running instances is refreshed periodically and might be out of date.
Example output
{
"ActiveInstances": [
{
"InstanceId": "i-09cd595998cb3765e",
"InstanceHealth": "healthy",
"InstanceType": "m4.large",
"SpotInstanceRequestId": "sir-86k84j6p"
},
{
"InstanceId": "i-09cf95167ca219f17",
"InstanceHealth": "healthy",
"InstanceType": "m4.large",
"SpotInstanceRequestId": "sir-dvxi7fsm"
}
],
"FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
Use the describe-fleet-history command to describe the history for the specified EC2 Fleet for the
specified time.
Example output
{
"HistoryRecords": [
{
"EventInformation": {
"EventSubType": "submitted"
},
"EventType": "fleetRequestChange",
"Timestamp": "2020-09-01T18:26:05.000Z"
},
{
"EventInformation": {
"EventSubType": "active"
},
"EventType": "fleetRequestChange",
"Timestamp": "2020-09-01T18:26:15.000Z"
},
{
"EventInformation": {
"EventDescription": "t2.small, ami-07c8bc5c1ce9598c3, ...",
"EventSubType": "progress"
},
"EventType": "fleetRequestChange",
"Timestamp": "2020-09-01T18:26:17.000Z"
},
{
"EventInformation": {
"EventDescription": "{\"instanceType\":\"t2.small\", ...}",
"EventSubType": "launched",
973
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
"InstanceId": "i-083a1c446e66085d2"
},
"EventType": "instanceChange",
"Timestamp": "2020-09-01T18:26:17.000Z"
},
{
"EventInformation": {
"EventDescription": "{\"instanceType\":\"t2.small\", ...}",
"EventSubType": "launched",
"InstanceId": "i-090db02406cc3c2d6"
},
"EventType": "instanceChange",
"Timestamp": "2020-09-01T18:26:17.000Z"
}
],
"FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"LastEvaluatedTime": "1970-01-01T00:00:00.000Z",
"StartTime": "2018-04-09T23:53:20.000Z"
}
You can only modify an EC2 Fleet that is of type maintain. You cannot modify an EC2 Fleet of type
request or instant.
When you increase the target capacity, the EC2 Fleet launches the additional instances according to the
instance purchasing option specified for DefaultTargetCapacityType, which are either On-Demand
Instances or Spot Instances.
If the DefaultTargetCapacityType is spot, the EC2 Fleet launches the additional Spot Instances
according to its allocation strategy. If the allocation strategy is lowest-price, the fleet launches
the instances from the lowest priced Spot capacity pool in the request. If the allocation strategy is
diversified, the fleet distributes the instances across the pools in the request.
When you decrease the target capacity, the EC2 Fleet deletes any open requests that exceed the new
target capacity. You can request that the fleet terminate instances until the size of the fleet reaches
the new target capacity. If the allocation strategy is lowest-price, the fleet terminates the instances
with the highest price per unit. If the allocation strategy is diversified, the fleet terminates instances
across the pools. Alternatively, you can request that EC2 Fleet keep the fleet at its current size, but not
replace any Spot Instances that are interrupted or any instances that you terminate manually.
When an EC2 Fleet terminates a Spot Instance because the target capacity was decreased, the instance
receives a Spot Instance interruption notice.
Use the modify-fleet command to update the target capacity of the specified EC2 Fleet.
974
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
--fleet-id fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--target-capacity-specification TotalTargetCapacity=20
If you are decreasing the target capacity but want to keep the fleet at its current size, you can modify the
previous command as follows.
When you delete an EC2 Fleet, you must also specify if you want to terminate all of its instances. These
include both On-Demand Instances and Spot Instances.
If you specify that the instances must be terminated when the fleet is deleted, the fleet enters the
deleted_terminating state. Otherwise, it enters the deleted_running state, and the instances
continue to run until they are interrupted or you terminate them manually.
Restrictions
• You can delete up to 25 instant fleets in a single request. If you exceed this number, no instant
fleets are deleted and an error is returned. There is no restriction on the number of fleets of type
maintain or request that can be deleted in a single request.
• Up to 1000 instances can be terminated in a single request to delete instant fleets.
Use the delete-fleets command and the --terminate-instances parameter to delete the specified
EC2 Fleet and terminate its associated instances.
Example output
{
"UnsuccessfulFleetDeletions": [],
"SuccessfulFleetDeletions": [
{
"CurrentFleetState": "deleted_terminating",
"PreviousFleetState": "active",
"FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
]
}
You can modify the previous command using the --no-terminate-instances parameter to delete
the specified EC2 Fleet without terminating its associated instances.
975
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
Note
--no-terminate-instances is not supported for instant fleets.
Example output
{
"UnsuccessfulFleetDeletions": [],
"SuccessfulFleetDeletions": [
{
"CurrentFleetState": "deleted_running",
"PreviousFleetState": "active",
"FleetId": "fleet-4b8aaae8-dfb5-436d-a4c6-3dafa4c6b7dcEXAMPLE"
}
]
}
• ExceededInstantFleetNumForDeletion
• fleetIdDoesNotExist
• fleetIdMalformed
• fleetNotInDeletableState
• NoTerminateInstancesNotSupported
• UnauthorizedOperation
• unexpectedError
Troubleshooting ExceededInstantFleetNumForDeletion
If you try to delete more than 25 instant fleets in a single request, the
ExceededInstantFleetNumForDeletion error is returned. The following is example output for this
error.
{
"UnsuccessfulFleetDeletions": [
{
"FleetId": " fleet-5d130460-0c26-bfd9-2c32-0100a098f625",
"Error": {
"Message": "Can’t delete more than 25 instant fleets in a single
request.",
"Code": "ExceededInstantFleetNumForDeletion"
}
},
{
"FleetId": "fleet-9a941b23-0286-5bf4-2430-03a029a07e31",
"Error": {
"Message": "Can’t delete more than 25 instant fleets in a single
request.",
"Code": "ExceededInstantFleetNumForDeletion"
976
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
}
}
.
.
.
],
"SuccessfulFleetDeletions": []
}
Troubleshoot NoTerminateInstancesNotSupported
If you specify that the instances in an instant fleet must not be terminated when you delete the fleet,
the NoTerminateInstancesNotSupported error is returned. --no-terminate-instances is not
supported for instant fleets. The following is example output for this error.
{
"UnsuccessfulFleetDeletions": [
{
"FleetId": "fleet-5d130460-0c26-bfd9-2c32-0100a098f625",
"Error": {
"Message": "NoTerminateInstances option is not supported for
instant fleet",
"Code": "NoTerminateInstancesNotSupported"
}
}
],
"SuccessfulFleetDeletions": []
Troubleshoot UnauthorizedOperation
If you do not have permission to terminate instances, you get the UnauthorizedOperation error when
deleting a fleet that must terminate its instances. The following is the error response.
To resolve the error, you must add the ec2:TerminateInstances action to the IAM policy, as shown in
the following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DeleteFleetsAndTerminateInstances",
"Effect": "Allow",
"Action": [
"ec2:DeleteFleets"
"ec2:TerminateInstances"
],
"Resource": "*"
977
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with EC2 Fleets
}
]
}
978
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet
Spot Fleet
A Spot Fleet is a set of Spot Instances and optionally On-Demand Instances that is launched based
on criteria that you specify. The Spot Fleet selects the Spot capacity pools that meet your needs and
launches Spot Instances to meet the target capacity for the fleet. By default, Spot Fleets are set to
maintain target capacity by launching replacement instances after Spot Instances in the fleet are
terminated. You can submit a Spot Fleet as a one-time request, which does not persist after the instances
have been terminated. You can include On-Demand Instance requests in a Spot Fleet request.
Note
If you want to use a console to create a fleet that includes Spot Instances, we recommend
using an Auto Scaling group rather than Spot Fleet. For more information, see Get started with
Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
If you want to use the AWS CLI to create a fleet that includes Spot Instances, we recommend
using either an Auto Scaling group or EC2 Fleet rather than Spot Fleet. The RequestSpotFleet
API, on which Spot Fleet is based, is a legacy API with no planned investment.
For more information about the recommended APIs to use, see Which is the best Spot request
method to use? (p. 387)
Topics
• Spot Fleet request types (p. 979)
• Spot Fleet configuration strategies (p. 980)
• Work with Spot Fleets (p. 1004)
• CloudWatch metrics for Spot Fleet (p. 1025)
• Automatic scaling for Spot Fleet (p. 1027)
request
If you configure the request type as request, Spot Fleet places an asynchronous one-time request
for your desired capacity. Thereafter, if capacity is diminished because of Spot interruptions, the
fleet does not attempt to replenish Spot Instances, nor does it submit requests in alternative Spot
capacity pools if capacity is unavailable.
maintain
If you configure the request type as maintain, Spot Fleet places an asynchronous request for
your desired capacity, and maintains capacity by automatically replenishing any interrupted Spot
Instances.
To specify the type of request in the Amazon EC2 console, do the following when creating a Spot Fleet
request:
• To create a Spot Fleet of type request, clear the Maintain target capacity check box.
• To create a Spot Fleet of type maintain, select the Maintain target capacity check box.
For more information, see Create a Spot Fleet request using defined parameters (console) (p. 1013).
Both types of requests benefit from an allocation strategy. For more information, see Allocation
strategies for Spot Instances (p. 981).
979
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
The Spot Fleet attempts to launch the number of Spot Instances and On-Demand Instances to meet the
target capacity that you specified in the Spot Fleet request. The request for Spot Instances is fulfilled
if there is available capacity and the maximum price you specified in the request exceeds the current
Spot price. The Spot Fleet also attempts to maintain its target capacity fleet if your Spot Instances are
interrupted.
You can also set a maximum amount per hour that you’re willing to pay for your fleet, and Spot Fleet
launches instances until it reaches the maximum amount. When the maximum amount you're willing to
pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
A Spot capacity pool is a set of unused EC2 instances with the same instance type (for example,
m5.large), operating system, Availability Zone, and network platform. When you make a Spot Fleet
request, you can include multiple launch specifications, that vary by instance type, AMI, Availability Zone,
or subnet. The Spot Fleet selects the Spot capacity pools that are used to fulfill the request, based on
the launch specifications included in your Spot Fleet request, and the configuration of the Spot Fleet
request. The Spot Instances come from the selected pools.
Contents
• Plan a Spot Fleet request (p. 980)
• Allocation strategies for Spot Instances (p. 981)
• Attribute-based instance type selection for Spot Fleet (p. 984)
• On-Demand in Spot Fleet (p. 998)
• Capacity Rebalancing (p. 998)
• Spot price overrides (p. 1002)
• Control spending (p. 1002)
• Spot Fleet instance weighting (p. 1002)
• Determine whether you want to create a Spot Fleet that submits a one-time request for the desired
target capacity, or one that maintains a target capacity over time.
• Determine the instance types that meet your application requirements.
• Determine the target capacity for your Spot Fleet request. You can set the target capacity in instances
or in custom units. For more information, see Spot Fleet instance weighting (p. 1002).
• Determine what portion of the Spot Fleet target capacity must be On-Demand capacity. You can
specify 0 for On-Demand capacity.
• Determine your price per unit, if you are using instance weighting. To calculate the price per unit,
divide the price per instance hour by the number of units (or weight) that this instance represents. If
you are not using instance weighting, the default price per unit is the price per instance hour.
• Review the possible options for your Spot Fleet request. For more information, see the request-spot-
fleet command in the AWS CLI Command Reference. For additional examples, see Spot Fleet example
configurations (p. 1075).
980
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
priceCapacityOptimized (recommended)
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that
are launching. This means that we will request Spot Instances from the pools that we believe have
the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the
lowest priced of these pools.
The priceCapacityOptimized allocation strategy is the best choice for most Spot workloads,
such as stateless containerized applications, microservices, web applications, data and analytics jobs,
and batch processing.
capacityOptimized
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that
are launching. This means that we will request Spot Instances from the pools that we believe have
the lowest chance of interruption in the near term. You can optionally set a priority for each instance
type in your fleet using capacityOptimizedPrioritized. Spot Fleet optimizes for capacity first,
but honors instance type priorities on a best-effort basis.
With Spot Instances, pricing changes slowly over time based on long-term trends in supply and
demand, but capacity fluctuates in real time. The capacityOptimized strategy automatically
launches Spot Instances into the most available pools by looking at real-time capacity data and
predicting which are the most available. This works well for workloads that may have a higher cost
of interruption associated with restarting work, such as long Continuous Integration (CI), image and
media rendering, Deep Learning, and High Performance Compute (HPC) workloads that may have
a higher cost of interruption associated with restarting work. By offering the possibility of fewer
interruptions, the capacityOptimized strategy can lower the overall cost of your workload.
The Spot Instances come from the lowest priced pool that has available capacity. This is the
default strategy. However, we recommend that you override the default by specifying the
priceCapacityOptimized allocation strategy.
If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next
lowest priced pool that has available capacity.
If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill
your request by drawing from the next lowest priced pool. To ensure that your desired capacity is
met, you might receive Spot Instances from several pools.
981
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Because this strategy only considers instance price and not capacity availability, it might lead to high
interruption rates.
InstancePoolsToUseCount
The number of Spot pools across which to allocate your target Spot capacity. Valid only when the
allocation strategy is set to lowestPrice. Spot Fleet selects the lowest priced Spot pools and
evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that Spot Fleet attempts to draw Spot Instances from the number of pools that you specify
on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, Spot
Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that
your target capacity is met, you might receive Spot Instances from more than the number of pools
that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full
target capacity from fewer than the number of pools that you specified.
To balance the trade-offs between the lowest priced Spot capacity pools and the Spot capacity pools
with the highest capacity availability, we recommend that you use the priceCapacityOptimized
allocation strategy. This strategy makes decisions about which pools to request Spot Instances from
based on both the price of the pools and the capacity availability of Spot Instances in those pools. This
means that we will request Spot Instances from the pools that we believe have the lowest chance of
interruption in the near term, while still taking price into consideration.
If your fleet runs resilient and stateless workloads, including containerized applications,
microservices, web applications, data and analytics jobs, and batch processing, then use the
priceCapacityOptimized allocation strategy for optimal cost savings and capacity availability.
If your fleet runs workloads that might have a higher cost of interruption associated with restarting
work, then you should implement checkpointing so that applications can restart from that point if
they're interrupted. By using checkpointing, you make the priceCapacityOptimized allocation
strategy a good fit for these workloads because it allocates capacity from the lowest priced pools that
also offer a low Spot Instance interruption rate.
For an example configuration that uses the priceCapacityOptimized allocation strategy, see
Example 10: Launch Spot Instances in a capacity-optimized fleet with priorities (p. 1072).
You can optionally use the capacityOptimized strategy if you run workloads that either use similarly
priced instance types, or where the cost of interruption is so significant that any cost saving is inadequate
in comparison to a marginal increase in interruptions. This strategy allocates capacity from the most
available Spot capacity pools that offer the possibility of fewer interruptions, which can lower the overall
cost of your workload. For an example configuration that uses the capacityOptimized allocation
strategy, see Example 8: Configure Capacity Rebalancing to launch replacement Spot Instances (p. 1070).
When the possibility of interruptions must be minimized but the preference for certain instance
types matters, you can express your pool priorities by using the capacityOptimizedPrioritized
allocation strategy and then setting the order of instance types to use from highest to lowest
982
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
priority. For an example configuration, see Example 9: Launch Spot Instances in a capacity-optimized
fleet (p. 1071).
Note that using priorities is supported only if your fleet uses a launch template. Also note that when you
set priorities for capacityOptimizedPrioritized, the same priorities are also applied to your On-
Demand Instances if the On-Demand AllocationStrategy is set to prioritized.
When your workload is time flexible and capacity availability is not a factor
If your fleet is small or runs for a short time, you can use priceCapacityOptimized to maximize cost
savings while still considering capacity availability.
If your workload is time flexible and capacity availability is not a factor, you can optionally use
the lowestPrice allocation strategy to maximize cost savings. Note, however, that because the
lowestPrice allocation strategy only considers instance price and not capacity availability, it might
lead to high Spot Instance interruption rates.
If your fleet is large or runs for a long time, you can improve the availability of your fleet by distributing
the Spot Instances across multiple pools using the diversified strategy. For example, if your Spot
Fleet specifies 10 pools and a target capacity of 100 instances, the fleet launches 10 Spot Instances in
each pool. If the Spot price for one pool exceeds your maximum price for this pool, only 10% of your
fleet is affected. Using this strategy also makes your fleet less sensitive to increases in the Spot price in
any one pool over time. With the diversified strategy, the Spot Fleet does not launch Spot Instances
into any pools with a Spot price that is equal to or higher than the On-Demand price.
To create an inexpensive and diversified fleet, use the lowestPrice strategy in combination with
InstancePoolsToUseCount. For example, if your target capacity is 10 Spot Instances, and you specify
2 Spot capacity pools (for InstancePoolsToUseCount), Spot Fleet will draw on the two lowest priced
pools to fulfill your Spot capacity.
You can use a low or high number of Spot capacity pools across which to allocate your Spot Instances.
For example, if you run batch processing, we recommend specifying a low number of Spot capacity
pools (for example, InstancePoolsToUseCount=2) to ensure that your queue always has compute
capacity while maximizing savings. If you run a web service, we recommend specifying a high number of
Spot capacity pools (for example, InstancePoolsToUseCount=10) to minimize the impact if a Spot
capacity pool becomes temporarily unavailable.
Note that Spot Fleet attempts to draw Spot Instances from the number of pools that you specify on
a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, Spot Fleet
will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your
target capacity is met, you might receive Spot Instances from more than the number of pools that you
specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity
from fewer than the number of pools that you specified.
983
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
• If the allocation strategy is diversified, the fleet distributes the replacement Spot Instances across
the remaining pools.
• If the allocation strategy is lowestPrice, the fleet launches replacement instances in the pool where
the Spot price is currently the lowest.
• If the allocation strategy is lowestPrice in combination with InstancePoolsToUseCount, the
fleet selects the Spot capacity pools with the lowest price and launches Spot Instances across the
number of Spot capacity pools that you specify.
Attribute-based instance type selection is ideal for workloads and frameworks that can be flexible about
what instance types they use, such as when running containers or web fleets, processing big data, and
implementing continuous integration and deployment (CI/CD) tooling.
Benefits
• With so many instance types available, finding the right instance types for your workload can be
time consuming. When you specify instance attributes, the instance types will automatically have the
required attributes for your workload.
• To manually specify multiple instance types for a Spot Fleet, you must create a separate launch
template override for each instance type. But with attribute-based instance type selection, to provide
multiple instance types, you need only specify the instance attributes in the launch template or in a
launch template override.
• When you specify instance attributes rather than instance types, your fleet can use newer generation
instance types as they’re released, "future proofing" the fleet's configuration.
• When you specify instance attributes rather than instance types, Spot Fleet can select from a wide
range of instance types for launching Spot Instances, which adheres to the Spot best practice of
instance type flexibility (p. 386).
Topics
• How attribute-based instance type selection works (p. 984)
• Considerations (p. 987)
• Create a Spot Fleet with attribute-based instance type selection (p. 987)
• Examples of configurations that are valid and not valid (p. 989)
• Preview instance types with specified attributes (p. 995)
984
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Topics
• Types of instance attributes (p. 985)
• Where to configure attribute-based instance type selection (p. 985)
• How Spot Fleet uses attribute-based instance type selection when provisioning a fleet (p. 985)
• Price protection (p. 986)
There are several instance attributes that you can specify to express your compute requirements. For a
description of each attribute and the default values, see InstanceRequirements in the Amazon EC2 API
Reference.
Depending on whether you use the console or the AWS CLI, you can specify the instance attributes for
attribute-based instance type selection as follows:
In the console, you can specify the instance attributes in one or both of the following fleet configuration
components:
• In a launch template, and then reference the launch template in the fleet request
• In the fleet request
In the AWS CLI, you can specify the instance attributes in one or all of the following fleet configuration
components:
• In a launch template, and reference the launch template in the fleet request
• In a launch template override
If you want a mix of instances that use different AMIs, you can specify instance attributes in multiple
launch template overrides. For example, different instance types can use x86 and Arm-based
processors.
• In a launch specification
How Spot Fleet uses attribute-based instance type selection when provisioning a fleet
• Spot Fleet identifies the instance types that have the specified attributes.
• Spot Fleet uses price protection to determine which instance types to exclude.
• Spot Fleet determines the capacity pools from which it will consider launching the instances based on
the AWS Regions or Availability Zones that have matching instance types.
• Spot Fleet applies the specified allocation strategy to determine from which capacity pools to launch
the instances.
Note that attribute-based instance type selection does not pick the capacity pools from which to
provision the fleet; that's the job of the allocation strategies. There might be a large number of
instance types with the specified attributes, and some of them might be expensive. The default
allocation strategy of lowestPrice for Spot and On-Demand guarantees that Spot Fleet will launch
instances from the least expensive capacity pools.
If you specify an allocation strategy, Spot Fleet will launch instances according to the specified
allocation strategy.
985
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Price protection
Price protection is a feature that prevents your Spot Fleet from using instance types that you would
consider too expensive even if they happen to fit the attributes that you specified. When you create a
fleet with attribute-based instance type selection, price protection is enabled by default, with separate
thresholds for On-Demand Instances and Spot Instances. When Amazon EC2 selects instance types with
your attributes, it excludes instance types priced above your threshold. The thresholds represent the
maximum you'll pay, expressed as a percentage above the least expensive current generation M, C, or R
instance type with your specified attributes.
If you don't specify a threshold, the following thresholds are used by default:
While creating the Spot Fleet, configure the fleet for attribute-based instance type selection, and then
do the following:
• Console
To specify the On-Demand Instance price protection threshold, under Additional instance attribute,
choose On-demand price protection, and then choose Add attribute. For On-Demand price
protection percentage, enter the price protection threshold as a percentage.
To specify the Spot Instance price protection threshold, under Additional instance attribute, choose
Spot price protection, and then choose Add attribute. For Spot price protection percentage, enter
the price protection threshold as a percentage.
• AWS CLI
To specify the On-Demand Instance price protection threshold, in the JSON configuration file, in the
InstanceRequirements structure, for OnDemandMaxPricePercentageOverLowestPrice, enter
the price protection threshold as a percentage.
To specify the Spot Instance price protection threshold, in the JSON configuration file, in the
InstanceRequirements structure, for SpotMaxPricePercentageOverLowestPrice, enter the
price protection threshold as a percentage.
For more information about creating the fleet, see Create a Spot Fleet with attribute-based instance type
selection (p. 987).
Note
When creating the Spot Fleet, if you set Total target capacity type to vCPUs or Memory
(MiB) (console) or TargetCapacityUnitType to vcpu or memory-mib (AWS CLI), the price
protection threshold is applied based on the per-vCPU or per-memory price instead of the per-
instance price.
986
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Considerations
• You can specify either instance types or instance attributes in a Spot Fleet, but not both at the same
time.
When using the CLI, the launch template overrides will override the launch template. For example,
if the launch template contains an instance type and the launch template override contains instance
attributes, the instances that are identified by the instance attributes will override the instance type in
the launch template.
• When using the CLI, when you specify instance attributes as overrides, you can't also specify weights or
priorities.
• You can specify a maximum of four InstanceRequirements structures in a request configuration.
Topics
• Create a Spot Fleet using the console (p. 987)
• Create a Spot Fleet using the AWS CLI (p. 987)
While creating the Spot Fleet, configure the fleet for attribute-based instance type selection as
follows:
a. For Instance type requirements, choose Specify instance attributes that match your compute
requirements.
b. For vCPUs, enter the desired minimum and maximum number of vCPUs. To specify no limit,
select No minimum, No maximum, or both.
c. For Memory (GiB), enter the desired minimum and maximum amount of memory. To specify no
limit, select No minimum, No maximum, or both.
d. (Optional) For Additional instance attributes, you can optionally specify one or more attributes
to express your compute requirements in more detail. Each additional attribute adds further
constraints to your request.
e. (Optional) Expand Preview matching instance types to view the instance types that have your
specified attributes.
Use the request-spot-fleet (AWS CLI) command to create a Spot Fleet. Specify the fleet configuration in a
JSON file.
987
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
--region us-east-1 \
--spot-fleet-request-config file://file_name.json
The following example contains the parameters that configure a Spot Fleet to use attribute-based
instance type selection, and is followed by a text explanation.
{
"AllocationStrategy": "priceCapacityOptimized",
"TargetCapacity": 20,
"Type": "request",
"LaunchTemplateConfigs": [{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2
},
"MemoryMiB": {
"Min": 4
}
}
}]
}]
}
The attributes for attribute-based instance type selection are specified in the InstanceRequirements
structure. In this example, two attributes are specified:
Any instance types that have 2 or more vCPUs and 4 MiB or more of memory will be identified. However,
price protection and the allocation strategy might exclude some instance types when Spot Fleet
provisions the fleet (p. 985).
For a list and descriptions of all the possible attributes that you can specify, see InstanceRequirements in
the Amazon EC2 API Reference.
Note
When InstanceRequirements is included in the fleet configuration, InstanceType and
WeightedCapacity must be excluded; they cannot determine the fleet configuration at the
same time as instance attributes.
988
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Configurations are considered not valid when they contain the following:
Example configurations
• Valid configuration: Single launch template with overrides (p. 989)
• Valid configuration: Single launch template with multiple InstanceRequirements (p. 990)
• Valid configuration: Two launch templates, each with overrides (p. 991)
• Valid configuration: Only InstanceRequirements specified, no overlapping attribute values (p. 992)
• Configuration not valid: Overrides contain InstanceRequirements and InstanceType (p. 993)
• Configuration not valid: Two Overrides contain InstanceRequirements and InstanceType (p. 993)
• Configuration not valid: Overlapping attribute values (p. 994)
The following configuration is valid. It contains one launch template and one Overrides structure
containing one InstanceRequirements structure. A text explanation of the example configuration
follows.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "My-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2,
"Max": 8
},
"MemoryMib": {
"Min": 0,
"Max": 10240
},
"MemoryGiBPerVCpu": {
"Max": 10000
},
"RequireHibernateSupport": true
}
}
]
}
989
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
],
"TargetCapacity": 5000,
"OnDemandTargetCapacity": 0,
"TargetCapacityUnitType": "vcpu"
}
}
InstanceRequirements
To use attribute-based instance selection, you must include the InstanceRequirements structure in
your fleet configuration, and specify the desired attributes for the instances in the fleet.
• VCpuCount – The instance types must have a minimum of 2 and a maximum of 8 vCPUs.
• MemoryMiB – The instance types must have a maximum of 10240 MiB of memory. A minimum of 0
indicates no minimum limit.
• MemoryGiBPerVCpu – The instance types must have a maximum of 10,000 GiB of memory per vCPU.
The Min parameter is optional. By omitting it, you indicate no minimum limit.
TargetCapacityUnitType
The TargetCapacityUnitType parameter specifies the unit for the target capacity. In the example,
the target capacity is 5000 and the target capacity unit type is vcpu, which together specify a desired
target capacity of 5,000 vCPUs. Spot Fleet will launch enough instances so that the total number of
vCPUs in the fleet is 5,000 vCPUs.
The following configuration is valid. It contains one launch template and one Overrides
structure containing two InstanceRequirements structures. The attributes specified
in InstanceRequirements are valid because the values do not overlap—the first
InstanceRequirements structure specifies a VCpuCount of 0-2 vCPUs, while the second
InstanceRequirements structure specifies 4-8 vCPUs.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"InstanceRequirements": {
990
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
"VCpuCount": {
"Min": 4,
"Max": 8
},
"MemoryMiB": {
"Min": 0
}
}
}
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
"Type": "maintain"
}
}
The following configuration is valid. It contains two launch templates, each with one Overrides
structure containing one InstanceRequirements structure. This configuration is useful for arm and
x86 architecture support in the same fleet.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "armLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "x86LaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
991
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
"Type": "maintain"
}
}
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
]
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyOtherLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 4,
"Max": 8
},
"MemoryMiB": {
"Min": 0
}
}
}
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
992
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
"Type": "maintain"
}
}
The following configuration is not valid. The Overrides structure contains both
InstanceRequirements and InstanceType. For the Overrides, you can specify either
InstanceRequirements or InstanceType, but not both.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
},
{
"InstanceType": "m5.large"
}
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
"Type": "maintain"
}
}
The following configuration is not valid. The Overrides structures contain both
InstanceRequirements and InstanceType. You can specify either InstanceRequirements or
InstanceType, but not both, even if they're in different Overrides structures.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
993
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
]
},
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyOtherLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "m5.large"
}
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
"Type": "maintain"
}
}
The following configuration is not valid. The two InstanceRequirements structures each contain
"VCpuCount": {"Min": 0, "Max": 2}. The values for these attributes overlap, which will result in
duplicate capacity pools.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "MyLaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
},
{
"InstanceRequirements": {
"VCpuCount": {
994
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
"Min": 0,
"Max": 2
},
"MemoryMiB": {
"Min": 0
}
}
}
}
]
}
],
"TargetCapacity": 1,
"OnDemandTargetCapacity": 0,
"Type": "maintain"
}
}
To preview a list of instance types by specifying attributes using the AWS CLI
1. (Optional) To generate all of the possible attributes that can be specified, use the get-instance-
types-from-instance-requirements command and the --generate-cli-skeleton parameter. You
can optionally direct the output to a file to save it by using input > attributes.json.
Expected output
{
"DryRun": true,
"ArchitectureTypes": [
"i386"
],
"VirtualizationTypes": [
"hvm"
],
"InstanceRequirements": {
"VCpuCount": {
"Min": 0,
"Max": 0
},
"MemoryMiB": {
"Min": 0,
"Max": 0
},
"CpuManufacturers": [
"intel"
],
"MemoryGiBPerVCpu": {
"Min": 0.0,
"Max": 0.0
},
"ExcludedInstanceTypes": [
995
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
""
],
"InstanceGenerations": [
"current"
],
"SpotMaxPricePercentageOverLowestPrice": 0,
"OnDemandMaxPricePercentageOverLowestPrice": 0,
"BareMetal": "included",
"BurstablePerformance": "included",
"RequireHibernateSupport": true,
"NetworkInterfaceCount": {
"Min": 0,
"Max": 0
},
"LocalStorage": "included",
"LocalStorageTypes": [
"hdd"
],
"TotalLocalStorageGB": {
"Min": 0.0,
"Max": 0.0
},
"BaselineEbsBandwidthMbps": {
"Min": 0,
"Max": 0
},
"AcceleratorTypes": [
"gpu"
],
"AcceleratorCount": {
"Min": 0,
"Max": 0
},
"AcceleratorManufacturers": [
"nvidia"
],
"AcceleratorNames": [
"a100"
],
"AcceleratorTotalMemoryMiB": {
"Min": 0,
"Max": 0
},
"NetworkBandwidthGbps": {
"Min": 0.0,
"Max": 0.0
},
"AllowedInstanceTypes": [
""
]
},
"MaxResults": 0,
"NextToken": ""
}
2. Create a JSON configuration file using the output from the previous step, and configure it as follows:
Note
You must provide values for ArchitectureTypes, VirtualizationTypes, VCpuCount,
and MemoryMiB. You can omit the other attributes; when omitted, the default values are
used.
For a description of each attribute and their default values, see get-instance-types-from-
instance-requirements in the Amazon EC2 Command Line Reference.
996
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
In this example, the required attributes are included in the JSON file. They are
ArchitectureTypes, VirtualizationTypes, VCpuCount, and MemoryMiB. In addition, the
optional InstanceGenerations attribute is also included. Note that for MemoryMiB, the Max
value can be omitted to indicate that there is no limit.
{
"ArchitectureTypes": [
"x86_64"
],
"VirtualizationTypes": [
"hvm"
],
"InstanceRequirements": {
"VCpuCount": {
"Min": 4,
"Max": 6
},
"MemoryMiB": {
"Min": 2048
},
"InstanceGenerations": [
"current"
]
}
}
Example output
------------------------------------------
|GetInstanceTypesFromInstanceRequirements|
+----------------------------------------+
|| InstanceTypes ||
|+--------------------------------------+|
|| InstanceType ||
|+--------------------------------------+|
|| c4.xlarge ||
|| c5.xlarge ||
|| c5a.xlarge ||
|| c5ad.xlarge ||
|| c5d.xlarge ||
|| c5n.xlarge ||
997
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
|| c6a.xlarge ||
...
4. After identifying instance types that meet your needs, make note of the instance attributes that you
used so that you can use them when configuring your fleet request.
The priority is assigned to the launch template override, and the highest priority is launched first.
In this example, you configure three launch template overrides, each with a different instance type.
The On-Demand price for the instance types range in price. The following are the instance types used in
this example, listed in order of price, starting with the cheapest instance type:
• m4.large – cheapest
• m5.large
• m5a.large
If you do not use priority to determine the order, the fleet fulfills the On-Demand capacity by starting
with the cheapest instance type.
However, say you have unused m5.large Reserved Instances that you want to use first. You can set the
launch template override priority so that the instance types are used in the order of priority, as follows:
• m5.large – priority 1
• m4.large – priority 2
• m5a.large – priority 3
Capacity Rebalancing
You can configure Spot Fleet to launch a replacement Spot Instance when Amazon EC2 emits a rebalance
recommendation to notify you that a Spot Instance is at an elevated risk of interruption. Capacity
Rebalancing helps you maintain workload availability by proactively augmenting your fleet with a new
Spot Instance before a running instance is interrupted by Amazon EC2. For more information, see EC2
instance rebalance recommendations (p. 418).
To configure Spot Fleet to launch a replacement Spot Instance, you can use the Amazon EC2 console or
the AWS CLI.
998
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
• Amazon EC2 console: You must select the Capacity rebalance check box when you create the Spot
Fleet. For more information, see step 6.d. in Create a Spot Fleet request using defined parameters
(console) (p. 1013).
• AWS CLI: Use the request-spot-fleet command and the relevant parameters in the
SpotMaintenanceStrategies structure. For more information, see the example launch
configuration (p. 1083).
Limitations
• Capacity Rebalancing is available only for fleets of type maintain.
• When the fleet is running, you can't modify the Capacity Rebalancing setting. To change the Capacity
Rebalancing setting, you must delete the fleet and create a new fleet.
Configuration options
The ReplacementStrategy for Spot Fleet supports the following two values:
launch-before-terminate
Amazon EC2 terminates the Spot Instances that receive a rebalance notification after new
replacement Spot Instances are launched. When you specify launch-before-terminate, you
must also specify a value for termination-delay. After the new replacement instances are
launched, Amazon EC2 waits for the duration of the termination-delay, and then terminates
the old instances. For termination-delay, the minimum is 120 seconds (2 minutes), and the
maximum is 7200 seconds (2 hours).
We recommend that you use launch-before-terminate only if you can predict how long your
instance shutdown procedures will take to complete. This will ensure that the old instances are
terminated only after the shutdown procedures are completed. Note that Amazon EC2 can interrupt
the old instances with a two-minute warning before the termination-delay.
We strongly recommend against using the lowestPrice allocation strategy in combination with
launch-before-terminate to avoid having replacement Spot Instances that are also at an
elevated risk of interruption.
launch
Amazon EC2 launches replacement Spot Instances when a rebalance notification is emitted for
existing Spot Instances. Amazon EC2 does not terminate the instances that receive a rebalance
notification. You can terminate the old instances, or you can leave them running. You are charged for
all instances while they are running.
Considerations
If you configure a Spot Fleet for Capacity Rebalancing, consider the following:
Configure your Spot Fleet to use multiple instance types and Availability Zones. This provides the
flexibility to launch Spot Instances in various Spot capacity pools. For more information, see Be
flexible about instance types and Availability Zones (p. 386).
Avoid an elevated risk of interruption of replacement Spot Instances
Your replacement Spot Instances may be at an elevated risk of interruption if you use the
lowestPrice allocation strategy. This is because Amazon EC2 will always launch instances in
the lowest priced pool that has available capacity at that moment, even if your replacement Spot
999
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
Instances are likely to be interrupted soon after being launched. To avoid an elevated risk of
interruption, we strongly recommend against using the lowestPrice allocation strategy, and
instead recommend the capacityOptimized or capacityOptimizedPrioritized allocation
strategy. These strategies ensure that replacement Spot Instances are launched in the most optimal
Spot capacity pools, and are therefore less likely to be interrupted in the near future. For more
information, see Use the price and capacity optimized allocation strategy (p. 386).
Amazon EC2 will only launch a new instance if availability is the same or better
One of the goals of Capacity Rebalancing is to improve a Spot Instance's availability. If an existing
Spot Instance receives a rebalance recommendation, Amazon EC2 will only launch a new instance
if the new instance provides the same or better availability than the existing instance. If the risk of
interruption of a new instance will be worse than the existing instance, then Amazon EC2 will not
launch a new instance. Amazon EC2 will, however, continue to assess the Spot capacity pools, and
will launch a new instance if availability improves.
There is a chance that your existing instance will be interrupted without Amazon EC2 proactively
launching a new instance. When this happens, Amazon EC2 will attempt to launch a new instance
regardless of whether the new instance has a high risk of interruption.
Capacity Rebalancing does not increase your Spot Instance interruption rate
When you enable Capacity Rebalancing, it does not increase your Spot Instance interruption
rate (p. 421) (the number of Spot Instances that are reclaimed when Amazon EC2 needs the capacity
back). However, if Capacity Rebalancing detects an instance is at risk of interruption, Amazon EC2
will immediately attempt to launch a new instance. The result is that more instances might be
replaced than if you’d waited for Amazon EC2 to launch a new instance after the at-risk instance was
interrupted.
While you might replace more instances with Capacity Rebalancing enabled, you benefit from
being proactive rather than reactive by having more time to take action before your instances are
interrupted. With a Spot Instance interruption notice (p. 429), you typically only have up to two
minutes to gracefully shut down your instance. With Capacity Rebalancing launching a new instance
in advance, you give existing processes a better chance of completing on your at-risk instance,
you can start your instance shutdown procedures, and prevent new work from being scheduled
on your at-risk instance. You can also start preparing the newly-launched instance to take over
the application. With Capacity Rebalancing’s proactive replacement, you benefit from graceful
continuity.
As a theoretical example to demonstrate the risks and benefits of using Capacity Rebalancing,
consider the following scenario:
• 2:00 PM – A rebalance recommendation is received for instance-A, and Amazon EC2 immediately
starts attempting to launch a replacement instance-B, giving you time to start your shutdown
procedures.*
• 2:30 PM – A rebalance recommendation is received for instance-B, replaced with instance-C, giving
you time to start your shutdown procedures.*
• 2:32 PM – If Capacity Rebalancing wasn’t enabled, and if a Spot Instance interruption notice
would've been received at 2:32 PM for instance-A, you would only have had up to two minutes to
take action, but Instance-A would have been running up till this time.
* If launch-before-terminate is specified, Amazon EC2 will terminate the at-risk instance after
the replacement instance comes online.
Amazon EC2 can launch new replacement Spot Instances until fulfilled capacity is double target
capacity
When a Spot Fleet is configured for Capacity Rebalancing, Amazon EC2 attempts to launch a new
replacement Spot Instance for every Spot Instance that receives a rebalance recommendation. After
a Spot Instance receives a rebalance recommendation, it is no longer counted as part of the fulfilled
capacity. Depending on the replacement strategy, Amazon EC2 either terminates the instance after
1000
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
a preconfigured termination delay, or leaves it running. This gives you the opportunity to perform
rebalancing actions (p. 418) on the instance.
If your fleet reaches double its target capacity, it stops launching new replacement instances even if
the replacement instances themselves receive a rebalance recommendation.
For example, you create a Spot Fleet with a target capacity of 100 Spot Instances. All of the
Spot Instances receive a rebalance recommendation, which causes Amazon EC2 to launch 100
replacement Spot Instances. This raises the number of fulfilled Spot Instances to 200, which is
double the target capacity. Some of the replacement instances receive a rebalance recommendation,
but no more replacement instances are launched because the fleet cannot exceed double its target
capacity.
Note that you are charged for all of the instances while they are running.
We recommend that you configure Spot Fleet to terminate Spot Instances that receive a rebalance
recommendation
If you configure your Spot Fleet for Capacity Rebalancing, we recommend that you choose launch-
before-terminate with an appropriate termination delay only if you can predict how long your
instance shutdown procedures will take to complete. This will ensure that the old instances are
terminated only after the shutdown procedures are completed.
If you choose to terminate the instances that are recommended for rebalance yourself, we
recommend that you monitor the rebalance recommendation signal that is received by the Spot
Instances in the fleet. By monitoring the signal, you can quickly perform rebalancing actions (p. 418)
on the affected instances before Amazon EC2 interrupts them, and then you can manually
terminate them. If you do not terminate the instances, you continue paying for them while they
are running. Amazon EC2 does not automatically terminate the instances that receive a rebalance
recommendation.
You can set up notifications using Amazon EventBridge or instance metadata. For more information,
see Monitor rebalance recommendation signals (p. 419).
Spot Fleet does not count instances that receive a rebalance recommendation when calculating
fulfilled capacity during scale in or out
If your Spot Fleet is configured for Capacity Rebalancing, and you change the target capacity to
either scale in or scale out, the fleet does not count the instances that are marked for rebalance as
part of the fulfilled capacity, as follows:
• Scale in – If you decrease your desired target capacity, Amazon EC2 terminates instances that are
not marked for rebalance until the desired capacity is reached. The instances that are marked for
rebalance are not counted towards the fulfilled capacity.
For example, you create a Spot Fleet with a target capacity of 100 Spot Instances. 10 instances
receive a rebalance recommendation, so Amazon EC2 launches 10 new replacement instances,
resulting in a fulfilled capacity of 110 instances. You then reduce the target capacity to 50 (scale
in), but the fulfilled capacity is actually 60 instances because the 10 instances that are marked for
rebalance are not terminated by Amazon EC2. You need to manually terminate these instances, or
you can leave them running.
• Scale out – If you increase your desired target capacity, Amazon EC2 launches new instances until
the desired capacity is reached. The instances that are marked for rebalance are not counted
towards the fulfilled capacity.
For example, you create a Spot Fleet with a target capacity of 100 Spot Instances. 10 instances
receive a rebalance recommendation, so Amazon EC2 launches 10 new replacement instances,
resulting in a fulfilled capacity of 110 instances. You then increase the target capacity to 200
(scale out), but the fulfilled capacity is actually 210 instances because the 10 instances that are
marked for rebalance are not counted by the fleet as part of the target capacity. You need to
manually terminate these instances, or you can leave them running.
1001
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
You can optionally specify a maximum price in one or more launch specifications. This price is specific
to the launch specification. If a launch specification includes a specific price, the Spot Fleet uses this
maximum price, overriding the global maximum price. Any other launch specifications that do not
include a specific maximum price still use the global maximum price.
Control spending
Spot Fleet stops launching instances when it has either reached the target capacity or the maximum
amount you’re willing to pay. To control the amount you pay per hour for your fleet, you can specify the
SpotMaxTotalPrice for Spot Instances and the OnDemandMaxTotalPrice for On-Demand Instances.
When the maximum total price is reached, Spot Fleet stops launching instances even if it hasn’t met the
target capacity.
The following examples show two different scenarios. In the first, Spot Fleet stops launching instances
when it has met the target capacity. In the second, Spot Fleet stops launching instances when it has
reached the maximum amount you’re willing to pay.
Spot Fleet launches 10 On-Demand Instances because the total of $1.00 (10 instances x $0.10) does not
exceed the OnDemandMaxTotalPrice of $1.50.
If Spot Fleet launches the On-Demand target capacity (10 On-Demand Instances), the total cost per
hour would be $1.00. This is more than the amount ($0.80) specified for OnDemandMaxTotalPrice.
To prevent spending more than you're willing to pay, Spot Fleet launches only 8 On-Demand
Instances (below the On-Demand target capacity) because launching more would exceed the
OnDemandMaxTotalPrice.
By default, the price that you specify is per instance hour. When you use the instance weighting feature,
the price that you specify is per unit hour. You can calculate your price per unit hour by dividing your
price for an instance type by the number of units that it represents. Spot Fleet calculates the number
of Spot Instances to launch by dividing the target capacity by the instance weight. If the result isn't an
1002
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet configuration strategies
integer, the Spot Fleet rounds it up to the next integer, so that the size of your fleet is not below its
target capacity. Spot Fleet can select any pool that you specify in your launch specification, even if the
capacity of the instances launched exceeds the requested target capacity.
The following tables provide examples of calculations to determine the price per unit for a Spot Fleet
request with a target capacity of 10.
Instance type Instance Price per Price per unit Number of instances launched
weight instance hour hour
Instance type Instance Price per Price per unit Number of instances launched
weight instance hour hour
Use Spot Fleet instance weighting as follows to provision the target capacity that you want in the pools
with the lowest price per unit at the time of fulfillment:
1. Set the target capacity for your Spot Fleet either in instances (the default) or in the units of your
choice, such as virtual CPUs, memory, storage, or throughput.
2. Set the price per unit.
3. For each launch configuration, specify the weight, which is the number of units that the instance
type represents toward the target capacity.
• A target capacity of 24
• A launch specification with an instance type r3.2xlarge and a weight of 6
• A launch specification with an instance type c3.xlarge and a weight of 5
The weights represent the number of units that instance type represents toward the target capacity. If
the first launch specification provides the lowest price per unit (price for r3.2xlarge per instance hour
divided by 6), the Spot Fleet would launch four of these instances (24 divided by 6).
If the second launch specification provides the lowest price per unit (price for c3.xlarge per instance
hour divided by 5), the Spot Fleet would launch five of these instances (24 divided by 5, result rounded
up).
• A target capacity of 30
• A launch specification with an instance type c3.2xlarge and a weight of 8
1003
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
The Spot Fleet would launch four instances (30 divided by 8, result rounded up). With the lowestPrice
strategy, all four instances come from the pool that provides the lowest price per unit. With the
diversified strategy, the Spot Fleet launches one instance in each of the three pools, and the fourth
instance in whichever pool provides the lowest price per unit.
If your fleet includes Spot Instances, Amazon EC2 can attempt to maintain your fleet target capacity as
Spot prices change.
It is not possible to modify the target capacity of a one-time request after it's been submitted. To change
the target capacity, cancel the request and submit a new one.
A Spot Fleet request remains active until it expires or you cancel it. When you cancel a fleet request, you
can specify whether canceling the request terminates the Spot Instances in that fleet.
Contents
• Spot Fleet request states (p. 1004)
• Spot Fleet health checks (p. 1005)
• Spot Fleet permissions (p. 1006)
• Create a Spot Fleet request (p. 1012)
• Tag a Spot Fleet (p. 1016)
• Describe your Spot Fleet (p. 1022)
• Modify a Spot Fleet request (p. 1023)
• Cancel a Spot Fleet request (p. 1024)
• submitted – The Spot Fleet request is being evaluated and Amazon EC2 is preparing to launch the
target number of instances.
• active – The Spot Fleet has been validated and Amazon EC2 is attempting to maintain the target
number of running Spot Instances. The request remains in this state until it is modified or canceled.
• modifying – The Spot Fleet request is being modified. The request remains in this state until the
modification is fully processed or the Spot Fleet is canceled. A one-time request cannot be modified,
and this state does not apply to such Spot requests.
• cancelled_running – The Spot Fleet is canceled and does not launch additional Spot Instances. Its
existing Spot Instances continue to run until they are interrupted or terminated. The request remains
in this state until all instances are interrupted or terminated.
• cancelled_terminating – The Spot Fleet is canceled and its Spot Instances are terminating. The
request remains in this state until all instances are terminated.
• cancelled – The Spot Fleet is canceled and has no running Spot Instances. The Spot Fleet request is
deleted two days after its instances were terminated.
1004
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
The following illustration represents the transitions between the request states. If you exceed your Spot
Fleet limits, the request is canceled immediately.
Spot Fleet determines the health status of an instance by using the status checks provided by Amazon
EC2. An instance is determined as unhealthy when the status of either the instance status check or the
system status check is impaired for three consecutive health checks. For more information, see Status
checks for your instances (p. 1107).
You can configure your fleet to replace unhealthy Spot Instances. After enabling health check
replacement, a Spot Instance is replaced when it is reported as unhealthy. The fleet could go below its
target capacity for up to a few minutes while an unhealthy Spot Instance is being replaced.
Requirements
• Health check replacement is supported only for Spot Fleets that maintain a target capacity (fleets of
type maintain), not for one-time Spot Fleets (fleets of type request).
• Health check replacement is supported only for Spot Instances. This feature is not supported for On-
Demand Instances.
• You can configure your Spot Fleet to replace unhealthy instances only when you create it.
• Users can use health check replacement only if they have permission to call the
ec2:DescribeInstanceStatus action.
Console
To configure a Spot Fleet to replace unhealthy Spot Instances using the console
1. Follow the steps for creating a Spot Fleet. For more information, see Create a Spot Fleet request
using defined parameters (console) (p. 1013).
2. To configure the fleet to replace unhealthy Spot Instances, for Health check, choose Replace
unhealthy instances. To enable this option, you must first choose Maintain target capacity.
1005
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
AWS CLI
To configure a Spot Fleet to replace unhealthy Spot Instances using the AWS CLI
1. Follow the steps for creating a Spot Fleet. For more information, see Create a Spot Fleet using
the AWS CLI (p. 1015).
2. To configure the fleet to replace unhealthy Spot Instances, for ReplaceUnhealthyInstances,
enter true.
If you use the Amazon EC2 console to create a Spot Fleet, it creates two service-linked roles named
AWSServiceRoleForEC2SpotFleet and AWSServiceRoleForEC2Spot, and a role named aws-ec2-
spot-fleet-tagging-role that grant the Spot Fleet the permissions to request, launch, terminate,
and tag resources on your behalf. If you use the AWS CLI or an API, you must ensure that these roles
exist.
Use the following instructions to grant the required permissions and create the roles.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances",
"ec2:CreateTags",
"ec2:RequestSpotFleet",
"ec2:ModifySpotFleetRequest",
"ec2:CancelSpotFleetRequests",
"ec2:DescribeSpotFleetRequests",
"ec2:DescribeSpotFleetInstances",
"ec2:DescribeSpotFleetRequestHistory"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
1006
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
"Resource": "arn:aws:iam::*:role/aws-ec2-spot-fleet-tagging-role"
},
{
"Effect": "Allow",
"Action": [
"iam:CreateServiceLinkedRole",
"iam:ListRoles",
"iam:ListInstanceProfiles"
],
"Resource": "*"
}
]
}
The preceding example policy grants a user the permissions required for most Spot Fleet use cases.
To limit the user to specific API actions, specify only those API actions instead.
Important
If you specify a role for the IAM instance profile in the launch specification or launch
template, you must grant the user the permission to pass the role to the service. To do
this, in the IAM policy include "arn:aws:iam::*:role/IamInstanceProfile-role"
as a resource for the iam:PassRole action. For more information, see Granting a user
permissions to pass a role to an AWS service in the IAM User Guide.
Add the following Spot Fleet API actions to your policy, as needed:
• ec2:RequestSpotFleet
• ec2:ModifySpotFleetRequest
• ec2:CancelSpotFleetRequests
• ec2:DescribeSpotFleetRequests
• ec2:DescribeSpotFleetInstances
• ec2:DescribeSpotFleetRequestHistory
(Optional) To enable a user to create roles or instance profiles using the IAM console, you must add
the following actions to the policy:
• iam:AddRoleToInstanceProfile
• iam:AttachRolePolicy
• iam:CreateInstanceProfile
• iam:CreateRole 1007
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
• iam:GetRole
• iam:ListPolicies
4. Choose Review policy.
5. On the Review policy page, enter a policy name and description, and choose Create policy.
6. To provide access, add permissions to your users, groups, or roles:
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party
identity provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM
user in the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
Amazon EC2 uses the service-linked role named AWSServiceRoleForEC2SpotFleet to launch and
manage instances on your behalf.
Important
If you specify an encrypted AMI (p. 185) or an encrypted Amazon EBS snapshot (p. 1732) in your
Spot Fleet, you must grant the AWSServiceRoleForEC2SpotFleet role permission to use the
CMK so that Amazon EC2 can launch instances on your behalf. For more information, see Grant
access to CMKs for use with encrypted AMIs and EBS snapshots (p. 1009).
1008
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
Under most circumstances, you don't need to manually create a service-linked role. Amazon EC2 creates
the AWSServiceRoleForEC2SpotFleet service-linked role the first time you create a Spot Fleet using the
console.
If you had an active Spot Fleet request before October 2017, when Amazon EC2 began supporting this
service-linked role, Amazon EC2 created the AWSServiceRoleForEC2SpotFleet role in your AWS account.
For more information, see A new role appeared in my AWS account in the IAM User Guide.
If you use the AWS CLI or an API to create a Spot Fleet, you must first ensure that this role exists.
If you no longer need to use Spot Fleet, we recommend that you delete the
AWSServiceRoleForEC2SpotFleet role. After this role is deleted from your account, Amazon EC2 will
create the role again if you request a Spot Fleet using the console. For more information, see Deleting a
Service-Linked Role in the IAM User Guide.
Grant access to CMKs for use with encrypted AMIs and EBS snapshots
If you specify an encrypted AMI (p. 185) or an encrypted Amazon EBS snapshot (p. 1732) in your Spot
Fleet request and you use a customer managed customer master key (CMK) for encryption, you must
grant the AWSServiceRoleForEC2SpotFleet role permission to use the CMK so that Amazon EC2 can
launch instances on your behalf. To do this, you must add a grant to the CMK, as shown in the following
procedure.
When providing permissions, grants are an alternative to key policies. For more information, see Using
Grants and Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide.
• Use the create-grant command to add a grant to the CMK and to specify the principal (the
AWSServiceRoleForEC2SpotFleet service-linked role) that is given permission to perform the
operations that the grant permits. The CMK is specified by the key-id parameter and the ARN of
the CMK. The principal is specified by the grantee-principal parameter and the ARN of the
AWSServiceRoleForEC2SpotFleet service-linked role.
1009
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
The confused deputy problem is a security issue where an entity that doesn't have permission to perform
an action can coerce a more-privileged entity to perform the action. We recommend that you use the
aws:SourceArn and aws:SourceAccount global condition context keys in the aws-ec2-spot-
fleet-tagging-role trust policy to limit the permissions that Spot Fleet gives another service to the
resource.
1010
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:ec2:us-east-1:account_id:spot-fleet-request/sfr-*"
},
"StringEquals": {
"aws:SourceAccount": "account_id"
}
Note
If the aws:SourceArn value contains the account ID and you use both global condition
context keys, the aws:SourceAccount value and the account in the aws:SourceArn
value must use the same account ID when used in the same policy statement.
{
"Version": "2012-10-17",
"Statement": {
"Sid": "ConfusedDeputyPreventionExamplePolicy",
"Effect": "Allow",
"Principal": {
"Service": "spotfleet.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:ec2:us-east-1:account_id:spot-fleet-request/sfr-*"
},
"StringEquals": {
"aws:SourceAccount": "account_id"
}
}
}
}
The following table provides potential values for aws:SourceArn to limit the scope of the your aws-
ec2-spot-fleet-tagging-role in varying degrees of specificity.
1011
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
1012
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
a. To define the launch parameters in the Spot console, choose Manually configure launch
parameters.
b. For AMI, choose one of the basic AMIs provided by AWS, or choose Search for AMI to use an
AMI from our user community, the AWS Marketplace, or one of your own.
c. (Optional) For Key pair name, choose an existing key pair or create a new one.
[New key pair] Choose Create new key pair to go the Key Pairs page. When you are done,
return to the Spot Requests page and refresh the list.
d. (Optional) Expand Additional launch parameters, and do the following:
i. (Optional) To enable Amazon EBS optimization, for EBS-optimized, select Launch EBS-
optimized instances.
ii. (Optional) To add temporary block-level storage for your instances, for Instance store,
choose Attach at launch.
iii. (Optional) To add storage, choose Add new volume, and specify additional instance store
volumes or Amazon EBS volumes, depending on the instance type.
iv. (Optional) By default, basic monitoring is enabled for your instances. To enable detailed
monitoring, for Monitoring, select Enable CloudWatch detailed monitoring.
v. (Optional) To run a Dedicated Spot Instance, for Tenancy, choose Dedicated - run a
dedicated instance.
vi. (Optional) For Security groups, choose one or more security groups or create a new one.
[New security group] Choose Create new security group to go the Security Groups page.
When you are done, return to the Spot Requests and refresh the list.
vii. (Optional) To make your instances reachable from the internet, for Auto-assign IPv4 Public
IP, choose Enable.
viii. (Optional) To launch your Spot Instances with an IAM role, for IAM instance profile, choose
the role.
ix. (Optional) To run a start-up script, copy it to User data.
x. (Optional) To add a tag, choose Create tag and enter the key and value for the tag, and
choose Create. Repeat for each tag.
1013
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
For each tag, to tag the instances and the Spot Fleet request with the same tag, ensure that
both Instances and Fleet are selected. To tag only the instances launched by the fleet, clear
Fleet. To tag only the Spot Fleet request, clear Instances.
5. For Additional request details, do the following:
a. Review the additional request details. To make changes, clear Apply defaults.
b. (Optional) For IAM fleet role, you can use the default role or choose a different role. To use the
default role after changing the role, choose Use default role.
c. (Optional) For Maximum price, you can use the default maximum price (the On-Demand price)
or specify the maximum price you are willing to pay. If your maximum price is lower than the
Spot price for the instance types that you selected, your Spot Instances are not launched.
d. (Optional) To create a request that is valid only during a specific time period, edit Request valid
from and Request valid until.
e. (Optional) By default, we terminate your Spot Instances when the Spot Fleet request expires. To
keep them running after your request expires, clear Terminate the instances when the request
expires.
f. (Optional) To register your Spot Instances with a load balancer, choose Receive traffic from one
or more load balancers and choose one or more Classic Load Balancers or target groups.
6. For Minimum compute unit, choose the minimum hardware specifications (vCPUs, memory, and
storage) that you need for your application or task, either as specs or as an instance type.
• For as specs, specify the required number of vCPUs and amount of memory.
• For as an instance type, accept the default instance type, or choose Change instance type to
choose a different instance type.
7. For Target capacity, do the following:
a. For Total target capacity, specify the number of units to request. For the type of unit, you can
choose Instances, vCPUs, or Memory (MiB). To specify a target capacity of 0 so that you can
add capacity later, choose Maintain target capacity.
b. (Optional) For Include On-Demand base capacity, specify the number of On-Demand units to
request. The number must be less than the Total target capacity. Amazon EC2 calculates the
difference, and allocates the difference to Spot units to request.
Important
To specify optional On-Demand capacity, you must first choose a launch template.
c. (Optional) By default, the Spot service terminates Spot Instances when they are interrupted.
To maintain the target capacity, select Maintain target capacity. You can then specify that the
Spot service terminates, stops, or hibernates Spot Instances when they are interrupted. To do
so, choose the corresponding option from Interruption behavior.
d. (Optional) To allow Spot Fleet to launch a replacement Spot Instance when an instance
rebalance notification is emitted for an existing Spot Instance in the fleet, select Capacity
rebalance, and then choose an instance replacement strategy. If you choose Launch before
terminate, specify the delay (in seconds) before Spot Fleet terminates the old instances. For
more information, see Capacity Rebalancing (p. 998).
e. (Optional) To control the amount you pay per hour for all the Spot Instances in your fleet,
select Set maximum cost for Spot Instances and then enter the maximum total amount you're
willing to pay per hour. When the maximum total amount is reached, Spot Fleet stops launching
Spot Instances even if it hasn’t met the target capacity. For more information, see Control
spending (p. 1002).
8. For Network, do the following:
1014
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
[New VPC] Choose Create new VPC to go the Amazon VPC console. When you are done, return
to the wizard and refresh the list.
b. (Optional) For Availability Zone, let AWS choose the Availability Zones for your Spot Instances,
or specify one or more Availability Zones.
If you have more than one subnet in an Availability Zone, choose the appropriate subnet from
Subnet. To add subnets, choose Create new subnet to go to the Amazon VPC console. When
you are done, return to the wizard and refresh the list.
9. For Instance type requirements, you can either specify instance attributes and let Amazon EC2
identify the optimal instance types with these attributes, or you can specify a list of instances. For
more information, see Attribute-based instance type selection for Spot Fleet (p. 984).
a. If you choose Specify instance attributes that match your compute requirements, specify your
instance attributes as follows:
i. For vCPUs, enter the desired minimum and maximum number of vCPUs. To specify no limit,
select No minimum, No maximum, or both.
ii. For Memory (GiB), enter the desired minimum and maximum amount of memory. To
specify no limit, select No minimum, No maximum, or both.
iii. (Optional) For Additional instance attributes, you can optionally specify one or more
attributes to express your compute requirements in more detail. Each additional attribute
adds a further constraint to your request. You can omit the additional attributes; when
omitted, the default values are used. For a description of each attribute and their default
values, see get-spot-placement-scores in the Amazon EC2 Command Line Reference.
iv. (Optional) To view the instance types with your specified attributes, expand Preview
matching instance types. To exclude instance types from being used in your request, select
the instances and then choose Exclude selected instance types.
b. If you choose Manually select instance types, Spot Fleet provides a default list of instance
types. To select more instance types, choose Add instance types, select the instance types to
use in your request, and choose Select. To delete instance types, select the instance types and
choose Delete.
10. For Allocation strategy, choose the strategy that meets your needs. For more information, see
Allocation strategies for Spot Instances (p. 981).
11. For Your fleet request at a glance, review your fleet configuration, and make any adjustments if
necessary.
12. (Optional) To download a copy of the launch configuration for use with the AWS CLI, choose JSON
config.
13. Choose Launch.
The Spot Fleet request type is fleet. When the request is fulfilled, requests of type instance are
added, where the state is active and the status is fulfilled.
For example configuration files, see Spot Fleet example configurations (p. 1075).
1015
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
When you tag a Spot Fleet request, the instances and volumes that are launched by the Spot Fleet are
not automatically tagged. You need to explicitly tag the instances and volumes launched by the Spot
Fleet. You can choose to assign tags to only the Spot Fleet request, or to only the instances launched by
the fleet, or to only the volumes attached to the instances launched by the fleet, or to all three.
Note
Volume tags are only supported for volumes that are attached to On-Demand Instances. You
can't tag volumes that are attached to Spot Instances.
For more information about how tags work, see Tag your Amazon EC2 resources (p. 1894).
Contents
• Prerequisite (p. 1016)
• Tag a new Spot Fleet (p. 1017)
• Tag a new Spot Fleet and the instances and volumes that it launches (p. 1018)
• Tag an existing Spot Fleet (p. 1020)
• View Spot Fleet request tags (p. 1021)
Prerequisite
Grant the user the permission to tag resources. For more information, see Example: Tag
resources (p. 1445).
• The ec2:CreateTags action. This grants the user permission to create tags.
• The ec2:RequestSpotFleet action. This grants the user permission to create a Spot Fleet request.
• For Resource, you must specify "*". This allows users to tag all resource types.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TagSpotFleetRequest",
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:RequestSpotFleet"
],
"Resource": "*"
}
]
1016
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
Important
We currently do not support resource-level permissions for the spot-fleet-request
resource. If you specify spot-fleet-request as a resource, you will get an unauthorized
exception when you try to tag the fleet. The following example illustrates how not to set the
policy.
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:RequestSpotFleet"
],
"Resource": "arn:aws:ec2:us-east-1:111122223333:spot-fleet-request/*"
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
1. Follow the Create a Spot Fleet request using defined parameters (console) (p. 1013) procedure.
2. To add a tag, expand Additional configurations, choose Add new tag, and enter the key and value
for the tag. Repeat for each tag.
For each tag, you can tag the Spot Fleet request and the instances with the same tag. To tag both,
ensure that both Instance tags and Fleet tags are selected. To tag only the Spot Fleet request, clear
Instance tags. To tag only the instances launched by the fleet, clear Fleet tags.
3. Complete the required fields to create a Spot Fleet request, and then choose Launch. For more
information, see Create a Spot Fleet request using defined parameters (console) (p. 1013).
To tag a Spot Fleet request when you create it, configure the Spot Fleet request configuration as follows:
1017
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
• For Tags, specify the key-value pair. You can specify more than one key-value pair.
In the following example, the Spot Fleet request is tagged with two tags: Key=Environment and
Value=Production, and Key=Cost-Center and Value=123.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large"
}
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1,
"TagSpecifications": [
{
"ResourceType": "spot-fleet-request",
"Tags": [
{
"Key": "Environment",
"Value":"Production"
},
{
"Key": "Cost-Center",
"Value":"123"
}
]
}
]
}
}
Tag a new Spot Fleet and the instances and volumes that it launches
To tag a new Spot Fleet request and the instances and volumes that it launches using the AWS CLI
To tag a Spot Fleet request when you create it, and to tag the instances and volumes when they are
launched by the fleet, configure the Spot Fleet request configuration as follows:
Instance tags:
1018
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
• For Tags, specify the key-value pair. You can specify more than one key-value pair.
Alternatively, you can specify the tags for the instance in the launch template (p. 556) that is
referenced in the Spot Fleet request.
Volume tags:
• Specify the tags for the volumes in the launch template (p. 556) that is referenced in the Spot Fleet
request. Volume tagging in LaunchSpecifications is not supported.
In the following example, the Spot Fleet request is tagged with two tags: Key=Environment and
Value=Production, and Key=Cost-Center and Value=123. The instances that are launched by the fleet are
tagged with one tag (which is the same as one of the tags for the Spot Fleet request): Key=Cost-Center
and Value=123.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large",
"TagSpecifications": [
{
"ResourceType": "instance",
"Tags": [
{
"Key": "Cost-Center",
"Value": "123"
}
]
}
]
}
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1,
"TagSpecifications": [
{
"ResourceType": "spot-fleet-request",
"Tags": [
{
"Key": "Environment",
"Value":"Production"
},
{
"Key": "Cost-Center",
"Value":"123"
}
]
}
]
}
}
1019
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
To tag instances when they are launched by the fleet, you can either specify the tags in the launch
template (p. 556) that is referenced in the Spot Fleet request, or you can specify the tags in the Spot
Fleet request configuration as follows:
In the following example, the instances that are launched by the fleet are tagged with one tag:
Key=Cost-Center and Value=123.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large",
"TagSpecifications": [
{
"ResourceType": "instance",
"Tags": [
{
"Key": "Cost-Center",
"Value": "123"
}
]
}
]
}
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1
}
}
To tag volumes attached to On-Demand Instances launched by a Spot Fleet using the AWS CLI
To tag volumes when they are created by the fleet, you must specify the tags in the launch
template (p. 556) that is referenced in the Spot Fleet request.
Note
Volume tags are only supported for volumes that are attached to On-Demand Instances. You
can't tag volumes that are attached to Spot Instances.
Volume tagging in LaunchSpecifications is not supported.
After you have created a Spot Fleet request, you can add tags to the fleet request using the console.
1020
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
You can use the create-tags command to tag existing resources. In the following example, the existing
Spot Fleet request is tagged with Key=purpose and Value=test.
Use the describe-tags command to view the tags for the specified resource. In the following example,
you describe the tags for the specified Spot Fleet request.
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-fleet-request",
"Value": "Production"
},
{
"Key": "Another key",
"ResourceId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-fleet-request",
"Value": "Another value"
}
]
}
You can also view the tags of a Spot Fleet request by describing the Spot Fleet request.
Use the describe-spot-fleet-requests command to view the configuration of the specified Spot Fleet
request, which includes any tags that were specified for the fleet request.
1021
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
{
"SpotFleetRequestConfigs": [
{
"ActivityStatus": "fulfilled",
"CreateTime": "2020-02-13T02:49:19.709Z",
"SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimized",
"OnDemandAllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "Default",
"FulfilledCapacity": 2.0,
"OnDemandFulfilledCapacity": 0.0,
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-
role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large"
}
],
"TargetCapacity": 2,
"OnDemandTargetCapacity": 0,
"Type": "maintain",
"ReplaceUnhealthyInstances": false,
"InstanceInterruptionBehavior": "terminate"
},
"SpotFleetRequestId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"SpotFleetRequestState": "active",
"Tags": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Another key",
"Value": "Another value"
}
]
}
]
}
1022
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
Use the describe-spot-fleet-instances command to describe the Spot Instances for the specified Spot
Fleet.
Use the describe-spot-fleet-request-history command to describe the history for the specified Spot Fleet
request.
Note
You can't modify a one-time Spot Fleet request. You can only modify a Spot Fleet request if you
selected Maintain target capacity when you created the Spot Fleet request.
When you increase the target capacity, the Spot Fleet launches additional Spot Instances. When you
increase the On-Demand portion, the Spot Fleet launches additional On-Demand Instances.
When you increase the target capacity, the Spot Fleet launches the additional Spot Instances according
to the allocation strategy for its Spot Fleet request. If the allocation strategy is lowestPrice, the Spot
Fleet launches the instances from the lowest priced Spot capacity pool in the Spot Fleet request. If the
allocation strategy is diversified, the Spot Fleet distributes the instances across the pools in the Spot
Fleet request.
When you decrease the target capacity, the Spot Fleet cancels any open requests that exceed the new
target capacity. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet
reaches the new target capacity. If the allocation strategy is lowestPrice, the Spot Fleet terminates
the instances with the highest price per unit. If the allocation strategy is diversified, the Spot Fleet
terminates instances across the pools. Alternatively, you can request that the Spot Fleet keep the fleet at
its current size, but not replace any Spot Instances that are interrupted or that you terminate manually.
When a Spot Fleet terminates an instance because the target capacity was decreased, the instance
receives a Spot Instance interruption notice.
1023
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Spot Fleets
c. Choose Submit.
Use the modify-spot-fleet-request command to update the target capacity of the specified Spot Fleet
request.
You can modify the previous command as follows to decrease the target capacity of the specified Spot
Fleet without terminating any Spot Instances as a result.
When you cancel a Spot Fleet request, you must also specify if you want to terminate all of its instances.
These include both On-Demand Instances and Spot Instances.
If you specify that the instances must be terminated when the fleet request is canceled, the fleet
request enters the cancelled_terminating state. Otherwise, the fleet request enters the
cancelled_running state and the instances continue to run until they are interrupted or you
terminate them manually.
a. To terminate the associated instances at the same time as canceling the Spot Fleet request,
leave the Terminate instances check box selected. To cancel the Spot Fleet request without
terminating the associated instances, clear the Terminate instances check box.
b. Choose Confirm.
To cancel a Spot Fleet request and terminate its instances using the AWS CLI
Use the cancel-spot-fleet-requests command to cancel the specified Spot Fleet request and terminate its
On-Demand Instances and Spot Instances.
1024
Amazon Elastic Compute Cloud
User Guide for Windows Instances
CloudWatch metrics for Spot Fleet
Example output
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_terminating",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
To cancel a Spot Fleet request without terminating its instances using the AWS CLI
You can modify the previous command using the --no-terminate-instances parameter to cancel
the specified Spot Fleet request without terminating its On-Demand Instances and Spot Instances.
Example output
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_running",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
For more information about CloudWatch metrics provided by Amazon EC2, see Monitor your instances
using CloudWatch (p. 1137).
Metric Description
AvailableInstancePoolsCount The Spot capacity pools specified in the Spot Fleet request.
Units: Count
1025
Amazon Elastic Compute Cloud
User Guide for Windows Instances
CloudWatch metrics for Spot Fleet
Metric Description
BidsSubmittedForCapacity The capacity for which Amazon EC2 has submitted Spot Fleet
requests.
Units: Count
EligibleInstancePoolCount The Spot capacity pools specified in the Spot Fleet request
where Amazon EC2 can fulfill requests. Amazon EC2 does not
fulfill requests in pools where the maximum price you're willing
to pay for Spot Instances is less than the Spot price or the Spot
price is greater than the price for On-Demand Instances.
Units: Count
Units: Count
Units: Percent
Units: Count
Units: Percent
Units: Count
Units: Count
If the unit of measure for a metric is Count, the most useful statistic is Average.
Dimensions Description
1026
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
Metrics are grouped first by namespace, and then by the various combinations of dimensions within each
namespace. For example, you can view all Spot Fleet metrics or Spot Fleet metrics groups by Spot Fleet
request ID, instance type, or Availability Zone.
1027
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
• Step scaling (p. 1030) – Increase or decrease the current capacity of the fleet based on a set of scaling
adjustments, known as step adjustments, that vary based on the size of the alarm breach.
• Scheduled scaling (p. 1032) – Increase or decrease the current capacity of the fleet based on the date
and time.
If you are using instance weighting (p. 1002), keep in mind that Spot Fleet can exceed the target capacity
as needed. Fulfilled capacity can be a floating-point number but target capacity must be an integer,
so Spot Fleet rounds up to the next integer. You must take these behaviors into account when you
look at the outcome of a scaling policy when an alarm is triggered. For example, suppose that the
target capacity is 30, the fulfilled capacity is 30.1, and the scaling policy subtracts 1. When the alarm is
triggered, the automatic scaling process subtracts 1 from 30.1 to get 29.1 and then rounds it up to 30, so
no scaling action is taken. As another example, suppose that you selected instance weights of 2, 4, and 8,
and a target capacity of 10, but no weight 2 instances were available so Spot Fleet provisioned instances
of weights 4 and 8 for a fulfilled capacity of 12. If the scaling policy decreases target capacity by 20%
and an alarm is triggered, the automatic scaling process subtracts 12*0.2 from 12 to get 9.6 and then
rounds it up to 10, so no scaling action is taken.
The scaling policies that you create for Spot Fleet support a cooldown period. This is the number of
seconds after a scaling activity completes where previous trigger-related scaling activities can influence
future scaling events. For scale-out policies, while the cooldown period is in effect, the capacity that
has been added by the previous scale-out event that initiated the cooldown is calculated as part of
the desired capacity for the next scale out. The intention is to continuously (but not excessively) scale
out. For scale in policies, the cooldown period is used to block subsequent scale in requests until it has
expired. The intention is to scale in conservatively to protect your application's availability. However, if
another alarm triggers a scale-out policy during the cooldown period after a scale-in, automatic scaling
scales out your scalable target immediately.
We recommend that you scale based on instance metrics with a 1-minute frequency because that
ensures a faster response to utilization changes. Scaling on metrics with a 5-minute frequency can
result in slower response time and scaling on stale metric data. To send metric data for your instances
to CloudWatch in 1-minute periods, you must specifically enable detailed monitoring. For more
information, see Enable or turn off detailed monitoring for your instances (p. 1137) and Create a Spot
Fleet request using defined parameters (console) (p. 1013).
For more information about configuring scaling for Spot Fleet, see the following resources:
In addition to the IAM permissions for Spot Fleet (p. 1006) and Amazon EC2, the user that accesses fleet
scaling settings must have the appropriate permissions for the services that support dynamic scaling.
Users must have permissions to use the actions shown in the following example policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
1028
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
"application-autoscaling:*",
"ec2:DescribeSpotFleetRequests",
"ec2:ModifySpotFleetRequest",
"cloudwatch:DeleteAlarms",
"cloudwatch:DescribeAlarmHistory",
"cloudwatch:DescribeAlarms",
"cloudwatch:DescribeAlarmsForMetric",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics",
"cloudwatch:PutMetricAlarm",
"cloudwatch:DisableAlarmActions",
"cloudwatch:EnableAlarmActions",
"iam:CreateServiceLinkedRole",
"sns:CreateTopic",
"sns:Subscribe",
"sns:Get*",
"sns:List*"
],
"Resource": "*"
}
]
}
You can also create your own IAM policies that allow more fine-grained permissions for calls to the
Application Auto Scaling API. For more information, see Authentication and Access Control in the
Application Auto Scaling User Guide.
The Application Auto Scaling service also needs permission to describe your Spot Fleet and
CloudWatch alarms, and permissions to modify your Spot Fleet target capacity on your behalf.
If you enable automatic scaling for your Spot Fleet, it creates a service-linked role named
AWSServiceRoleForApplicationAutoScaling_EC2SpotFleetRequest. This service-linked role
grants Application Auto Scaling permission to describe the alarms for your policies, to monitor the
current capacity of the fleet, and to modify the capacity of the fleet. The original managed Spot Fleet
role for Application Auto Scaling was aws-ec2-spot-fleet-autoscale-role, but it is no longer
required. The service-linked role is the default role for Application Auto Scaling. For more information,
see Service-Linked Roles in the Application Auto Scaling User Guide.
You can create multiple target tracking scaling policies for a Spot Fleet, provided that each of them
uses a different metric. The fleet scales based on the policy that provides the largest fleet capacity. This
enables you to cover multiple scenarios and ensure that there is always enough capacity to process your
application workloads.
To ensure application availability, the fleet scales out proportionally to the metric as fast as it can, but
scales in more gradually.
When a Spot Fleet terminates an instance because the target capacity was decreased, the instance
receives a Spot Instance interruption notice.
Do not edit or delete the CloudWatch alarms that Spot Fleet manages for a target tracking scaling policy.
Spot Fleet deletes the alarms automatically when you delete the target tracking scaling policy.
Limitation
1029
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
The Spot Fleet request must have a request type of maintain. Automatic scaling is not supported for
requests of type request.
1. Register the Spot Fleet request as a scalable target using the register-scalable-target command.
2. Create a scaling policy using the put-scaling-policy command.
When you create a step scaling policy, you must specify one of the following scaling adjustment types:
• Add – Increase the target capacity of the fleet by a specified number of capacity units or a specified
percentage of the current capacity.
• Remove – Decrease the target capacity of the fleet by a specified number of capacity units or a
specified percentage of the current capacity.
• Set to – Set the target capacity of the fleet to the specified number of capacity units.
When an alarm is triggered, the automatic scaling process calculates the new target capacity using the
fulfilled capacity and the scaling policy, and then updates the target capacity accordingly. For example,
suppose that the target capacity and fulfilled capacity are 10 and the scaling policy adds 1. When
the alarm is triggered, the automatic scaling process adds 1 to 10 to get 11, so Spot Fleet launches 1
instance.
When a Spot Fleet terminates an instance because the target capacity was decreased, the instance
receives a Spot Instance interruption notice.
Limitation
The Spot Fleet request must have a request type of maintain. Automatic scaling is not supported for
requests of type request, or Spot blocks.
1030
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
Prerequisites
• Consider which CloudWatch metrics are important to your application. You can create CloudWatch
alarms based on metrics provided by AWS or your own custom metrics.
• For the AWS metrics that you will use in your scaling policies, enable CloudWatch metrics collection if
the service that provides the metrics does not enable it by default.
The Specify metric and conditions page appears, showing a graph and other information about the
metric you selected.
6. For Period, choose the evaluation period for the alarm, for example, 1 minute. When evaluating the
alarm, each period is aggregated into one data point.
Note
A shorter period creates a more sensitive alarm.
7. For Conditions, define the alarm by defining the threshold condition. For example, you can define
a threshold to trigger the alarm whenever the value of the metric is greater than or equal to 80
percent.
8. Under Additional configuration, for Datapoints to alarm, specify how many datapoints (evaluation
periods) must be in the ALARM state to trigger the alarm, for example, 1 evaluation period or 2 out
of 3 evaluation periods. This creates an alarm that goes to ALARM state if that many consecutive
periods are breaching. For more information, see Evaluating an Alarm in the Amazon CloudWatch
User Guide.
9. For Missing data treatment, choose one of the options (or leave the default of Treat missing data
as missing). For more information, see Configuring How CloudWatch Alarms Treat Missing Data in
the Amazon CloudWatch User Guide.
10. Choose Next.
11. (Optional) To receive notification of a scaling event, for Notification, you can choose or create
the Amazon SNS topic you want to use to receive notifications. Otherwise, you can delete the
notification now and add one later as needed.
12. Choose Next.
13. Under Add a description, enter a name and description for the alarm and choose Next.
14. Choose Create alarm.
1031
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automatic scaling for Spot Fleet
To configure step scaling policies for your Spot Fleet using the AWS CLI
1. Register the Spot Fleet request as a scalable target using the register-scalable-target command.
2. Create a scaling policy using the put-scaling-policy command.
3. Create an alarm that triggers the scaling policy using the put-metric-alarm command.
You can only create a scheduled action for Spot Fleets that already exist. You can't create a scheduled
action at the same time that you create a Spot Fleet.
Limitation
The Spot Fleet request must have a request type of maintain. Automatic scaling is not supported for
requests of type request, or Spot blocks.
1032
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor fleet events
• put-scheduled-action
• describe-scheduled-actions
• delete-scheduled-action
With Amazon EventBridge, you can create rules that trigger programmatic actions in response to
an event. For example, you can create two EventBridge rules, one that's triggered when a fleet state
changes, and one that's triggered when an instance in the fleet is terminated. You can configure the first
rule so that, if the fleet state changes, the rule invokes an SNS topic to send an email notification to
you. You can configure the second rule so that, if an instance is terminated, the rule invokes a Lambda
function to launch a new instance.
Topics
• EC2 Fleet event types (p. 1034)
• Spot Fleet event types (p. 1038)
1033
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet event types
There are five EC2 Fleet event types. For each event type, there are several sub-types.
The events are sent to EventBridge in JSON format. The following fields in the event form the event
pattern that is defined in the rule, and which trigger an action:
"source": "aws.ec2fleet"
Event types
• EC2 Fleet State Change (p. 1034)
• EC2 Fleet Spot Instance Request Change (p. 1035)
• EC2 Fleet Instance Change (p. 1036)
• EC2 Fleet Information (p. 1037)
• EC2 Fleet Error (p. 1037)
{
"version": "0",
"id": "715ed6b3-b8fc-27fe-fad6-528c7b8bf8a2",
"detail-type": "EC2 Fleet State Change",
"source": "aws.ec2fleet",
"account": "123456789012",
"time": "2020-11-09T09:00:20Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:fleet/fleet-598fb973-87b7-422d-
be4d-6b0809bfff0a"
],
"detail": {
"sub-type": "active"
}
}
1034
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet event types
active
The EC2 Fleet request has been validated and Amazon EC2 is attempting to maintain the target
number of running instances.
deleted
The EC2 Fleet request is deleted and has no running instances. The EC2 Fleet will be deleted two
days after its instances are terminated.
deleted_running
The EC2 Fleet request is deleted and does not launch additional instances. Its existing instances
continue to run until they are interrupted or terminated. The request remains in this state until all
instances are interrupted or terminated.
deleted_terminating
The EC2 Fleet request is deleted and its instances are terminating. The request remains in this state
until all instances are terminated.
expired
The EC2 Fleet request has expired. If the request was created with
TerminateInstancesWithExpiration set, a subsequent terminated event indicates that the
instances are terminated.
modify_in_progress
The EC2 Fleet request is being modified. The request remains in this state until the modification is
fully processed.
modify_succeeded
The EC2 Fleet request is being evaluated and Amazon EC2 is preparing to launch the target number
of instances.
progress
{
"version": "0",
"id": "19331f74-bf4b-a3dd-0f1b-ddb1422032b9",
"detail-type": "EC2 Fleet Spot Instance Request Change",
"source": "aws.ec2fleet",
"account": "123456789012",
"time": "2020-11-09T09:00:05Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:fleet/
fleet-83fd4e48-552a-40ef-9532-82a3acca5f10"
1035
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet event types
],
"detail": {
"spot-instance-request-id": "sir-rmqske6h",
"description": "SpotInstanceRequestId sir-rmqske6h, PreviousState:
cancelled_running",
"sub-type": "cancelled"
}
}
active
The Spot Instance request is fulfilled and has an associated Spot Instance.
cancelled
You cancelled the Spot Instance request, or the Spot Instance request expired.
disabled
{
"version": "0",
"id": "542ce428-c8f1-0608-c015-e8ed6522c5bc",
"detail-type": "EC2 Fleet Instance Change",
"source": "aws.ec2fleet",
"account": "123456789012",
"time": "2020-11-09T09:00:23Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:fleet/fleet-598fb973-87b7-422d-
be4d-6b0809bfff0a"
],
"detail": {
"instance-id": "i-0c594155dd5ff1829",
"description": "{\"instanceType\":\"c5.large\",\"image\":\"ami-6057e21a\",
\"productDescription\":\"Linux/UNIX\",\"availabilityZone\":\"us-east-1d\"}",
"sub-type": "launched"
}
}
launched
1036
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet event types
termination_notified
An instance termination notification was sent when a Spot Instance was terminated by Amazon EC2
during scale-down, when the target capacity of the fleet was modified down, for example, from a
target capacity of 4 to a target capacity of 3.
{
"version": "0",
"id": "76529817-d605-4571-7224-d36cc1b2c0c4",
"detail-type": "EC2 Fleet Information",
"source": "aws.ec2fleet",
"account": "123456789012",
"time": "2020-11-09T08:17:07Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:fleet/fleet-8becf5fe-
bb9e-415d-8f54-3fa5a8628b91"
],
"detail": {
"description": "c4.xlarge, ami-0947d2ba12ee1ff75, Linux/UNIX, us-east-1a,
Spot price in either SpotFleetRequestConfigData or SpotFleetLaunchSpecification or
LaunchTemplate or LaunchTemplateOverrides is less than Spot market price $0.0619",
"sub-type": "launchSpecUnusable"
}
}
fleetProgressHalted
The price in every launch specification is not valid because it is below the Spot price (all the launch
specifications have produced launchSpecUnusable events). A launch specification might become
valid if the Spot price changes.
launchSpecTemporarilyBlacklisted
The configuration is not valid and several attempts to launch instances have failed. For more
information, see the description of the event.
launchSpecUnusable
The price in a launch specification is not valid because it is below the Spot price.
registerWithLoadBalancersFailed
An attempt to register instances with load balancers failed. For more information, see the
description of the event.
1037
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet event types
{
"version": "0",
"id": "69849a22-6d0f-d4ce-602b-b47c1c98240e",
"detail-type": "EC2 Fleet Error",
"source": "aws.ec2fleet",
"account": "123456789012",
"time": "2020-10-07T01:44:24Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:fleet/fleet-9bb19bc6-60d3-4fd2-ae47-
d33e68eafa08"
],
"detail": {
"description": "m3.large, ami-00068cd7555f543d5, Linux/UNIX: IPv6 is not supported
for the instance type 'm3.large'. ",
"sub-type": "spotFleetRequestConfigurationInvalid"
}
}
iamFleetRoleInvalid
The EC2 Fleet does not have the required permissions to either launch or terminate an instance.
allLaunchSpecsTemporarilyBlacklisted
None of the configurations are valid, and several attempts to launch instances have failed. For more
information, see the description of the event.
spotInstanceCountLimitExceeded
You’ve reached the limit on the number of Spot Instances that you can launch.
spotFleetRequestConfigurationInvalid
The configuration is not valid. For more information, see the description of the event.
The events are sent to EventBridge in JSON format. The following fields in the event form the event
pattern that is defined in the rule, and which trigger an action:
"source": "aws.ec2spotfleet"
Event types
• EC2 Spot Fleet State Change (p. 1039)
• EC2 Spot Fleet Spot Instance Request Change (p. 1040)
• EC2 Spot Fleet Instance Change (p. 1040)
1038
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet event types
{
"version": "0",
"id": "d1af1091-6cc3-2e24-203a-3b870e455d5b",
"detail-type": "EC2 Spot Fleet State Change",
"source": "aws.ec2spotfleet",
"account": "123456789012",
"time": "2020-11-09T08:57:06Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:spot-fleet-request/sfr-4b6d274d-0cea-4b2c-
b3be-9dc627ad1f55"
],
"detail": {
"sub-type": "submitted"
}
}
active
The Spot Fleet request has been validated and Amazon EC2 is attempting to maintain the target
number of running instances.
cancelled
The Spot Fleet request is canceled and has no running instances. The Spot Fleet will be deleted two
days after its instances are terminated.
cancelled_running
The Spot Fleet request is canceled and does not launch additional instances. Its existing instances
continue to run until they are interrupted or terminated. The request remains in this state until all
instances are interrupted or terminated.
cancelled_terminating
The Spot Fleet request is canceled and its instances are terminating. The request remains in this
state until all instances are terminated.
expired
The Spot Fleet request has expired. If the request was created with
TerminateInstancesWithExpiration set, a subsequent terminated event indicates that the
instances are terminated.
modify_in_progress
The Spot Fleet request is being modified. The request remains in this state until the modification is
fully processed.
modify_succeeded
1039
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet event types
submitted
The Spot Fleet request is being evaluated and Amazon EC2 is preparing to launch the target number
of instances.
progress
{
"version": "0",
"id": "cd141ef0-14af-d670-a71d-fe46e9971bd2",
"detail-type": "EC2 Spot Fleet Spot Instance Request Change",
"source": "aws.ec2spotfleet",
"account": "123456789012",
"time": "2020-11-09T08:53:21Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:spot-fleet-request/sfr-
a98d2133-941a-47dc-8b03-0f94c6852ad1"
],
"detail": {
"spot-instance-request-id": "sir-a2w9gc5h",
"description": "SpotInstanceRequestId sir-a2w9gc5h, PreviousState:
cancelled_running",
"sub-type": "cancelled"
}
}
active
The Spot Instance request is fulfilled and has an associated Spot Instance.
cancelled
You cancelled the Spot Instance request, or the Spot Instance request expired.
disabled
1040
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet event types
"version": "0",
"id": "11591686-5bd7-bbaa-eb40-d46529c2710f",
"detail-type": "EC2 Spot Fleet Instance Change",
"source": "aws.ec2spotfleet",
"account": "123456789012",
"time": "2020-11-09T07:25:02Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:spot-fleet-request/sfr-c8a764a4-bedc-4b62-
af9c-0095e6e3ba61"
],
"detail": {
"instance-id": "i-08b90df1e09c30c9b",
"description": "{\"instanceType\":\"r4.2xlarge\",\"image\":\"ami-032930428bf1abbff
\",\"productDescription\":\"Linux/UNIX\",\"availabilityZone\":\"us-east-1a\"}",
"sub-type": "launched"
}
}
launched
An instance termination notification was sent when a Spot Instance was terminated by Amazon EC2
during scale-down, when the target capacity of the fleet was modified down, for example, from a
target capacity of 4 to a target capacity of 3.
{
"version": "0",
"id": "73a60f70-3409-a66c-635c-7f66c5f5b669",
"detail-type": "EC2 Spot Fleet Information",
"source": "aws.ec2spotfleet",
"account": "123456789012",
"time": "2020-11-08T20:56:12Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:spot-fleet-request/sfr-2531ea06-
af18-4647-8757-7d69c94971b1"
],
"detail": {
"description": "r3.8xlarge, ami-032930428bf1abbff, Linux/UNIX, us-east-1a, Spot bid
price is less than Spot market price $0.5291",
"sub-type": "launchSpecUnusable"
}
}
1041
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet event types
fleetProgressHalted
The price in every launch specification is not valid because it is below the Spot price (all the launch
specifications have produced launchSpecUnusable events). A launch specification might become
valid if the Spot price changes.
launchSpecTemporarilyBlacklisted
The configuration is not valid and several attempts to launch instances have failed. For more
information, see the description of the event.
launchSpecUnusable
The price in a launch specification is not valid because it is below the Spot price.
registerWithLoadBalancersFailed
An attempt to register instances with load balancers failed. For more information, see the
description of the event.
{
"version": "0",
"id": "10adc4e7-675c-643e-125c-5bfa1b1ba5d2",
"detail-type": "EC2 Spot Fleet Error",
"source": "aws.ec2spotfleet",
"account": "123456789012",
"time": "2020-11-09T06:56:07Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:spot-fleet-request/
sfr-38725d30-25f1-4f30-83ce-2907c56dba17"
],
"detail": {
"description": "r4.2xlarge, ami-032930428bf1abbff, Linux/UNIX: The
associatePublicIPAddress parameter can only be specified for the network interface with
DeviceIndex 0. ",
"sub-type": "spotFleetRequestConfigurationInvalid"
}
}
iamFleetRoleInvalid
The Spot Fleet does not have the required permissions to either launch or terminate an instance.
allLaunchSpecsTemporarilyBlacklisted
None of the configurations are valid, and several attempts to launch instances have failed. For more
information, see the description of the event.
spotInstanceCountLimitExceeded
You’ve reached the limit on the number of Spot Instances that you can launch.
spotFleetRequestConfigurationInvalid
The configuration is not valid. For more information, see the description of the event.
1042
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create EventBridge rules
You can write an EventBridge rule and automate what actions to take when the event pattern matches
the rule.
Topics
• Create Amazon EventBridge rules to monitor EC2 Fleet events (p. 1043)
• Create Amazon EventBridge rules to monitor Spot Fleet events (p. 1046)
The following fields form the event pattern that is defined in the rule:
"source": "aws.ec2fleet"
For the list of EC2 Fleet events and example event data, see the section called “EC2 Fleet event
types” (p. 1034).
Examples
• Create an EventBridge rule to send a notification (p. 1043)
• Create an EventBridge rule to trigger a Lambda function (p. 1045)
Before creating the EventBridge rule, you must create the Amazon SNS topic for the email, text message,
or mobile push notification.
To create an EventBridge rule to send a notification when an EC2 Fleet state changes
1043
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create EventBridge rules
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
{
"source": ["aws.ec2fleet"],
"detail-type": ["EC2 Fleet Instance Change"]
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
For more information, see Amazon EventBridge rules and Amazon EventBridge event patterns in the
Amazon EventBridge User Guide
Before creating the EventBridge rule, you must create the Lambda function.
For more information about using Lambda, see Create a Lambda function with the console in the
AWS Lambda Developer Guide.
To create an EventBridge rule to trigger a Lambda function when an instance in an EC2 Fleet
changes state
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
{
"source": ["aws.ec2fleet"],
"detail-type": ["EC2 Fleet Instance Change"],
"detail": {
"sub-type": ["launched"]
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
1045
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create EventBridge rules
For a tutorial on how to create a Lambda function and an EventBridge rule that runs the Lambda
function, see Tutorial: Log the State of an Amazon EC2 Instance Using EventBridge in the AWS Lambda
Developer Guide.
The following fields form the event pattern that is defined in the rule:
"source": "aws.ec2spotfleet"
For the list of Spot Fleet events and example event data, see the section called “Spot Fleet event
types” (p. 1038).
Examples
1046
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create EventBridge rules
To create an EventBridge rule to send a notification when a Spot Fleet state changes
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
{
"source": ["aws.ec2spotfleet"],
"detail-type": ["EC2 Spot Fleet Instance Change"]
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
1047
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create EventBridge rules
b. For Select a target, choose SNS topic to send an email, text message, or mobile push
notification when the event occurs.
c. For Topic, choose an existing topic. You first need to create an Amazon SNS topic using the
Amazon SNS console. For more information, see Using Amazon SNS for application-to-person
(A2P) messaging in the Amazon Simple Notification Service Developer Guide.
d. (Optional) Under Additional settings, you can optionally configure additional settings. For
more information, see Creating Amazon EventBridge rules that react to events (step 16) in the
Amazon EventBridge User Guide.
e. Choose Next.
6. (Optional) For Tags, you can optionally assign one or more tags to your rule, and then choose Next.
7. For Review and create, do the following:
For more information, see Amazon EventBridge rules and Amazon EventBridge event patterns in the
Amazon EventBridge User Guide
Before creating the EventBridge rule, you must create the Lambda function.
For more information about using Lambda, see Create a Lambda function with the console in the
AWS Lambda Developer Guide.
To create an EventBridge rule to trigger a Lambda function when an instance in a Spot Fleet
changes state
A rule can't have the same name as another rule in the same Region and on the same event bus.
b. For Event bus, choose default. When an AWS service in your account generates an event, it
always goes to your account's default event bus.
c. For Rule type, choose Rule with an event pattern.
d. Choose Next.
4. For Build event pattern, do the following:
1048
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorials
b. For Event pattern, for this example you’ll specify the following event pattern to match the EC2
Spot Fleet Instance Change event and launched sub-type.
{
"source": ["aws.ec2spotfleet"],
"detail-type": ["EC2 Spot Fleet Instance Change"],
"detail": {
"sub-type": ["launched"]
}
To add the event pattern, you can either use a template by choosing Event pattern form, or
specify your own pattern by choosing Custom pattern (JSON editor), as follows:
For a tutorial on how to create a Lambda function and an EventBridge rule that runs the Lambda
function, see Tutorial: Log the State of an Amazon EC2 Instance Using EventBridge in the AWS Lambda
Developer Guide.
1049
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Use EC2 Fleet with instance weighting
Tutorials
• Tutorial: Use EC2 Fleet with instance weighting (p. 1050)
• Tutorial: Use EC2 Fleet with On-Demand as the primary capacity (p. 1052)
• Tutorial: Launch On-Demand Instances using targeted Capacity Reservations (p. 1053)
• Tutorial: Use Spot Fleet with instance weighting (p. 1058)
Objective
Example Corp, a pharmaceutical company, wants to use the computational power of Amazon EC2 for
screening chemical compounds that might be used to fight cancer.
Planning
Example Corp first reviews Spot Best Practices. Next, Example Corp determines the requirements for
their EC2 Fleet.
Instance types
Example Corp has a compute- and memory-intensive application that performs best with at least 60 GB
of memory and eight virtual CPUs (vCPUs). They want to maximize these resources for the application at
the lowest possible price. Example Corp decides that any of the following EC2 instance types would meet
their needs:
r3.2xlarge 61 8
r3.4xlarge 122 16
r3.8xlarge 244 32
With instance weighting, target capacity can equal a number of instances (the default) or a combination
of factors such as cores (vCPUs), memory (GiBs), and storage (GBs). By considering the base for their
application (60 GB of RAM and eight vCPUs) as one unit, Example Corp decides that 20 times this
amount would meet their needs. So the company sets the target capacity of their EC2 Fleet request to
20.
Instance weights
After determining the target capacity, Example Corp calculates instance weights. To calculate the
instance weight for each instance type, they determine the units of each instance type that are required
to reach the target capacity as follows:
1050
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Use EC2 Fleet with instance weighting
Therefore, Example Corp assigns instance weights of 1, 2, and 4 to the respective launch configurations
in their EC2 Fleet request.
Example Corp uses the On-Demand price per instance hour as a starting point for their price. They could
also use recent Spot prices, or a combination of the two. To calculate the price per unit hour, they divide
their starting price per instance hour by the weight. For example:
Instance type On-Demand price Instance weight Price per unit hour
Example Corp could use a global price per unit hour of $0.7 and be competitive for all three instance
types. They could also use a global price per unit hour of $0.7 and a specific price per unit hour of $0.9 in
the r3.8xlarge launch specification.
Verify permissions
Before creating an EC2 Fleet, Example Corp verifies that it has an IAM role with the required permissions.
For more information, see EC2 Fleet prerequisites (p. 961).
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-07b3bc7625cdab851",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-482e4972",
"WeightedCapacity": 1
},
{
"InstanceType": "r3.4xlarge",
"SubnetId": "subnet-482e4972",
"WeightedCapacity": 2
},
{
1051
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Use EC2 Fleet with On-
Demand as the primary capacity
"InstanceType": "r3.8xlarge",
"MaxPrice": "0.90",
"SubnetId": "subnet-482e4972",
"WeightedCapacity": 4
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
}
}
Example Corp creates the EC2 Fleet using the following create-fleet command.
Fulfillment
The allocation strategy determines which Spot capacity pools your Spot Instances come from.
With the lowest-price strategy (which is the default strategy), the Spot Instances come from the pool
with the lowest price per unit at the time of fulfillment. To provide 20 units of capacity, the EC2 Fleet
launches either 20 r3.2xlarge instances (20 divided by 1), 10 r3.4xlarge instances (20 divided by 2),
or 5 r3.8xlarge instances (20 divided by 4).
If Example Corp used the diversified strategy, the Spot Instances would come from all three pools.
The EC2 Fleet would launch 6 r3.2xlarge instances (which provide 6 units), 3 r3.4xlarge instances
(which provide 6 units), and 2 r3.8xlarge instances (which provide 8 units), for a total of 20 units.
Objective
ABC Online, a restaurant delivery company, wants to be able to provision Amazon EC2 capacity across
EC2 instance types and purchasing options to achieve their desired scale, performance, and cost.
Plan
ABC Online requires a fixed capacity to operate during peak periods, but would like to benefit from
increased capacity at a lower price. ABC Online determines the following requirements for their EC2
Fleet:
• On-Demand Instance capacity – ABC Online requires 15 On-Demand Instances to ensure that they can
accommodate traffic at peak periods.
• Spot Instance capacity – ABC Online would like to improve performance, but at a lower price, by
provisioning 5 Spot Instances.
1052
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Launch On-Demand Instances
using targeted Capacity Reservations
Verify permissions
Before creating an EC2 Fleet, ABC Online verifies that it has an IAM role with the required permissions.
For more information, see EC2 Fleet prerequisites (p. 961).
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-07b3bc7625cdab851",
"Version": "2"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"OnDemandTargetCapacity":15,
"DefaultTargetCapacityType": "spot"
}
}
ABC Online creates the EC2 Fleet using the following create-fleet command.
Fulfillment
The allocation strategy determines that the On-Demand capacity is always fulfilled, while the balance of
the target capacity is fulfilled as Spot if there is capacity and availability.
You will learn how to configure a fleet to use targeted On-Demand Capacity Reservations first when
launching On-Demand Instances. You will also learn how to configure the fleet so that, when the total
On-Demand target capacity exceeds the number of available unused Capacity Reservations, the fleet
uses the specified allocation strategy for selecting the instance pools in which to launch the remaining
target capacity.
1053
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Launch On-Demand Instances
using targeted Capacity Reservations
In this tutorial, the fleet configuration is as follows:
Note that you can also use the prioritized allocation strategy instead of the lowest-price
allocation strategy.
To launch On-Demand Instances into targeted Capacity Reservations, you must perform a number of
steps, as follows:
• Step 1: Create Capacity Reservations (p. 1054)
• Step 2: Create a Capacity Reservation resource group (p. 1055)
• Step 3: Add the Capacity Reservations to the Capacity Reservation resource group (p. 1055)
• (Optional) Step 4: View the Capacity Reservations in the resource group (p. 1055)
• Step 5: Create a launch template that specifies that the Capacity Reservation targets a specific
resource group (p. 1056)
• (Optional) Step 6: Describe the launch template (p. 1056)
• Step 7: Create an EC2 Fleet (p. 1057)
• (Optional) Step 8: View the number of remaining unused Capacity Reservations (p. 1058)
cr-1234567890abcdef1
1054
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Launch On-Demand Instances
using targeted Capacity Reservations
--instance-match-criteria targeted
cr-54321abcdef567890
Example output
{
"Failed": [],
"Succeeded": [
"arn:aws:ec2:us-east-1:123456789012:capacity-reservation/cr-1234567890abcdef1",
"arn:aws:ec2:us-east-1:123456789012:capacity-reservation/cr-54321abcdef567890"
]
}
Example output
{
"ResourceIdentifiers": [
{
1055
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Launch On-Demand Instances
using targeted Capacity Reservations
"ResourceType": "AWS::EC2::CapacityReservation",
"ResourceArn": "arn:aws:ec2:us-east-1:123456789012:capacity-reservation/
cr-1234567890abcdef1"
},
{
"ResourceType": "AWS::EC2::CapacityReservation",
"ResourceArn": "arn:aws:ec2:us-east-1:123456789012:capacity-reservation/
cr-54321abcdef567890"
}
]
}
Example output
{
"LaunchTemplateVersions": [
{
"LaunchTemplateId": "lt-01234567890example",
"LaunchTemplateName": "my-launch-template",
"VersionNumber": 1,
"CreateTime": "2021-01-19T20:50:19.000Z",
"CreatedBy": "arn:aws:iam::123456789012:user/Admin",
"DefaultVersion": true,
"LaunchTemplateData": {
"ImageId": "ami-0947d2ba12ee1ff75",
"CapacityReservationSpecification": {
"CapacityReservationTarget": {
"CapacityReservationResourceGroupArn": "arn:aws:resource-groups:us-
east-1:123456789012:group/my-cr-group"
}
}
}
}
1056
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Launch On-Demand Instances
using targeted Capacity Reservations
]
}
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "c5.xlarge",
"AvailabilityZone": "us-east-1a"
},
{
"InstanceType": "c5.xlarge",
"AvailabilityZone": "us-east-1b"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 10,
"DefaultTargetCapacityType": "on-demand"
},
"OnDemandOptions": {
"AllocationStrategy": "lowest-price",
"CapacityReservationOptions": {
"UsageStrategy": "use-capacity-reservations-first"
}
},
"Type": "instant"
}
After you create the instant fleet using the preceding configuration, the following 10 instances are
launched to meet the target capacity:
• The Capacity Reservations are used first to launch 6 On-Demand Instances as follows:
• 3 On-Demand Instances are launched into the 3 c5.xlarge targeted Capacity Reservations in
us-east-1a
• 3 On-Demand Instances are launched into the 3 c5.xlarge targeted Capacity Reservations in
us-east-1b
• To meet the target capacity, 4 additional On-Demand Instances are launched into regular On-Demand
capacity according to the On-Demand allocation strategy, which is lowest-price in this example.
1057
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Use Spot Fleet with instance weighting
However, because the pools are the same price (because price is per Region and not per Availability
Zone), the fleet launches the remaining 4 On-Demand Instances into either of the pools.
{ "CapacityReservationId": "cr-111",
"InstanceType": "c5.xlarge",
"AvailableInstanceCount": 0
}
{ "CapacityReservationId": "cr-222",
"InstanceType": "c5.xlarge",
"AvailableInstanceCount": 0
}
Objective
Example Corp, a pharmaceutical company, wants to leverage the computational power of Amazon EC2
for screening chemical compounds that might be used to fight cancer.
Planning
Example Corp first reviews Spot Best Practices. Next, Example Corp determines the following
requirements for their Spot Fleet.
Instance types
Example Corp has a compute- and memory-intensive application that performs best with at least 60 GB
of memory and eight virtual CPUs (vCPUs). They want to maximize these resources for the application at
the lowest possible price. Example Corp decides that any of the following EC2 instance types would meet
their needs:
r3.2xlarge 61 8
r3.4xlarge 122 16
r3.8xlarge 244 32
With instance weighting, target capacity can equal a number of instances (the default) or a combination
of factors such as cores (vCPUs), memory (GiBs), and storage (GBs). By considering the base for their
1058
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tutorial: Use Spot Fleet with instance weighting
application (60 GB of RAM and eight vCPUs) as 1 unit, Example Corp decides that 20 times this amount
would meet their needs. So the company sets the target capacity of their Spot Fleet request to 20.
Instance weights
After determining the target capacity, Example Corp calculates instance weights. To calculate the
instance weight for each instance type, they determine the units of each instance type that are required
to reach the target capacity as follows:
Therefore, Example Corp assigns instance weights of 1, 2, and 4 to the respective launch configurations
in their Spot Fleet request.
Example Corp uses the On-Demand price per instance hour as a starting point for their price. They could
also use recent Spot prices, or a combination of the two. To calculate the price per unit hour, they divide
their starting price per instance hour by the weight. For example:
Instance type On-Demand price Instance weight Price per unit hour
Example Corp could use a global price per unit hour of $0.7 and be competitive for all three instance
types. They could also use a global price per unit hour of $0.7 and a specific price per unit hour of $0.9 in
the r3.8xlarge launch specification.
Verify permissions
Before creating a Spot Fleet request, Example Corp verifies that it has an IAM role with the required
permissions. For more information, see Spot Fleet permissions (p. 1006).
{
"SpotPrice": "0.70",
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-482e4972",
"WeightedCapacity": 1
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.4xlarge",
1059
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Example configurations
"SubnetId": "subnet-482e4972",
"WeightedCapacity": 2
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.8xlarge",
"SubnetId": "subnet-482e4972",
"SpotPrice": "0.90",
"WeightedCapacity": 4
}
]
}
Example Corp creates the Spot Fleet request using the request-spot-fleet command.
For more information, see Spot Fleet request types (p. 979).
Fulfillment
The allocation strategy determines which Spot capacity pools your Spot Instances come from.
With the lowestPrice strategy (which is the default strategy), the Spot Instances come from the pool
with the lowest price per unit at the time of fulfillment. To provide 20 units of capacity, the Spot Fleet
launches either 20 r3.2xlarge instances (20 divided by 1), 10 r3.4xlarge instances (20 divided by 2),
or 5 r3.8xlarge instances (20 divided by 4).
If Example Corp used the diversified strategy, the Spot Instances would come from all three pools.
The Spot Fleet would launch 6 r3.2xlarge instances (which provide 6 units), 3 r3.4xlarge instances
(which provide 6 units), and 2 r3.8xlarge instances (which provide 8 units), for a total of 20 units.
Topics
• EC2 Fleet example configurations (p. 1060)
• Spot Fleet example configurations (p. 1075)
Examples
• Example 1: Launch Spot Instances as the default purchasing option (p. 1061)
• Example 2: Launch On-Demand Instances as the default purchasing option (p. 1061)
• Example 3: Launch On-Demand Instances as the primary capacity (p. 1062)
• Example 4: Launch Spot Instances using the lowest-price allocation strategy (p. 1062)
1060
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
• Example 5: Launch On-Demand Instances using multiple Capacity Reservations (p. 1063)
• Example 6: Launch On-Demand Instances using Capacity Reservations when the total target capacity
exceeds the number of unused Capacity Reservations (p. 1065)
• Example 7: Launch On-Demand Instances using targeted Capacity Reservations (p. 1068)
• Example 8: Configure Capacity Rebalancing to launch replacement Spot Instances (p. 1070)
• Example 9: Launch Spot Instances in a capacity-optimized fleet (p. 1071)
• Example 10: Launch Spot Instances in a capacity-optimized fleet with priorities (p. 1072)
• Example 11: Launch Spot Instances in a price-capacity-optimized fleet (p. 1073)
• Example 12: Configure attribute-based instance type selection (p. 1074)
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "spot"
}
}
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "on-demand"
}
1061
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"OnDemandTargetCapacity": 1,
"DefaultTargetCapacityType": "spot"
}
}
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
"Overrides": [
{
"InstanceType": "c4.large",
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
},
{
"InstanceType": "c3.large",
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
},
{
"InstanceType": "c5.large",
1062
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "spot"
}
}
Note that you can also use the prioritized allocation strategy instead of the lowest-price
allocation strategy.
Capacity Reservations
The account has the following 15 unused Capacity Reservations in 3 different pools. The number of
Capacity Reservations in each pool is indicated by AvailableInstanceCount.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 5,
"InstanceMatchCriteria": "open",
"State": "active"
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "m4.xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 5,
"InstanceMatchCriteria": "open",
"State": "active"
}
1063
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"CapacityReservationId": "cr-333",
"InstanceType": "m4.2xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount":5,
"InstanceMatchCriteria": "open",
"State": "active"
}
Fleet configuration
The following fleet configuration shows only the pertinent configurations for this example. The
total target capacity is 12, and the default target capacity type is on-demand. The On-Demand
allocation strategy is lowest-price. The usage strategy for Capacity Reservations is use-capacity-
reservations-first.
Note
The fleet type must be of type instant. Other fleet types do not support use-capacity-
reservations-first.
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-abc1234567example",
"Version": "1"
}
"Overrides": [
{
"InstanceType": "m5.large",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
},
{
"InstanceType": "m4.xlarge",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
},
{
"InstanceType": "m4.2xlarge",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 12,
"DefaultTargetCapacityType": "on-demand"
},
"OnDemandOptions": {
"AllocationStrategy": "lowest-price"
"CapacityReservationOptions": {
1064
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
"UsageStrategy": "use-capacity-reservations-first"
}
},
"Type": "instant",
}
After you create the instant fleet using the preceding configuration, the following 12 instances are
launched to meet the target capacity:
After the fleet is launched, you can run describe-capacity-reservations to see how many unused Capacity
Reservations are remaining. In this example, you should see the following response, which shows that
all of the m5.large and m4.xlarge Capacity Reservations were used, with 3 m4.2xlarge Capacity
Reservations remaining unused.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "m4.xlarge",
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-333",
"InstanceType": "m4.2xlarge",
"AvailableInstanceCount": 3
}
1065
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
Note that you can also use the prioritized allocation strategy instead of the lowest-price
allocation strategy.
Capacity Reservations
The account has the following 15 unused Capacity Reservations in 3 different pools. The number of
Capacity Reservations in each pool is indicated by AvailableInstanceCount.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 5,
"InstanceMatchCriteria": "open",
"State": "active"
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "m4.xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 5,
"InstanceMatchCriteria": "open",
"State": "active"
}
{
"CapacityReservationId": "cr-333",
"InstanceType": "m4.2xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount":5,
"InstanceMatchCriteria": "open",
"State": "active"
}
Fleet configuration
The following fleet configuration shows only the pertinent configurations for this example. The
total target capacity is 16, and the default target capacity type is on-demand. The On-Demand
allocation strategy is lowest-price. The usage strategy for Capacity Reservations is use-capacity-
reservations-first.
Note
The fleet type must be instant. Other fleet types do not support use-capacity-
reservations-first.
1066
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
"Overrides": [
{
"InstanceType": "m5.large",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
},
{
"InstanceType": "m4.xlarge",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
},
{
"InstanceType": "m4.2xlarge",
"AvailabilityZone": "us-east-1a",
"WeightedCapacity": 1
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 16,
"DefaultTargetCapacityType": "on-demand"
},
"OnDemandOptions": {
"AllocationStrategy": "lowest-price"
"CapacityReservationOptions": {
"UsageStrategy": "use-capacity-reservations-first"
}
},
"Type": "instant",
}
After you create the instant fleet using the preceding configuration, the following 16 instances are
launched to meet the target capacity:
After the fleet is launched, you can run describe-capacity-reservations to see how many unused Capacity
Reservations are remaining. In this example, you should see the following response, which shows that all
of the Capacity Reservations in all of the pools were used.
{
"CapacityReservationId": "cr-111",
"InstanceType": "m5.large",
1067
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "m4.xlarge",
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-333",
"InstanceType": "m4.2xlarge",
"AvailableInstanceCount": 0
}
Note that you can also use the prioritized allocation strategy instead of the lowest-price
allocation strategy.
For a walkthrough of the procedures that you must perform to accomplish this example, see Tutorial:
Launch On-Demand Instances using targeted Capacity Reservations (p. 1053).
Capacity Reservations
The account has the following 6 unused Capacity Reservations in 2 different pools. In this example, the
pools differ by their Availability Zones. The number of Capacity Reservations in each pool is indicated by
AvailableInstanceCount.
{
"CapacityReservationId": "cr-111",
"InstanceType": "c5.xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1a",
"AvailableInstanceCount": 3,
"InstanceMatchCriteria": "open",
"State": "active"
}
1068
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"CapacityReservationId": "cr-222",
"InstanceType": "c5.xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1b",
"AvailableInstanceCount": 3,
"InstanceMatchCriteria": "open",
"State": "active"
}
Fleet configuration
The following fleet configuration shows only the pertinent configurations for this example. The
total target capacity is 10, and the default target capacity type is on-demand. The On-Demand
allocation strategy is lowest-price. The usage strategy for Capacity Reservations is use-capacity-
reservations-first.
In this example, the On-Demand Instance price for c5.xlarge in us-east-1 is $0.17 per hour.
Note
The fleet type must be instant. Other fleet types do not support use-capacity-
reservations-first.
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "c5.xlarge",
"AvailabilityZone": "us-east-1a"
},
{
"InstanceType": "c5.xlarge",
"AvailabilityZone": "us-east-1b"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 10,
"DefaultTargetCapacityType": "on-demand"
},
"OnDemandOptions": {
"AllocationStrategy": "lowest-price",
"CapacityReservationOptions": {
"UsageStrategy": "use-capacity-reservations-first"
}
},
"Type": "instant"
}
After you create the instant fleet using the preceding configuration, the following 10 instances are
launched to meet the target capacity:
• The Capacity Reservations are used first to launch 6 On-Demand Instances as follows:
• 3 On-Demand Instances are launched into the 3 c5.xlarge targeted Capacity Reservations in
us-east-1a
1069
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
• 3 On-Demand Instances are launched into the 3 c5.xlarge targeted Capacity Reservations in
us-east-1b
• To meet the target capacity, 4 additional On-Demand Instances are launched into regular On-Demand
capacity according to the On-Demand allocation strategy, which is lowest-price in this example.
However, because the pools are the same price (because price is per Region and not per Availability
Zone), the fleet launches the remaining 4 On-Demand Instances into either of the pools.
After the fleet is launched, you can run describe-capacity-reservations to see how many unused Capacity
Reservations are remaining. In this example, you should see the following response, which shows that all
of the Capacity Reservations in all of the pools were used.
{
"CapacityReservationId": "cr-111",
"InstanceType": "c5.xlarge",
"AvailableInstanceCount": 0
}
{
"CapacityReservationId": "cr-222",
"InstanceType": "c5.xlarge",
"AvailableInstanceCount": 0
}
The effectiveness of the Capacity Rebalancing strategy depends on the number of Spot capacity pools
specified in the EC2 Fleet request. We recommend that you configure the fleet with a diversified set of
instance types and Availability Zones, and for AllocationStrategy, specify capacity-optimized.
For more information about what you should consider when configuring an EC2 Fleet for Capacity
Rebalancing, see Capacity Rebalancing (p. 955).
{
"ExcessCapacityTerminationPolicy": "termination",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "LaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "c3.large",
"WeightedCapacity": 1,
"Placement": {
1070
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
"AvailabilityZone": "us-east-1a"
}
},
{
"InstanceType": "c4.large",
"WeightedCapacity": 1,
"Placement": {
"AvailabilityZone": "us-east-1a"
}
},
{
"InstanceType": "c5.large",
"WeightedCapacity": 1,
"Placement": {
"AvailabilityZone": "us-east-1a"
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 5,
"DefaultTargetCapacityType": "spot"
},
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
"MaintenanceStrategies": {
"CapacityRebalance": {
"ReplacementStrategy": "launch-before-terminate",
"TerminationDelay": "720"
}
}
}
}
In the following example, the three launch specifications specify three Spot capacity pools. The target
capacity is 50 Spot Instances. The EC2 Fleet attempts to launch 50 Spot Instances into the Spot capacity
pool with optimal capacity for the number of instances that are launching.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized",
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2a"
},
},
{
1071
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
"InstanceType": "m4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
},
{
"InstanceType": "c5.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 50,
"DefaultTargetCapacityType": "spot"
}
}
When using the capacity-optimized-prioritized allocation strategy, you can use the Priority
parameter to specify the priorities of the Spot capacity pools, where the lower the number the higher
priority. You can also set the same priority for several Spot capacity pools if you favor them equally. If
you do not set a priority for a pool, the pool will be considered last in terms of priority.
In the following example, the three launch specifications specify three Spot capacity pools. Each pool is
prioritized, where the lower the number the higher priority. The target capacity is 50 Spot Instances. The
EC2 Fleet attempts to launch 50 Spot Instances into the Spot capacity pool with the highest priority on a
best-effort basis, but optimizes for capacity first.
{
"SpotOptions": {
"AllocationStrategy": "capacity-optimized-prioritized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
"Priority": 1,
"Placement": {
"AvailabilityZone": "us-west-2a"
},
},
1072
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"InstanceType": "m4.2xlarge",
"Priority": 2,
"Placement": {
"AvailabilityZone": "us-west-2b"
},
},
{
"InstanceType": "c5.2xlarge",
"Priority": 3,
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 50,
"DefaultTargetCapacityType": "spot"
}
In the following example, the three launch specifications specify three Spot capacity pools. The target
capacity is 50 Spot Instances. The EC2 Fleet attempts to launch 50 Spot Instances into the Spot capacity
pool with optimal capacity for the number of instances that are launching while also choosing the pool
that is the lowest priced.
{
"SpotOptions": {
"AllocationStrategy": "price-capacity-optimized",
"MinTargetCapacity": 2,
"SingleInstanceType": true
},
"OnDemandOptions": {
"AllocationStrategy": "lowest-price"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2a"
},
},
{
"InstanceType": "m4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
},
1073
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 Fleet example configurations
{
"InstanceType": "c5.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 50,
"OnDemandTargetCapacity":0,
"SpotTargetCapacity":50,
"DefaultTargetCapacityType": "spot"
},
"Type": "instant"
}
Any instance types that have 2 or more vCPUs and 4 MiB or more of memory will be identified. However,
price protection and the allocation strategy might exclude some instance types when EC2 Fleet
provisions the fleet (p. 942).
For a list and descriptions of all the possible attributes that you can specify, see InstanceRequirements in
the Amazon EC2 API Reference.
{
"SpotOptions": {
"AllocationStrategy": "price-capacity-optimized"
},
"LaunchTemplateConfigs": [{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2
},
"MemoryMiB": {
"Min": 4
}
}
}]
}],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 20,
"DefaultTargetCapacityType": "spot"
1074
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
},
"Type": "instant"
}
Examples
• Example 1: Launch Spot Instances using the lowest-priced Availability Zone or subnet in the
Region (p. 1075)
• Example 2: Launch Spot Instances using the lowest-priced Availability Zone or subnet in a specified
list (p. 1076)
• Example 3: Launch Spot Instances using the lowest-priced instance type in a specified list (p. 1077)
• Example 4. Override the price for the request (p. 1078)
• Example 5: Launch a Spot Fleet using the diversified allocation strategy (p. 1079)
• Example 6: Launch a Spot Fleet using instance weighting (p. 1081)
• Example 7: Launch a Spot Fleet with On-Demand capacity (p. 1082)
• Example 8: Configure Capacity Rebalancing to launch replacement Spot Instances (p. 1083)
• Example 9: Launch Spot Instances in a capacity-optimized fleet (p. 1084)
• Example 10: Launch Spot Instances in a capacity-optimized fleet with priorities (p. 1085)
• Example 11: Launch Spot Instances in a priceCapacityOptimized fleet (p. 1086)
• Example 12: Configure attribute-based instance type selection (p. 1086)
{
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "m3.medium",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
1075
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
]
}
Availability Zones
The Spot Fleet launches the instances in the default subnet of the lowest-priced Availability Zone that
you specified.
{
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "m3.medium",
"Placement": {
"AvailabilityZone": "us-west-2a, us-west-2b"
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
]
}
Subnets
You can specify default subnets or nondefault subnets, and the nondefault subnets can be from a
default VPC or a nondefault VPC. The Spot service launches the instances in whichever subnet is in the
lowest-priced Availability Zone.
You can't specify different subnets from the same Availability Zone in a Spot Fleet request.
{
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "m3.medium",
"SubnetId": "subnet-a61dafcf, subnet-65ea5f08",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
1076
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
}
]
}
If the instances are launched in a default VPC, they receive a public IPv4 address by default. If the
instances are launched in a nondefault VPC, they do not receive a public IPv4 address by default. Use
a network interface in the launch specification to assign a public IPv4 address to instances launched in
a nondefault VPC. When you specify a network interface, you must include the subnet ID and security
group ID using the network interface.
...
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"InstanceType": "m3.medium",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-1a2b3c4d",
"Groups": [ "sg-1a2b3c4d" ],
"AssociatePublicIpAddress": true
}
],
"IamInstanceProfile": {
"Arn": "arn:aws:iam::880185128111:instance-profile/my-iam-role"
}
}
...
Availability Zone
{
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "cc2.8xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
},
{
"ImageId": "ami-1a2b3c4d",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
1077
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"InstanceType": "r3.8xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
Subnet
{
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "cc2.8xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "r3.8xlarge",
"SubnetId": "subnet-1a2b3c4d"
}
]
}
The following examples specify a maximum price for the fleet request and maximum prices for two
of the three launch specifications. The maximum price for the fleet request is used for any launch
specification that does not specify a maximum price. The Spot Fleet launches the instances using the
instance type with the lowest price.
Availability Zone
{
"SpotPrice": "1.00",
"TargetCapacity": 30,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
"SpotPrice": "0.10"
1078
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.4xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
"SpotPrice": "0.20"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.8xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
Subnet
{
"SpotPrice": "1.00",
"TargetCapacity": 30,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.2xlarge",
"SubnetId": "subnet-1a2b3c4d",
"SpotPrice": "0.10"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.4xlarge",
"SubnetId": "subnet-1a2b3c4d",
"SpotPrice": "0.20"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.8xlarge",
"SubnetId": "subnet-1a2b3c4d"
}
]
}
Availability Zone
{
"SpotPrice": "0.70",
"TargetCapacity": 30,
"AllocationStrategy": "diversified",
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
1079
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "m3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
}
]
}
Subnet
{
"SpotPrice": "0.70",
"TargetCapacity": 30,
"AllocationStrategy": "diversified",
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c4.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "m3.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
}
]
}
A best practice to increase the chance that a spot request can be fulfilled by EC2 capacity in the event
of an outage in one of the Availability Zones is to diversify across zones. For this scenario, include each
Availability Zone available to you in the launch specification. And, instead of using the same subnet each
time, use three unique subnets (each mapping to a different zone).
Availability Zone
{
"SpotPrice": "0.70",
"TargetCapacity": 30,
"AllocationStrategy": "diversified",
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
1080
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c4.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2a"
}
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "m3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2c"
}
}
]
}
Subnet
{
"SpotPrice": "0.70",
"TargetCapacity": 30,
"AllocationStrategy": "diversified",
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c4.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "m3.2xlarge",
"SubnetId": "subnet-2a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-3a2b3c4d"
}
]
}
If the r3.2xlarge request is successful, Spot provisions 4 of these instances. Divide 20 by 6 for a total
of 3.33 instances, then round up to 4 instances.
1081
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
If the c3.xlarge request is successful, Spot provisions 7 of these instances. Divide 20 by 3 for a total of
6.66 instances, then round up to 7 instances.
For more information, see Spot Fleet instance weighting (p. 1002).
Availability Zone
{
"SpotPrice": "0.70",
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
"WeightedCapacity": 6
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.xlarge",
"Placement": {
"AvailabilityZone": "us-west-2b"
},
"WeightedCapacity": 3
}
]
}
Subnet
{
"SpotPrice": "0.70",
"TargetCapacity": 20,
"IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-1a2b3c4d",
"WeightedCapacity": 6
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c3.xlarge",
"SubnetId": "subnet-1a2b3c4d",
"WeightedCapacity": 3
}
]
}
The following example specifies the desired target capacity as 10, of which 5 must be On-Demand
capacity. Spot capacity is not specified; it is implied in the balance of the target capacity minus the On-
1082
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
Demand capacity. Amazon EC2 launches 5 capacity units as On-Demand, and 5 capacity units (10-5=5) as
Spot if there is available Amazon EC2 capacity and availability.
{
"IamFleetRole": "arn:aws:iam::781603563322:role/aws-ec2-spot-fleet-tagging-role",
"AllocationStrategy": "lowestPrice",
"TargetCapacity": 10,
"SpotPrice": null,
"ValidFrom": "2018-04-04T15:58:13Z",
"ValidUntil": "2019-04-04T15:58:13Z",
"TerminateInstancesWithExpiration": true,
"LaunchSpecifications": [],
"Type": "maintain",
"OnDemandTargetCapacity": 5,
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0dbb04d4a6cca5ad1",
"Version": "2"
},
"Overrides": [
{
"InstanceType": "t2.medium",
"WeightedCapacity": 1,
"SubnetId": "subnet-d0dc51fb"
}
]
}
]
}
The effectiveness of the Capacity Rebalancing strategy depends on the number of Spot capacity pools
specified in the Spot Fleet request. We recommend that you configure the fleet with a diversified set of
instance types and Availability Zones, and for AllocationStrategy, specify capacityOptimized.
For more information about what you should consider when configuring a Spot Fleet for Capacity
Rebalancing, see Capacity Rebalancing (p. 998).
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimized",
"IamFleetRole": "arn:aws:iam::000000000000:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
1083
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"LaunchTemplateSpecification": {
"LaunchTemplateName": "LaunchTemplate",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "c3.large",
"WeightedCapacity": 1,
"Placement": {
"AvailabilityZone": "us-east-1a"
}
},
{
"InstanceType": "c4.large",
"WeightedCapacity": 1,
"Placement": {
"AvailabilityZone": "us-east-1a"
}
},
{
"InstanceType": "c5.large",
"WeightedCapacity": 1,
"Placement": {
"AvailabilityZone": "us-east-1a"
}
}
]
}
],
"TargetCapacity": 5,
"SpotMaintenanceStrategies": {
"CapacityRebalance": {
"ReplacementStrategy": "launch-before-terminate",
"TerminationDelay": "720"
}
}
}
}
In the following example, the three launch specifications specify three Spot capacity pools. The target
capacity is 50 Spot Instances. The Spot Fleet attempts to launch 50 Spot Instances into the Spot capacity
pool with optimal capacity for the number of instances that are launching.
{
"TargetCapacity": "50",
"SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimized",
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
1084
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"AvailabilityZone": "us-west-2a"
},
{
"InstanceType": "m4.2xlarge",
"AvailabilityZone": "us-west-2b"
},
{
"InstanceType": "c5.2xlarge",
"AvailabilityZone": "us-west-2b"
}
]
}
]
}
When using the capacityOptimizedPrioritized allocation strategy, you can use the Priority
parameter to specify the priorities of the Spot capacity pools, where the lower the number the higher
priority. You can also set the same priority for several Spot capacity pools if you favor them equally. If
you do not set a priority for a pool, the pool will be considered last in terms of priority.
In the following example, the three launch specifications specify three Spot capacity pools. Each pool is
prioritized, where the lower the number the higher priority. The target capacity is 50 Spot Instances. The
Spot Fleet attempts to launch 50 Spot Instances into the Spot capacity pool with the highest priority on
a best-effort basis, but optimizes for capacity first.
{
"TargetCapacity": "50",
"SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimizedPrioritized"
},
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
"Priority": 1,
"AvailabilityZone": "us-west-2a"
},
{
"InstanceType": "m4.2xlarge",
"Priority": 2,
"AvailabilityZone": "us-west-2b"
},
{
"InstanceType": "c5.2xlarge",
1085
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Spot Fleet example configurations
"Priority": 3,
"AvailabilityZone": "us-west-2b"
}
]
}
]
}
In the following example, the three launch specifications specify three Spot capacity pools. The target
capacity is 50 Spot Instances. The Spot Fleet attempts to launch 50 Spot Instances into the Spot capacity
pool with optimal capacity for the number of instances that are launching while also choosing the pool
that is the lowest priced.
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "priceCapacityOptimized",
"OnDemandAllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111111111111:role/aws-ec2-spot-fleet-tagging-role",
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0123456789example",
"Version": "1"
},
"Overrides": [
{
"InstanceType": "r4.2xlarge",
"AvailabilityZone": "us-west-2a"
},
{
"InstanceType": "m4.2xlarge",
"AvailabilityZone": "us-west-2b"
},
{
"InstanceType": "c5.2xlarge",
"AvailabilityZone": "us-west-2b"
}
]
}
],
"TargetCapacity": 50,
"Type": "request"
}
}
1086
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Fleet quotas
Any instance types that have 2 or more vCPUs and 4 MiB or more of memory will be identified. However,
price protection and the allocation strategy might exclude some instance types when Spot Fleet
provisions the fleet (p. 985).
For a list and descriptions of all the possible attributes that you can specify, see InstanceRequirements in
the Amazon EC2 API Reference.
{
"AllocationStrategy": "priceCapacityOptimized",
"TargetCapacity": 20,
"Type": "request",
"LaunchTemplateConfigs": [{
"LaunchTemplateSpecification": {
"LaunchTemplateName": "my-launch-template",
"Version": "1"
},
"Overrides": [{
"InstanceRequirements": {
"VCpuCount": {
"Min": 2
},
"MemoryMiB": {
"Min": 4
}
}
}]
}]
}
Fleet quotas
The usual Amazon EC2 quotas (formerly referred to as limits) apply to instances launched by an EC2
Fleet or a Spot Fleet, such as Spot Instance limits (p. 445) and volume limits (p. 1828).
The target capacity across all EC2 Fleets and Spot 100,000 ¹
Fleets in a Region
1087
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Request a quota increase for target capacity
¹ These quotas apply to both your EC2 Fleets and your Spot Fleets.
² These are hard quotas. You cannot request an increase for these quotas.
³ After you delete an EC2 Fleet or cancel a Spot Fleet request, and if you specified that the fleet should
not terminate its Spot Instances when you deleted or canceled the request, the fleet request enters the
deleted_running (EC2 Fleet) or cancelled_running (Spot Fleet) state and the instances continue
to run until they are interrupted or you terminate them manually. If you terminate the instances, the
fleet request enters the deleted_terminating (EC2 Fleet) or cancelled_terminating ( Spot Fleet)
state and does not count towards this quota. For more information, see Delete an EC2 Fleet (p. 975) and
Cancel a Spot Fleet request (p. 1024).
⁴ This quota only applies to fleets of type request or maintain. This quota does not apply to instant
fleets.
1088
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Graphics basics
Elastic Graphics is suited for applications that require a small or intermittent amount of additional
graphics acceleration, and that use OpenGL graphics support. If you need access to full, directly attached
GPUs and use of DirectX, CUDA, or Open Computing Language (OpenCL) parallel computing frameworks,
use an accelerated computing instance type instance instead. For more information, see Windows
accelerated computing instances (p. 309).
Contents
• Elastic Graphics basics (p. 1089)
• Pricing for Elastic Graphics (p. 1091)
• Elastic Graphics limitations (p. 1091)
• Work with Elastic Graphics (p. 1091)
• Elastic Graphics maintenance (p. 1097)
• Use CloudWatch metrics to monitor Elastic Graphics (p. 1098)
• Troubleshoot (p. 1100)
Elastic Graphics accelerators are available in the following AWS Regions: us-east-1, us-east-2, us-
west-2, ap-northeast-1, ap-southeast-1, ap-southeast-2, eu-central-1, and eu-west-1.
• General purpose: M3, M4, M5, M5d, M5dn, M5n, T2, and T3
Note
Only t2.medium and larger and t3.medium and larger are supported.
• Compute optimized: C3, C4, C5, C5a, C5ad, C5d, and C5n
• Memory optimized: R3, R4, R5, R5d, R5dn, R5n, X1, X1e, and z1d
• Storage optimized: D2, D3, D3en, H1, I3, and I3en
• Accelerated computing: P2, P3, and P3dn
1089
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Graphics basics
The following Elastic Graphics accelerators are available. You can attach any Elastic Graphics accelerator
to any supported instance type.
eg1.medium 1
eg1.large 2
eg1.xlarge 4
eg1.2xlarge 8
An Elastic Graphics accelerator does not form part of the hardware of your instance. Instead, it is
network-attached through a network interface, known as the Elastic Graphics network interface. When
you launch or restart an instance with graphics acceleration, the Elastic Graphics network interface is
created in your VPC for you.
The Elastic Graphics network interface is created in the same subnet and VPC as your instance and is
assigned a private IPv4 address from that subnet. The accelerator attached to your Amazon EC2 instance
is allocated from a pool of available accelerators in the same Availability Zone as your instance.
Elastic Graphics accelerators support the API standards for OpenGL 4.3 API and earlier, which can be
used for batch applications or 3D-graphics acceleration. An Amazon-optimized OpenGL library on
your instance detects the attached accelerator. It directs OpenGL API calls from your instance to the
accelerator, which then processes the requests and returns the results. Traffic between the instance and
the accelerator uses the same bandwidth as the instance's network traffic so we recommend that you
have adequate network bandwidth available. Consult your software vendor for any OpenGL compliance
and version questions.
1090
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Pricing for Elastic Graphics
By default, the default security group for your VPC is associated with the Elastic Graphics network
interface. The Elastic Graphics network traffic uses the TCP protocol and port 2007. Ensure that the
security group for your instance allows for this. For more information, see Configure your security
groups (p. 1092).
Pricing for accelerators is available at On-Demand rates only. You can attach an accelerator to a Reserved
Instance or Spot Instance, however, the On-Demand price for the accelerator applies.
• You can attach accelerators only to Windows instances with Microsoft Windows Server 2012 R2 or
later. Linux instances are currently not supported.
• You can attach one accelerator to an instance at a time.
• You can attach an accelerator only during instance launch. You cannot attach an accelerator to an
existing instance.
• You can't hibernate an instance with an attached accelerator.
• You can't share an accelerator between instances.
• You can't detach an accelerator from an instance or transfer it to another instance. If you no longer
require an accelerator, you must terminate your instance. To change the accelerator type, create an
AMI from your instance, terminate the instance, and launch a new instance with a different accelerator
specification.
• The only supported versions of the OpenGL API are 4.3 and earlier. DirectX, CUDA, and OpenCL are not
supported.
• The Elastic Graphics accelerator is not visible or accessible through the device manager of your
instance.
• You can't reserve or schedule accelerator capacity.
• You can't attach accelerators to instances in EC2-Classic.
Tasks
• Configure your security groups (p. 1092)
• Launch an instance with an Elastic Graphics accelerator (p. 1093)
1091
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure your security groups
Inbound
Elastic Graphics TCP 2007 The security group ID (its own resource
ID)
Outbound
Elastic Graphics TCP 2007 The security group ID (its own resource
ID)
If you use the Amazon EC2 console to launch your instance with an Elastic Graphics accelerator, you can
either allow the launch instance wizard to automatically create the required security group rules, or you
can select a security that you created previously.
If you are launching your instance using the AWS CLI or an SDK, you must specify a security group that
you created previously.
a. For Security group name, enter a descriptive name for the security group, such as Elastic
Graphics security group.
b. (Optional) For Description, enter a brief description of the security group.
c. For VPC, select the VPC into which you intend to use Elastic Graphics.
d. Choose Create security group.
4. In the navigation pane, choose Security Groups, select the security group that you just created, and
on the Details tab, copy the Security group ID.
5. On the Inbound rules tab, choose Edit inbound rules and then do the following:
1092
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Launch an instance with an Elastic Graphics accelerator
For more information, see Amazon EC2 security groups for Windows instances (p. 1488).
You can use the run-instances AWS CLI command with the following parameter:
--elastic-gpu-specification Type=eg1.medium
For the --security-group-ids parameter, you must include a security group that has the required
inbound and outbound rules. For more information, see Configure your security groups (p. 1092).
To associate an Elastic Graphics accelerator during instance launch (Tools for Windows PowerShell)
1093
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Install the required software for Elastic Graphics
If your instance was launched with an AMI that does not have the Elastic Graphics packages pre-installed,
you can download and install them yourself. For more information, see Install the required software for
Elastic Graphics (p. 1094).
You can use one of the following methods to verify Elastic Graphics functionality on your instance.
Note
If the Elastic Graphics status monitor or command line tool returns an unexpected result, see
Resolve unhealthy status issues (p. 1102).
You can use the status monitor tool to view information about the status of an attached Elastic
Graphics accelerator. By default, this tool is available in the notification area of the taskbar in your
Windows instance and shows the status of the graphics accelerator. The following are the possible
values.
Healthy
The status of the Elastic Graphics accelerator is currently updating. It might take a few minutes
to display the status.
Out of service
The Elastic Graphics accelerator is out of service. To get more information about the error,
choose Read More.
You can use the Elastic Graphics command line tool, egcli.exe, to check the status of the
accelerator. If there is a problem with the accelerator, the tool returns an error message.
1094
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Verify Elastic Graphics functionality on your instance
To launch the tool, open a command prompt from within your instance and run the following
command:
C:\Program Files\Amazon\EC2ElasticGPUs\manager\egcli.exe
--json, -j
Indicates whether to show the JSON message. The possible values are true and false. The
default is true.
--imds, -i
Indicates whether to check the instance metadata for the availability of the accelerator. The
possible values are true and false. The default is true.
The following is example output. A status of OK indicates that the accelerator is enabled and healthy.
EG Infrastructure is available.
Instance ID egpu-f6d94dfa66df4883b284e96db7397ee6
Instance Type eg1.large
EG Version 1.0.0.885 (Manager) / 1.0.0.95 (OpenGL Library) / 1.0.0.69 (OpenGL
Redirector)
EG Status: Healthy
JSON Message:
{
"version": "2016-11-30",
"status": "OK"
}
OK
The Elastic Graphics driver has been updated and a reboot of the Amazon EC2 instance is
required.
LOADING_DRIVER
The Elastic Graphics driver is verifying the connectivity with the Elastic Graphics accelerator.
ERROR_UPDATE_RETRY
An error occurred while updating the Elastic Graphics driver, an update will be retried soon.
ERROR_UPDATE
1095
Amazon Elastic Compute Cloud
User Guide for Windows Instances
View Elastic Graphics information
ERROR_LOAD_DRIVER
• Attachment State
• Type
• Health status
You can use the describe-network-interfaces AWS CLI command and filter by owner ID to view
information about the Elastic Graphics network interface.
To view information about an Elastic Graphics accelerator (Tools for Windows PowerShell)
• Get-EC2ElasticGpu
• Get-EC2NetworkInterface
• From your web browser, paste the following URL into the address field:
1096
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Submit feedback
http://169.254.169.254/latest/meta-data/elastic-gpus/associations/egpu-
f6d94dfa66df4883b284e96db7397ee6
Submit feedback
You can submit feedback about your experience with Elastic Graphics so that the team can make further
improvements.
1. In the notification area of the taskbar in your Windows instance, open the Elastic Graphics Status
Monitor.
2. In the lower left corner, choose Feedback.
3. Enter your feedback and choose Submit.
When AWS determines that an Elastic Graphics accelerator is in an unhealthy state, it schedules the
accelerator for retirement. AWS notifies you of the accelerator's pending retirement, and provides you
with the remedial steps that you need to take.
Topics
• How will I be notified? (p. 1097)
• What do I need to do? (p. 1098)
• What happens when an accelerator reaches its retirement date? (p. 1098)
1097
Amazon Elastic Compute Cloud
User Guide for Windows Instances
What do I need to do?
We recommend that you close graphic applications running on the instance before you stop and restart
the instance.
Important
If you do not stop and start your instance before the scheduled retirement date, the accelerator
associated with your instance is automatically stopped, which might cause your applications to
stop working.
You must stop and start the instance. Rebooting the instance will not replace the unhealthy
accelerator with a healthy one.
If you do not stop and start your instance before the scheduled retirement date, the accelerator
associated with your instance is automatically stopped, which might cause your applications to stop
working.
By default, Elastic Graphics accelerators send metric data to CloudWatch in 5-minute periods.
For more information about Amazon CloudWatch, see the Amazon CloudWatch User Guide.
Metric Description
Units: Count
1098
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Graphics dimensions
Metric Description
Units: Count
Units: MiB
Dimension Description
InstanceId Filters the data by the instance to which the Elastic Graphics
accelerator is attached.
1099
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Troubleshoot
For example, you can create an alarm that monitors the health of an Elastic Graphics accelerator and
sends a notification when the graphics accelerator fails a status health check for three consecutive 5-
minute periods.
a. For Alarm details, type a name and description for your alarm. For Whenever, choose >= and
type 1.
b. For Actions, select an existing notification list or choose New list.
c. Choose Create Alarm.
Troubleshoot
The following are common errors and troubleshooting steps.
Contents
• Investigate application performance issues (p. 1100)
• OpenGL rendering performance issues (p. 1100)
• Remote access performance issues (p. 1101)
• Resolve unhealthy status issues (p. 1102)
• Check the instance configuration (p. 1102)
• Stop and start the instance (p. 1102)
• Verify the installed components (p. 1102)
• Check the Elastic Graphics logs (p. 1102)
• Why am I seeing multiple ENIs? (p. 1103)
1100
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Investigate application performance issues
An easy way to evaluate performance is to display the number of rendered frames on the remote
instance. Elastic Graphics accelerators display a maximum of 25 FPS on the remote instance to achieve
the best perceived quality while reducing network usage.
1. Open the following file in a text editor. If the file does not exist, create it.
C:\Program Files\Amazon\EC2ElasticGPUs\conf\eg.conf
2. Identify the [Application] section, or add it if it is not present, and add the following
configuration parameter:
[Application]
show_fps=1
If the FPS reaches 15-25 FPS when updating the rendered scene, then the Elastic Graphics accelerator
is performing at peak. Any other performance problems you experience are likely related to the remote
access to the instance desktop. If that is the case, see the Remote Access Performance Issues section.
If the FPS number is lower than 15, you can try the following:
• Improve Elastic Graphics accelerator performance by selecting a more powerful graphics accelerator
type.
• Improve overall network performance by using these tips:
• Check the amount of incoming and outgoing bandwidth to and from the Elastic Graphics accelerator
endpoint. The Elastic Graphics accelerator endpoint can be retrieved with the following PowerShell
command:
• The network traffic from the instance to the Elastic Graphics accelerator endpoint relates to the
volume of commands the OpenGL application is producing.
• The network traffic from the Elastic Graphics accelerator endpoint to the instance relates to the
number of frames generated by the graphics accelerator.
• If you see the network usage reaching the instances maximum network throughput, try using an
instance with a higher network throughput allowance.
• Improve CPU performance:
• Applications may require a lot of CPU resources in addition to what the Elastic Graphics accelerator
requires. If Windows Task Manager is reporting a high usage of CPU resources, try using an instance
with more CPU power.
1101
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Resolve unhealthy status issues
• Client performance
• Network latency and bandwidth between the client and the instance
If any of these items are missing, you must install them manually. For more information, see Install the
required software for Elastic Graphics (p. 1094).
• EC2ElasticGPUs
• EC2ElasticGPUs GUI
1102
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Why am I seeing multiple ENIs?
If you call StartInstances many times in a short period of time (a few seconds or less) on the same EC2
instance, a new network interface is created on each call. However:
• Only one network interface will be used by the Elastic Graphics accelerator.
• Extra network interfaces don't incur any charges and will be automatically released in 24 hours.
1103
Amazon Elastic Compute Cloud
User Guide for Windows Instances
After you have defined your monitoring goals and have created your monitoring plan, the next step is
to establish a baseline for normal Amazon EC2 performance in your environment. You should measure
Amazon EC2 performance at various times and under different load conditions. As you monitor Amazon
EC2, you should store a history of monitoring data that you collect. You can compare current Amazon
EC2 performance to this historical data to help you to identify normal performance patterns and
performance anomalies, and devise methods to address them. For example, you can monitor CPU
utilization, disk I/O, and network utilization for your EC2 instances. When performance falls outside your
established baseline, you might need to reconfigure or optimize the instance to reduce CPU utilization,
improve disk I/O, or reduce network traffic.
1104
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automated and manual monitoring
Monitoring tools
• Automated monitoring tools (p. 1105)
• Manual monitoring tools (p. 1106)
• System status checks – monitor the AWS systems required to use your instance to ensure that they
are working properly. These checks detect problems with your instance that require AWS involvement
to repair. When a system status check fails, you can choose to wait for AWS to fix the issue or you can
resolve it yourself (for example, by stopping and restarting or terminating and replacing an instance).
Examples of problems that cause system status checks to fail include:
• Loss of network connectivity
• Loss of system power
• Software issues on the physical host
• Hardware issues on the physical host that impact network reachability
For more information, see Status checks for your instances (p. 1107).
• Instance status checks – monitor the software and network configuration of your individual instance.
These checks detect problems that require your involvement to repair. When an instance status check
fails, typically you will need to address the problem yourself (for example, by rebooting the instance
or by making modifications in your operating system). Examples of problems that may cause instance
status checks to fail include:
• Failed system status checks
• Misconfigured networking or startup configuration
• Exhausted memory
• Corrupted file system
• Incompatible kernel
For more information, see Status checks for your instances (p. 1107).
• Amazon CloudWatch alarms – watch a single metric over a time period you specify, and perform
one or more actions based on the value of the metric relative to a given threshold over a number
of time periods. The action is a notification sent to an Amazon Simple Notification Service (Amazon
SNS) topic or Amazon EC2 Auto Scaling policy. Alarms invoke actions for sustained state changes only.
CloudWatch alarms will not invoke actions simply because they are in a particular state; the state
1105
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Manual monitoring tools
must have changed and been maintained for a specified number of periods. For more information, see
Monitor your instances using CloudWatch (p. 1137).
• Amazon EventBridge – automate your AWS services and respond automatically to system events.
Events from AWS services are delivered to EventBridge in near real time, and you can specify
automated actions to take when an event matches a rule you write. For more information, see What is
Amazon EventBridge?.
• Amazon CloudWatch Logs – monitor, store, and access your log files from Amazon EC2 instances, AWS
CloudTrail, or other sources. For more information, see the Amazon CloudWatch Logs User Guide.
• CloudWatch agent – collect logs and system-level metrics from both hosts and guests on your
EC2 instances and on-premises servers. For more information, see Collecting Metrics and Logs
from Amazon EC2 Instances and On-Premises Servers with the CloudWatch Agent in the Amazon
CloudWatch User Guide.
• AWS Management Pack for Microsoft System Center Operations Manager – links Amazon EC2
instances and the Windows or Linux operating systems running inside them. The AWS Management
Pack is an extension to Microsoft System Center Operations Manager. It uses a designated computer in
your datacenter (called a watcher node) and the Amazon Web Services APIs to remotely discover and
collect information about your AWS resources. For more information, see AWS Management Pack for
Microsoft System Center (p. 2014).
• Make monitoring a priority to head off small problems before they become big ones.
1106
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor the status of your instances
• Create and implement a monitoring plan that collects monitoring data from all of the parts in your
AWS solution so that you can more easily debug a multi-point failure if one occurs. Your monitoring
plan should address, at a minimum, the following questions:
• What are your goals for monitoring?
• What resources will you monitor?
• How often will you monitor these resources?
• What monitoring tools will you use?
• Who will perform the monitoring tasks?
• Who should be notified when something goes wrong?
• Automate monitoring tasks as much as possible.
• Check the log files on your EC2 instances.
A status check gives you the information that results from automated checks performed by Amazon EC2.
These automated checks detect whether specific issues are affecting your instances. The status check
information, together with the data provided by Amazon CloudWatch, gives you detailed operational
visibility into each of your instances.
You can also see status of specific events that are scheduled for your instances. The status of events
provides information about upcoming activities that are planned for your instances, such as rebooting or
retirement. They also provide the scheduled start and end time of each event.
Contents
• Status checks for your instances (p. 1107)
• State change events for your instances (p. 1112)
• Scheduled events for your instances (p. 1114)
Status checks are performed every minute, returning a pass or a fail status. If all checks pass, the overall
status of the instance is OK. If one or more checks fail, the overall status is impaired. Status checks are
built into Amazon EC2, so they cannot be disabled or deleted.
When a status check fails, the corresponding CloudWatch metric for status checks is incremented. For
more information, see Status check metrics (p. 1147). You can use these metrics to create CloudWatch
alarms that are triggered based on the result of the status checks. For example, you can create an alarm
to warn you if status checks fail on a specific instance. For more information, see Create and edit status
check alarms (p. 1111).
1107
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance status checks
You can also create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and
automatically recovers the instance if it becomes impaired due to an underlying issue. For more
information, see Recover your instance (p. 606).
Contents
• Types of status checks (p. 1108)
• View status checks (p. 1109)
• Report instance status (p. 1110)
• Create and edit status check alarms (p. 1111)
The following are examples of problems that can cause system status checks to fail:
If a system status check fails, we increment the StatusCheckFailed_System (p. 1147) metric.
If you perform a restart from the operating system on a bare metal instance, the system status check
might temporarily return a fail status. When the instance becomes available, the system status check
should return a pass status.
The following are examples of problems that can cause instance status checks to fail:
1108
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance status checks
• Exhausted memory
• Corrupted file system
• During instance reboot or while a Windows instance store-backed instance is being bundled, an
instance status check reports a failure until the instance becomes available again.
If an instance status check fails, we increment the StatusCheckFailed_Instance (p. 1147) metric.
If you perform a restart from the operating system on a bare metal instance, the instance status check
might temporarily return a fail status. When the instance becomes available, the instance status check
should return a pass status.
If your instance has a failed status check, you typically must address the problem yourself (for
example, by rebooting the instance or by making instance configuration changes).
5. To review the CloudWatch metrics for status checks, select the instance, and then choose the
Monitoring tab. Scroll until you see the graphs for the following metrics:
For more information, see the section called “Status check metrics” (p. 1147).
1109
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance status checks
To get the status of all instances with an instance status of impaired, use the following command.
We use reported feedback to identify issues impacting multiple customers, but do not respond to
individual account issues. Providing feedback does not change the status check results that you currently
see for the instance.
1110
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance status checks
--reason-codes code
If you add an email address to the list of recipients or created a new topic, Amazon SNS sends a
subscription confirmation email message to each new address. Each recipient must confirm the
subscription by choosing the link contained in that message. Alert notifications are sent only to
confirmed addresses.
6. For Alarm action, turn the toggle on to specify an action to take when the alarm is triggered. Select
the action.
7. For Alarm thresholds, specify the metric and criteria for the alarm.
You can leave the default settings for Group samples by (Average) and Type of data to sample
(Status check failed:either), or you can change them to suit your needs.
For Consecutive period, set the number of periods to evaluate and, in Period, enter the evaluation
period duration before triggering the alarm and sending an email.
8. (Optional) For Sample metric data, choose Add to dashboard.
9. Choose Create.
If you need to make changes to an instance status alarm, you can edit it.
1111
Amazon Elastic Compute Cloud
User Guide for Windows Instances
State change events
1. Select an existing SNS topic or create a new one. For more information, see Using the AWS CLI with
Amazon SNS in the AWS Command Line Interface User Guide.
2. Use the following list-metrics command to view the available Amazon CloudWatch metrics for
Amazon EC2.
The period is the time frame, in seconds, in which Amazon CloudWatch metrics are collected. This
example uses 300, which is 60 seconds multiplied by 5 minutes. The evaluation period is the number
of consecutive periods for which the value of the metric must be compared to the threshold. This
example uses 2. The alarm actions are the actions to perform when this alarm is triggered. This
example configures the alarm to send an email using Amazon SNS.
The following is example data for this event. In this example, the instance entered the pending state.
{
"id":"7bf73129-1428-4cd3-a780-95db273d1602",
"detail-type":"EC2 Instance State-change Notification",
"source":"aws.ec2",
"account":"123456789012",
"time":"2021-11-11T21:29:54Z",
"region":"us-east-1",
"resources":[
"arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1111"
],
"detail":{
"instance-id":"i-abcd1111",
"state":"pending"
}
}
• pending
• running
1112
Amazon Elastic Compute Cloud
User Guide for Windows Instances
State change events
• stopping
• stopped
• shutting-down
• terminated
When you launch or start an instance, it enters the pending state and then the running state. When
you stop an instance, it enters the stopping state and then the stopped state. When you terminate an
instance, it enters the shutting-down state and then the terminated state.
1113
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Scheduled events are managed by AWS; you cannot schedule events for your instances. You can view the
events scheduled by AWS, customize scheduled event notifications to include or remove tags from the
email notification, and perform actions when an instance is scheduled to reboot, retire, or stop.
To update the contact information for your account so that you can be sure to be notified about
scheduled events, go to the Account Settings page.
Note
When an instance is affected by a scheduled event, and it is part of an Auto Scaling group,
Amazon EC2 Auto Scaling eventually replaces it as part of its health checks, with no further
action necessary on your part. For more information about the health checks performed by
Amazon EC2 Auto Scaling, see Health checks for Auto Scaling instances in the Amazon EC2 Auto
Scaling User Guide.
Contents
• Types of scheduled events (p. 1114)
• View scheduled events (p. 1115)
• Customize scheduled event notifications (p. 1118)
• Work with instances scheduled to stop or retire (p. 1121)
• Work with instances scheduled for reboot (p. 1121)
• Work with instances scheduled for maintenance (p. 1123)
• Reschedule a scheduled event (p. 1123)
• Define event windows for scheduled events (p. 1125)
• Instance stop: At the scheduled time, the instance is stopped. When you start it again, it's migrated to
a new host. Applies only to instances backed by Amazon EBS.
• Instance retirement: At the scheduled time, the instance is stopped if it is backed by Amazon EBS, or
terminated if it is backed by instance store.
• Instance reboot: At the scheduled time, the instance is rebooted.
• System reboot: At the scheduled time, the host for the instance is rebooted.
1114
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
• System maintenance: At the scheduled time, the instance might be temporarily affected by network
maintenance or power maintenance.
New console
• Alternatively, in the navigation pane, choose EC2 Dashboard. Any resources with an
associated event are displayed under Scheduled events.
Old console
1115
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
• Alternatively, in the navigation pane, choose EC2 Dashboard. Any resources with an
associated event are displayed under Scheduled Events.
• Some events are also shown for affected resources. For example, in the navigation pane,
choose Instances and select an instance. If the instance has an associated instance stop or
instance retirement event, it is displayed in the lower pane.
AWS CLI
To view scheduled events for your instances using the AWS CLI
[
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-15T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
1116
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
]
]
[
"Events": [
{
"InstanceEventId": "instance-event-0e439355b779n26",
"Code": "instance-stop",
"Description": "The instance is running on degraded hardware",
"NotBefore": "2015-05-23T00:00:00.000Z"
}
]
]
PowerShell
To view scheduled events for your instances using the AWS Tools for Windows PowerShell
Code : instance-stop
Description : The instance is running on degraded hardware
NotBefore : 5/23/2015 12:00:00 AM
Instance metadata
You can retrieve information about active maintenance events for your instances from the instance
metadata (p. 817) by using Instance Metadata Service Version 2 or Instance Metadata Service
Version 1.
IMDSv2
IMDSv1
The following is example output with information about a scheduled system reboot event, in JSON
format.
[
{
"NotBefore" : "21 Jan 2019 09:00:43 GMT",
"Code" : "system-reboot",
"Description" : "scheduled reboot",
"EventId" : "instance-event-0d59937288b749b32",
"NotAfter" : "21 Jan 2019 09:17:23 GMT",
1117
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
"State" : "active"
}
]
To view event history about completed or canceled events for your instances using instance
metadata
You can retrieve information about completed or canceled events for your instances from instance
metadata (p. 817) by using Instance Metadata Service Version 2 or Instance Metadata Service
Version 1.
IMDSv2
IMDSv1
The following is example output with information about a system reboot event that was canceled,
and a system reboot event that was completed, in JSON format.
[
{
"NotBefore" : "21 Jan 2019 09:00:43 GMT",
"Code" : "system-reboot",
"Description" : "[Canceled] scheduled reboot",
"EventId" : "instance-event-0d59937288b749b32",
"NotAfter" : "21 Jan 2019 09:17:23 GMT",
"State" : "canceled"
},
{
"NotBefore" : "29 Jan 2019 09:00:43 GMT",
"Code" : "system-reboot",
"Description" : "[Completed] scheduled reboot",
"EventId" : "instance-event-0d59937288b749b32",
"NotAfter" : "29 Jan 2019 09:17:23 GMT",
"State" : "completed"
}
]
AWS Health
You can use the AWS Health Dashboard to learn about events that can affect your instance. The
AWS Health Dashboard organizes issues in three groups: open issues, scheduled changes, and other
notifications. The scheduled changes group contains items that are ongoing or upcoming.
For more information, see Getting started with the AWS Health Dashboard in the AWS Health User
Guide.
When you customize event notifications to include tags, you can choose to include:
1118
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
• All of the tags that are associated with the affected resource
• Only specific tags that are associated with the affected resource
For example, suppose that you assign application, costcenter, project, and owner tags to all
of your instances. You can choose to include all of the tags in event notifications. Alternatively, if you'd
like to see only the owner and project tags in event notifications, then you can choose to include only
those tags.
After you select the tags to include, the event notifications will include the resource ID (instance ID or
Dedicated Host ID) and the tag key and value pairs that are associated with the affected resource.
Topics
• Include tags in event notifications (p. 1119)
• Remove tags from event notifications (p. 1120)
• View the tags to be included in event notifications (p. 1120)
You can include tags in event notifications by using one of the following methods.
New console
• To include all of the tags associated with the affected instance or Dedicated Host, select
Include all resource tags.
• To manually select the tags to include, select Choose the tags to include, and then for
Choose the tags to include, enter the tag key and press Enter.
6. Choose Save.
AWS CLI
Use the register-instance-event-notification-attributes AWS CLI command and specify the tags to
include by using the InstanceTagKeys parameter.
1119
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
New console
• To remove all tags from event notifications, clear Include resource tags in event
notifications.
• To remove specific tags from event notifications, choose Remove (X) for the tags listed below
the Choose the tags to include field.
5. Choose Save.
AWS CLI
Use the deregister-instance-event-notification-attributes AWS CLI command and specify the tags to
remove by using the InstanceTagKeys parameter.
New console
1120
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
AWS CLI
You can wait for the instance to stop as scheduled. Alternatively, you can stop and start the instance
yourself, which migrates it to a new host. For more information about stopping your instance, in addition
to information about the changes to your instance configuration when it's stopped, see Stop and start
your instance (p. 580).
You can automate an immediate stop and start in response to a scheduled instance stop event. For more
information, see Automating Actions for EC2 Instances in the AWS Health User Guide.
We recommend that you launch a replacement instance from your most recent AMI and migrate all
necessary data to the replacement instance before the instance is scheduled to terminate. Then, you can
terminate the original instance, or wait for it to terminate as scheduled.
If you stop your linked EC2-Classic instance (p. 1377), it is automatically unlinked from the VPC and the
VPC security groups are no longer associated with the instance. You can link your instance to the VPC
again after you've restarted it.
New console
1121
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Old console
AWS CLI
To view the type of scheduled reboot event using the AWS CLI
For scheduled reboot events, the value for Code is either system-reboot or instance-reboot.
The following example output shows a system-reboot event.
[
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-14T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
]
You can wait for the instance reboot to occur within its scheduled maintenance window,
reschedule (p. 1123) the instance reboot to a date and time that suits you, or reboot (p. 597) the
instance yourself at a time that is convenient for you.
After your instance is rebooted, the scheduled event is cleared and the event's description is updated.
The pending maintenance to the underlying host is completed, and you can begin using your instance
again after it has fully booted.
It is not possible for you to reboot the system yourself. You can wait for the system reboot to occur
during its scheduled maintenance window, or you can reschedule (p. 1123) the system reboot to a date
and time that suits you. A system reboot typically completes in a matter of minutes. After the system
reboot has occurred, the instance retains its IP address and DNS name, and any data on local instance
store volumes is preserved. After the system reboot is complete, the scheduled event for the instance is
cleared, and you can verify that the software on your instance is operating as expected.
1122
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Alternatively, if it is necessary to maintain the instance at a different time and you can't reschedule the
system reboot, then you can stop and start an Amazon EBS-backed instance, which migrates it to a new
host. However, the data on the local instance store volumes is not preserved. You can also automate
an immediate instance stop and start in response to a scheduled system reboot event. For more
information, see Automating Actions for EC2 Instances in the AWS Health User Guide. For an instance
store-backed instance, if you can't reschedule the system reboot, then you can launch a replacement
instance from your most recent AMI, migrate all necessary data to the replacement instance before the
scheduled maintenance window, and then terminate the original instance.
During network maintenance, scheduled instances lose network connectivity for a brief period of time.
Normal network connectivity to your instance is restored after maintenance is complete.
During power maintenance, scheduled instances are taken offline for a brief period, and then rebooted.
When a reboot is performed, all of your instance's configuration settings are retained.
After your instance has rebooted (this normally takes a few minutes), verify that your application is
working as expected. At this point, your instance should no longer have a scheduled event associated
with it, or if it does, the description of the scheduled event begins with [Completed]. It sometimes takes
up to 1 hour for the instance status description to refresh. Completed maintenance events are displayed
on the Amazon EC2 console dashboard for up to a week.
You can wait for the maintenance to occur as scheduled. Alternatively, you can stop and start the
instance, which migrates it to a new host. For more information about stopping your instance, in addition
to information about the changes to your instance configuration when it's stopped, see Stop and start
your instance (p. 580).
You can automate an immediate stop and start in response to a scheduled maintenance event. For more
information, see Automating Actions for EC2 Instances in the AWS Health User Guide.
You can wait for the maintenance to occur as scheduled. Alternatively, if you want to maintain normal
operation during a scheduled maintenance window, you can launch a replacement instance from
your most recent AMI, migrate all necessary data to the replacement instance before the scheduled
maintenance window, and then terminate the original instance.
New console
1123
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Only events that have an event deadline date, indicated by a value for Deadline, can be
rescheduled. If one of the selected events does not have a deadline date, Actions, Schedule
event is disabled.
5. For New start time, enter a new date and time for the event. The new date and time must occur
before the Event deadline.
6. Choose Save.
It might take a minute or 2 for the updated event start time to be reflected in the console.
Old console
Only events that have an event deadline date, indicated by a value for Event Deadline, can be
rescheduled.
5. For Event start time, enter a new date and time for the event. The new date and time must
occur before the Event Deadline.
6. Choose Schedule Event.
It might take a minute or 2 for the updated event start time to be reflected in the console.
AWS CLI
1. Only events that have an event deadline date, indicated by a value for NotBeforeDeadline,
can be rescheduled. Use the describe-instance-status command to view the
NotBeforeDeadline parameter value.
The following example output shows a system-reboot event that can be rescheduled because
NotBeforeDeadline contains a value.
[
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-14T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
]
2. To reschedule the event, use the modify-instance-event-start-time command. Specify the new
event start time by using the not-before parameter. The new event start time must fall before
the NotBeforeDeadline.
1124
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
It might take a minute or 2 before the describe-instance-status command returns the updated
not-before parameter value.
Limitations
• Only events with an event deadline date can be rescheduled. The event can be rescheduled up to the
event deadline date. The Deadline column in the console and the NotBeforeDeadline field in the
AWS CLI indicate if the event has a deadline date.
• Only events that have not yet started can be rescheduled. The Start time column in the console and
the NotBefore field in the AWS CLI indicate the event start time. Events that are scheduled to start in
the next 5 minutes cannot be rescheduled.
• The new event start time must be at least 60 minutes from the current time.
• If you reschedule multiple events using the console, the event deadline date is determined by the
event with the earliest event deadline date.
You can use event windows to maximize workload availability by specifying event windows that occur
during off-peak periods for your workload. You can also align the event windows with your internal
maintenance schedules.
You define an event window by specifying a set of time ranges. The minimum time range is 2 hours. The
combined time ranges must total at least 4 hours.
You can associate one or more instances with an event window by using either instance IDs or instance
tags. You can also associate Dedicated Hosts with an event window by using the host ID.
Warning
Event windows are applicable only for scheduled events that stop, reboot, or terminate
instances.
Event windows are not applicable for:
1125
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Considerations
• All event window times are in UTC.
• The minimum weekly event window duration is 4 hours.
• The time ranges within an event window must each be at least 2 hours.
• Only one target type (instance ID, Dedicated Host ID, or instance tag) can be associated with an event
window.
• A target (instance ID, Dedicated Host ID, or instance tag) can only be associated with one event
window.
• A maximum of 100 instance IDs, or 50 Dedicated Host IDs, or 50 instance tags can be associated with
an event window. The instance tags can be associated with any number of instances.
• A maximum of 200 event windows can be created per AWS Region.
• Multiple instances that are associated with event windows can potentially have scheduled events occur
at the same time.
• If AWS has already scheduled an event, modifying an event window won't change the time of the
scheduled event. If the event has a deadline date, you can reschedule the event (p. 1123).
• You can stop and start an instance prior to the scheduled event, which migrates the instance to a new
host, and the scheduled event will no longer take place.
Console
AWS CLI
Expected output
{
"InstanceEventWindows": [
{
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [
"i-1234567890abcdef0",
"i-0598c7d356eba48d7"
],
1126
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
"Tags": [],
"DedicatedHostIds": []
},
"State": "active",
"Tags": []
}
...
],
"NextToken": "9d624e0c-388b-4862-a31e-a85c64fc1d4a"
}
To describe event windows that match one or more filters using the AWS CLI
When a filter is used, it performs a direct match. However, the instance-id filter is different. If
there is no direct match to the instance ID, then it falls back to indirect associations with the event
window, such as the instance's tags or Dedicated Host ID (if the instance is on a Dedicated Host).
For the list of supported filters, see describe-instance-event-windows in the AWS CLI Reference.
Expected output
In the following example, the instance is on a Dedicated Host, which is associated with the event
window.
{
"InstanceEventWindows": [
{
"InstanceEventWindowId": "iew-0dbc0adb66f235982",
"TimeRanges": [
{
"StartWeekDay": "sunday",
"StartHour": 2,
"EndWeekDay": "sunday",
"EndHour": 8
}
],
"Name": "myEventWindowName",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [],
1127
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
"DedicatedHostIds": [
"h-0140d9a7ecbd102dd"
]
},
"State": "active",
"Tags": []
}
]
}
For the event window constraints, see Considerations (p. 1126) earlier in this topic.
Console
Note that you can create the event window without associating a target with the window. Later,
you can modify the window to associate one or more targets.
7. (Optional) For Event window tags, choose Add tag, and enter the key and value for the tag.
Repeat for each tag.
8. Choose Create event window.
1128
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
AWS CLI
To create an event window using the AWS CLI, you first create the event window, and then you
associate one or more targets with the event window.
You can define either a set of time ranges or a cron expression when creating the event window, but
not both.
To create an event window with a time range using the AWS CLI
Use the create-instance-event-window command and specify the --time-range parameter. You
can't also specify the --cron-expression parameter.
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"TimeRanges": [
{
"StartWeekDay": "monday",
"StartHour": 2,
"EndWeekDay": "wednesday",
"EndHour": 8
}
],
"Name": "myEventWindowName",
"State": "creating",
"Tags": [
{
"Key": "K1",
"Value": "V1"
}
]
}
}
To create an event window with a cron expression using the AWS CLI
Expected output
1129
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"State": "creating",
"Tags": [
{
"Key": "K1",
"Value": "V1"
}
]
}
}
You can associate only one type of target (instance IDs, Dedicated Host IDs, or instance tags) with an
event window.
To associate instance tags with an event window using the AWS CLI
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [
{
"Key": "k2",
"Value": "v2"
},
{
"Key": "k1",
"Value": "v1"
}
],
"DedicatedHostIds": []
},
"State": "creating"
}
}
To associate one or more instances with an event window using the AWS CLI
1130
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
--region us-east-1 \
--instance-event-window-id iew-0abcdef1234567890 \
--association-target "InstanceIds=i-1234567890abcdef0,i-0598c7d356eba48d7"
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [
"i-1234567890abcdef0",
"i-0598c7d356eba48d7"
],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating"
}
}
To associate a Dedicated Host with an event window using the AWS CLI
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [],
"DedicatedHostIds": [
"h-029fa35a02b99801d"
]
},
"State": "creating"
}
}
1131
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Console
AWS CLI
To modify an event window using the AWS CLI, you can modify the time range or cron expression,
and associate or disassociate one or more targets with the event window.
You can modify either a time range or a cron expression when modifying the event window, but not
both.
To modify the time range of an event window using the AWS CLI
Use the modify-instance-event-window command and specify the event window to modify. Specify
the --time-range parameter to modify the time range. You can't also specify the --cron-
expression parameter.
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"TimeRanges": [
{
"StartWeekDay": "monday",
"StartHour": 2,
"EndWeekDay": "wednesday",
"EndHour": 8
}
],
"Name": "myEventWindowName",
"AssociationTarget": {
"InstanceIds": [
"i-0abcdef1234567890",
"i-0be35f9acb8ba01f0"
],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating",
"Tags": [
{
"Key": "K1",
"Value": "V1"
}
]
1132
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
}
}
To modify a set of time ranges for an event window using the AWS CLI
Use the modify-instance-event-window command and specify the event window to modify. Specify
the --time-range parameter to modify the time range. You can't also specify the --cron-
expression parameter in the same call.
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"TimeRanges": [
{
"StartWeekDay": "monday",
"StartHour": 2,
"EndWeekDay": "wednesday",
"EndHour": 8
},
{
"StartWeekDay": "thursday",
"StartHour": 2,
"EndWeekDay": "friday",
"EndHour": 8
}
],
"Name": "myEventWindowName",
"AssociationTarget": {
"InstanceIds": [
"i-0abcdef1234567890",
"i-0be35f9acb8ba01f0"
],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating",
"Tags": [
{
"Key": "K1",
"Value": "V1"
}
]
}
}
To modify the cron expression of an event window using the AWS CLI
Use the modify-instance-event-window command and specify the event window to modify. Specify
the --cron-expression parameter to modify the cron expression. You can't also specify the --
time-range parameter.
1133
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
--region us-east-1 \
--instance-event-window-id iew-0abcdef1234567890 \
--cron-expression "* 21-23 * * 2,3"
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [
"i-0abcdef1234567890",
"i-0be35f9acb8ba01f0"
],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating",
"Tags": [
{
"Key": "K1",
"Value": "V1"
}
]
}
}
You can associate additional targets with an event window. You can also disassociate existing targets
from an event window. However, only one type of target (instance IDs, Dedicated Host IDs, or
instance tags) can be associated with an event window.
For the instructions on how to associate targets with an event window, see Associate a target with an
event window.
To disassociate instance tags from an event window using the AWS CLI
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [],
1134
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
"DedicatedHostIds": []
},
"State": "creating"
}
}
To disassociate one or more instances from an event window using the AWS CLI
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating"
}
}
To disassociate a Dedicated Host from an event window using the AWS CLI
Expected output
{
"InstanceEventWindow": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"Name": "myEventWindowName",
"CronExpression": "* 21-23 * * 2,3",
"AssociationTarget": {
"InstanceIds": [],
"Tags": [],
"DedicatedHostIds": []
},
"State": "creating"
}
}
1135
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scheduled events
Console
AWS CLI
Use the delete-instance-event-window command and specify the event window to delete.
Use the --force-delete parameter if the event window is currently associated with targets.
Expected output
{
"InstanceEventWindowState": {
"InstanceEventWindowId": "iew-0abcdef1234567890",
"State": "deleting"
}
}
To tag an event window when you create it, see Create event windows (p. 1128).
Console
1136
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor your instances using CloudWatch
AWS CLI
Use the create-tags command to tag existing resources. In the following example, the existing event
window is tagged with Key=purpose and Value=test.
By default, Amazon EC2 sends metric data to CloudWatch in 5-minute periods. To send metric data for
your instance to CloudWatch in 1-minute periods, you can enable detailed monitoring on the instance.
For more information, see Enable or turn off detailed monitoring for your instances (p. 1137).
The Amazon EC2 console displays a series of graphs based on the raw data from Amazon CloudWatch.
Depending on your needs, you might prefer to get data for your instances from Amazon CloudWatch
instead of the graphs in the console.
For more information about Amazon CloudWatch, see the Amazon CloudWatch User Guide.
Contents
• Enable or turn off detailed monitoring for your instances (p. 1137)
• List the available CloudWatch metrics for your instances (p. 1139)
• Get statistics for metrics for your instances (p. 1152)
• Graph metrics for your instances (p. 1160)
• Create a CloudWatch alarm for an instance (p. 1160)
• Create alarms that stop, terminate, reboot, or recover an instance (p. 1161)
The following describes the data interval and charge for basic and detailed monitoring for instances.
1137
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Enable detailed monitoring
Detailed Data is available in 1-minute periods. You are charged per metric that is sent
monitoring To get this level of data, you must to CloudWatch. You are not charged
specifically enable it for the instance. for data storage. For more information,
For the instances where you've enabled see Paid tier and Example 1 - EC2
detailed monitoring, you can also get Detailed Monitoring on the Amazon
aggregated data across groups of CloudWatch pricing page.
similar instances.
Topics
• Required IAM permissions (p. 1138)
• Enable detailed monitoring (p. 1138)
• Turn off detailed monitoring (p. 1139)
Console
When launching an instance using the AWS Management Console, select the Monitoring check box
on the Configure Instance Details page.
AWS CLI
Use the following monitor-instances command to enable detailed monitoring for the specified
instances.
1138
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Use the run-instances command with the --monitoring flag to enable detailed monitoring.
Console
AWS CLI
Use the following unmonitor-instances command to turn off detailed monitoring for the specified
instances.
For information about getting the statistics for these metrics, see Get statistics for metrics for your
instances (p. 1152).
Contents
• Instance metrics (p. 1140)
• CPU credit metrics (p. 1143)
• Dedicated Host metrics (p. 1144)
• Amazon EBS metrics for Nitro-based instances (p. 1144)
• Status check metrics (p. 1147)
• Traffic mirroring metrics (p. 1147)
• Auto Scaling group metrics (p. 1147)
1139
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Instance metrics
The AWS/EC2 namespace includes the following instance metrics.
Metric Description
CPUUtilization The percentage of allocated EC2 compute units that are currently
in use on the instance. This metric identifies the processing power
required to run an application on a selected instance.
Units: Percent
To calculate the average I/O operations per second (IOPS) for the
period, divide the total operations in the period by the number of
seconds in that period.
Units: Count
To calculate the average I/O operations per second (IOPS) for the
period, divide the total operations in the period by the number of
seconds in that period.
Units: Count
DiskReadBytes Bytes read from all instance store volumes available to the instance.
1140
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
DiskReadBytes in CloudWatch as m1, the metric math formula
m1/(DIFF_TIME(m1)) returns the metric in bytes/second. For
more information about DIFF_TIME and other metric math
functions, see Use metric math in the Amazon CloudWatch User
Guide.
Units: Bytes
DiskWriteBytes Bytes written to all instance store volumes available to the instance.
Units: Bytes
Units: Count
1141
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
Units: Bytes
NetworkOut The number of bytes sent out by the instance on all network
interfaces. This metric identifies the volume of outgoing network
traffic from a single instance.
The number reported is the number of bytes sent during the period.
If you are using basic (5-minute) monitoring and the statistic is
Sum, you can divide this number by 300 to find Bytes/second. If
you have detailed (1-minute) monitoring and the statistic is Sum,
divide it by 60. You can also use the CloudWatch metric math
function DIFF_TIME to find the bytes per second. For example, if
you have graphed NetworkOut in CloudWatch as m1, the metric
math formula m1/(DIFF_TIME(m1)) returns the metric in bytes/
second. For more information about DIFF_TIME and other metric
math functions, see Use metric math in the Amazon CloudWatch
User Guide.
Units: Bytes
Units: Count
1142
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
NetworkPacketsOut The number of packets sent out by the instance on all network
interfaces. This metric identifies the volume of outgoing traffic in
terms of the number of packets on a single instance.
Units: Count
Metric Description
CPUCreditUsage The number of CPU credits spent by the instance for CPU
utilization. One CPU credit equals one vCPU running at 100%
utilization for one minute or an equivalent combination of vCPUs,
utilization, and time (for example, one vCPU running at 50%
utilization for two minutes or two vCPUs running at 25% utilization
for two minutes).
Credits are accrued in the credit balance after they are earned,
and removed from the credit balance when they are spent. The
credit balance has a maximum limit, determined by the instance
size. After the limit is reached, any new credits that are earned are
discarded. For T2 Standard, launch credits do not count towards the
limit.
1143
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
CPUCreditBalance value persists for seven days. Thereafter,
all accrued credits are lost. When a T2 instance stops, the
CPUCreditBalance value does not persist, and all accrued credits
are lost.
CPUSurplusCreditsCharged The number of spent surplus credits that are not paid down by
earned CPU credits, and which thus incur an additional charge.
Spent surplus credits are charged when any of the following occurs:
Metric Description
Unit: Percent
1144
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
Unit: Count
Unit: Count
1145
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Metric Description
and other metric math functions, see Use metric math
in the Amazon CloudWatch User Guide.
Unit: Bytes
Unit: Bytes
Unit: Percent
Unit: Percent
1146
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
For information about the metrics provided for your EBS volumes, see Amazon EBS metrics (p. 1788).
For information about the metrics provided for your Spot fleets, see CloudWatch metrics for Spot
Fleet (p. 1025).
Metric Description
StatusCheckFailed Reports whether the instance has passed both the instance status
check and the system status check in the last minute.
Units: Count
StatusCheckFailed_Instance Reports whether the instance has passed the instance status check
in the last minute.
Units: Count
StatusCheckFailed_System Reports whether the instance has passed the system status check in
the last minute.
Units: Count
1147
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Dimension Description
AutoScalingGroupName This dimension filters the data you request for all instances in a
specified capacity group. An Auto Scaling group is a collection of
instances you define if you're using Auto Scaling. This dimension is
available only for Amazon EC2 metrics when the instances are in
such an Auto Scaling group. Available for instances with Detailed or
Basic Monitoring enabled.
ImageId This dimension filters the data you request for all instances running
this Amazon EC2 Amazon Machine Image (AMI). Available for
instances with Detailed Monitoring enabled.
InstanceId This dimension filters the data you request for the identified
instance only. This helps you pinpoint an exact instance from which
to monitor data.
InstanceType This dimension filters the data you request for all instances
running with this specified instance type. This helps you categorize
your data by the type of instance running. For example, you
might compare data from an m1.small instance and an m1.large
instance to determine which has the better business value for
your application. Available for instances with Detailed Monitoring
enabled.
Amazon EC2 usage metrics correspond to AWS service quotas. You can configure alarms that alert you
when your usage approaches a service quota. For more information about CloudWatch integration with
service quotas, see AWS usage metrics in the Amazon CloudWatch User Guide.
Metric Description
ResourceCount The number of the specified resources running in your account. The
resources are defined by the dimensions associated with the metric.
The following dimensions are used to refine the usage metrics that are published by Amazon EC2.
Dimension Description
Service The name of the AWS service containing the resource. For Amazon
EC2 usage metrics, the value for this dimension is EC2.
1148
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
Dimension Description
Type The type of entity that is being reported. Currently, the only valid
value for Amazon EC2 usage metrics is Resource.
Resource The type of resource that is running. Currently, the only valid value
for Amazon EC2 usage metrics is vCPU, which returns information
on instances that are running.
Class The class of resource being tracked. For Amazon EC2 usage metrics
with vCPU as the value of the Resource dimension, the valid
values are Standard/OnDemand, F/OnDemand, G/OnDemand,
Inf/OnDemand, P/OnDemand, and X/OnDemand.
The values for this dimension define the first letter of the instance
types that are reported by the metric. For example, Standard/
OnDemand returns information about all running instances with
types that start with A, C, D, H, I, M, R, T, and Z, and G/OnDemand
returns information about all running instances with types that
start with G.
1149
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
1150
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List available metrics
5. To sort the metrics, use the column heading. To graph a metric, select the check box next to the
metric. To filter by resource, choose the resource ID and then choose Add to search. To filter by
metric, choose the metric name and then choose Add to search.
To list all the available metrics for Amazon EC2 (AWS CLI)
The following example specifies the AWS/EC2 namespace to view all the metrics for Amazon EC2.
{
"Metrics": [
{
"Namespace": "AWS/EC2",
"Dimensions": [
{
"Name": "InstanceId",
"Value": "i-1234567890abcdef0"
}
],
"MetricName": "NetworkOut"
},
{
"Namespace": "AWS/EC2",
"Dimensions": [
{
"Name": "InstanceId",
"Value": "i-1234567890abcdef0"
}
],
"MetricName": "CPUUtilization"
1151
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
},
{
"Namespace": "AWS/EC2",
"Dimensions": [
{
"Name": "InstanceId",
"Value": "i-1234567890abcdef0"
}
],
"MetricName": "NetworkIn"
},
...
]
}
The following example specifies the AWS/EC2 namespace and the InstanceId dimension to view the
results for the specified instance only.
The following example specifies the AWS/EC2 namespace and a metric name to view the results for the
specified metric only.
Contents
• Statistics overview (p. 1152)
• Get statistics for a specific instance (p. 1153)
• Aggregate statistics across instances (p. 1156)
• Aggregate statistics by Auto Scaling group (p. 1158)
• Aggregate statistics by AMI (p. 1159)
Statistics overview
Statistics are metric data aggregations over specified periods of time. CloudWatch provides statistics
based on the metric data points provided by your custom data or provided by other services in AWS to
CloudWatch. Aggregations are made using the namespace, metric name, dimensions, and the data point
unit of measure, within the time period you specify. The following table describes the available statistics.
Statistic Description
Minimum The lowest value observed during the specified period. You can use this value to
determine low volumes of activity for your application.
1152
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
Statistic Description
Maximum The highest value observed during the specified period. You can use this value to
determine high volumes of activity for your application.
Sum All values submitted for the matching metric added together. This statistic can be
useful for determining the total volume of a metric.
Average The value of Sum / SampleCount during the specified period. By comparing this
statistic with the Minimum and Maximum, you can determine the full scope of a metric
and how close the average use is to the Minimum and Maximum. This comparison
helps you to know when to increase or decrease your resources as needed.
SampleCount The count (number) of data points used for the statistical calculation.
pNN.NN The value of the specified percentile. You can specify any percentile, using up to two
decimal places (for example, p95.45).
Requirements
• You must have the ID of the instance. You can get the instance ID using the AWS Management Console
or the describe-instances command.
• By default, basic monitoring is enabled, but you can enable detailed monitoring. For more information,
see Enable or turn off detailed monitoring for your instances (p. 1137).
1153
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
1154
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
5. In the search field, enter CPUUtilization and press Enter. Choose the row for the specific
instance, which displays a graph for the CPUUtilization metric for the instance. To name the graph,
choose the pencil icon. To change the time range, select one of the predefined values or choose
custom.
6. To change the statistic or the period for the metric, choose the Graphed metrics tab. Choose the
column heading or an individual value, and then choose a different value.
Use the following get-metric-statistics command to get the CPUUtilization metric for the specified
instance, using the specified period and time interval:
The following is example output. Each value represents the maximum CPU utilization percentage for a
single EC2 instance.
1155
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
{
"Datapoints": [
{
"Timestamp": "2022-10-19T00:18:00Z",
"Maximum": 0.33000000000000002,
"Unit": "Percent"
},
{
"Timestamp": "2022-10-19T03:18:00Z",
"Maximum": 99.670000000000002,
"Unit": "Percent"
},
{
"Timestamp": "2022-10-19T07:18:00Z",
"Maximum": 0.34000000000000002,
"Unit": "Percent"
},
{
"Timestamp": "2022-10-19T12:18:00Z",
"Maximum": 0.34000000000000002,
"Unit": "Percent"
},
...
],
"Label": "CPUUtilization"
}
Note that Amazon CloudWatch cannot aggregate data across AWS Regions. Metrics are completely
separate between Regions.
This example shows you how to use detailed monitoring to get the average CPU usage for your EC2
instances. Because no dimension is specified, CloudWatch returns statistics for all dimensions in the AWS/
EC2 namespace.
Important
This technique for retrieving all dimensions across an AWS namespace does not work for custom
namespaces that you publish to Amazon CloudWatch. With custom namespaces, you must
specify the complete set of dimensions that are associated with any given data point to retrieve
statistics that include the data point.
1156
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
5. To change the statistic or the period for the metric, choose the Graphed metrics tab. Choose the
column heading or an individual value, and then choose a different value.
Use the get-metric-statistics command as follows to get the average of the CPUUtilization metric across
your instances.
{
"Datapoints": [
{
"SampleCount": 238.0,
"Timestamp": "2022-10-12T07:18:00Z",
"Average": 0.038235294117647062,
"Unit": "Percent"
},
{
"SampleCount": 240.0,
"Timestamp": "2022-10-12T09:18:00Z",
"Average": 0.16670833333333332,
"Unit": "Percent"
},
{
1157
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
"SampleCount": 238.0,
"Timestamp": "2022-10-11T23:18:00Z",
"Average": 0.041596638655462197,
"Unit": "Percent"
},
...
],
"Label": "CPUUtilization"
}
This example shows you how to retrieve the total bytes written to disk for one Auto Scaling group. The
total is computed for 1-minute periods for a 24-hour interval across all EC2 instances in the specified
Auto Scaling group.
To display DiskWriteBytes for the instances in an Auto Scaling group (AWS CLI)
{
"Datapoints": [
{
"SampleCount": 18.0,
"Timestamp": "2022-10-19T21:36:00Z",
"Sum": 0.0,
"Unit": "Bytes"
},
{
"SampleCount": 5.0,
"Timestamp": "2022-10-19T21:42:00Z",
"Sum": 0.0,
"Unit": "Bytes"
}
],
"Label": "DiskWriteBytes"
1158
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Get statistics for metrics
Note that Amazon CloudWatch cannot aggregate data across AWS Regions. Metrics are completely
separate between Regions.
This example shows you how to determine average CPU utilization for all instances that use a specific
Amazon Machine Image (AMI). The average is over 60-second time intervals for a one-day period.
The following is example output. Each value represents an average CPU utilization percentage for the
EC2 instances running the specified AMI.
{
"Datapoints": [
{
"Timestamp": "2022-10-10T07:00:00Z",
"Average": 0.041000000000000009,
"Unit": "Percent"
},
{
"Timestamp": "2022-10-10T14:00:00Z",
"Average": 0.079579831932773085,
"Unit": "Percent"
},
{
"Timestamp": "2022-10-10T06:00:00Z",
"Average": 0.036000000000000011,
"Unit": "Percent"
},
...
],
1159
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Graph metrics
"Label": "CPUUtilization"
}
For more information about the metrics and the data they provide to the graphs, see List the available
CloudWatch metrics for your instances (p. 1139).
You can also use the CloudWatch console to graph metric data generated by Amazon EC2 and other AWS
services. For more information, see Graphing metrics in the Amazon CloudWatch User Guide.
For examples, see Creating Amazon CloudWatch Alarms in the Amazon CloudWatch User Guide.
1160
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
7. For Alarm thresholds, select the metric and criteria for the alarm. For example, you can leave the
default settings for Group samples by (Average) and Type of data to sample (CPU utilization).
For Alarm when, choose >= and enter 0.80. For Consecutive period, enter 1. For Period, select 5
minutes.
8. (Optional) For Sample metric data, choose Add to dashboard.
9. Choose Create.
You can edit your CloudWatch alarm settings from the Amazon EC2 console or the CloudWatch console.
If you want to delete your alarm, you can do so from the CloudWatch console. For more information, see
Editing or deleting a CloudWatch alarm in the Amazon CloudWatch User Guide.
There are a number of scenarios in which you might want to automatically stop or terminate your
instance. For example, you might have instances dedicated to batch payroll processing jobs or scientific
computing tasks that run for a period of time and then complete their work. Rather than letting those
instances sit idle (and accrue charges), you can stop or terminate them, which can help you to save
money. The main difference between using the stop and the terminate alarm actions is that you can
easily start a stopped instance if you need to run it again later, and you can keep the same instance
ID and root volume. However, you cannot start a terminated instance. Instead, you must launch a new
instance. When an instance is stopped or terminated, data on instance store volumes is lost.
You can add the stop, terminate, reboot, or recover actions to any alarm that is set on an Amazon EC2
per-instance metric, including basic and detailed monitoring metrics provided by Amazon CloudWatch
(in the AWS/EC2 namespace), as well as any custom metrics that include the InstanceId dimension, as
long as its value refers to a valid running Amazon EC2 instance.
Console support
You can create alarms using the Amazon EC2 console or the CloudWatch console. The procedures in
this documentation use the Amazon EC2 console. For procedures that use the CloudWatch console, see
Create alarms that stop, terminate, reboot, or recover an instance in the Amazon CloudWatch User Guide.
Permissions
You must have the iam:CreateServiceLinkedRole to create or modify an alarm that performs EC2
alarm actions. A service role is an IAM role that a service assumes to perform actions on your behalf. An
IAM administrator can create, modify, and delete a service role from within IAM. For more information,
see Creating a role to delegate permissions to an AWS service in the IAM User Guide.
Contents
• Add stop actions to Amazon CloudWatch alarms (p. 1162)
• Add terminate actions to Amazon CloudWatch alarms (p. 1162)
• Add reboot actions to Amazon CloudWatch alarms (p. 1163)
• Add recover actions to Amazon CloudWatch alarms (p. 1164)
1161
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
• Use the Amazon CloudWatch console to view alarm and action history (p. 1165)
• Amazon CloudWatch alarm action scenarios (p. 1166)
Instances that use an Amazon EBS volume as the root device can be stopped or terminated, whereas
instances that use the instance store as the root device can only be terminated. Data on instance store
volumes is lost when the instance is terminated or stopped.
Alternatively, you can choose the plus sign ( ) in the Alarm status column.
4. On the Manage CloudWatch alarms page, do the following:
1162
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
If you might want to use the instance later, you should stop the instance instead of terminating it. Data
on instance store volumes is lost when the instance is terminated. For information about enabling and
disabling termination protection for an instance, see Enable termination protection (p. 602).
Alternatively, you can choose the plus sign ( ) in the Alarm status column.
4. On the Manage CloudWatch alarms page, do the following:
Rebooting an instance doesn't start a new instance billing period (with a minimum one-minute charge),
unlike stopping and restarting your instance. Data on instance store volumes is retained when the
instance is rebooted. The instance store volumes must be re-mounted into the filesystem after a reboot.
For more information, see Reboot your instance (p. 597).
Important
To avoid a race condition between the reboot and recover actions, avoid setting the same
number of evaluation periods for a reboot alarm and a recover alarm. We recommend that you
set reboot alarms to three evaluation periods of one minute each. For more information, see
Evaluating an alarm in the Amazon CloudWatch User Guide.
1163
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
To create an alarm to reboot an instance (Amazon EC2 console)
Alternatively, you can choose the plus sign ( ) in the Alarm status column.
4. On the Manage CloudWatch alarms page, do the following:
CloudWatch prevents you from adding a recovery action to an alarm that is on an instance which does
not support recovery actions.
When the StatusCheckFailed_System alarm is triggered, and the recover action is initiated, you are
notified by the Amazon SNS topic that you chose when you created the alarm and associated the recover
action. During instance recovery, the instance is migrated during an instance reboot, and any data that
is in-memory is lost. When the process is complete, information is published to the SNS topic you've
configured for the alarm. Anyone who is subscribed to this SNS topic receives an email notification that
includes the status of the recovery attempt and any further instructions. You notice an instance reboot
on the recovered instance.
Note
The recover action can be used only with StatusCheckFailed_System, not with
StatusCheckFailed_Instance.
1164
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
The recover action is supported only on instances that meet certain characteristics. For more
information, see Recover your instance.
If your instance has a public IP address, it retains the public IP address after recovery.
Important
To avoid a race condition between the reboot and recover actions, avoid setting the same
number of evaluation periods for a reboot alarm and a recover alarm. We recommend that you
set recover alarms to two evaluation periods of one minute each. For more information, see
Evaluating an alarm in the Amazon CloudWatch User Guide.
Alternatively, you can choose the plus sign ( ) in the Alarm status column.
4. On the Manage CloudWatch alarms page, do the following:
1165
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
Amazon CloudWatch alarm action scenarios
You can use the Amazon EC2 console to create alarm actions that stop or terminate an Amazon EC2
instance when certain conditions are met. In the following screen capture of the console page where you
set the alarm actions, we've numbered the settings. We've also numbered the settings in the scenarios
that follow, to help you create the appropriate actions.
New console
1166
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
Old console
Setting Value
1 Stop
2 Maximum
3 CPU Utilization
4 <=
5 10%
6 1
7 1 Hour
Setting Value
2 Average
3 CPU Utilization
4 <=
5 5%
1167
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create alarms that stop, terminate,
reboot, or recover an instance
Setting Value
6 24
7 1 Hour
Scenario 3: Send email about web servers with unusually high traffic
Create an alarm that sends email when an instance exceeds 10 GB of outbound network traffic per day.
Setting Value
1 Email
2 Sum
3 Network Out
4 >
5 10 GB
6 24
7 1 Hour
Setting Value
2 Sum
3 Network Out
4 >
5 1 GB
6 1
7 1 Hour
Setting Value
1 Stop
1168
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Automate using EventBridge
Setting Value
2 Average
4 -
5 -
6 1
7 15 Minutes
Setting Value
1 Terminate
2 Maximum
3 Network Out
4 <=
5 100,000 bytes
6 1
7 5 Minutes
The following are examples of how you can use EventBridge with Amazon EC2:
1169
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon EC2 event types
• Notify an Amazon SNS topic when an Amazon EBS volume is created or modified.
• Send a command to one or more Amazon EC2 instances using Amazon EC2 Run Command whenever a
certain event in another AWS service occurs.
For information about the event types supported by Amazon EBS, see the section called “EBS
EventBridge events” (p. 1794).
To learn more about CloudTrail, see the AWS CloudTrail User Guide.
1170
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon EC2 and Amazon EBS information in CloudTrail
For an ongoing record of events in your AWS account, including events for Amazon EC2 and Amazon
EBS, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default,
when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from
all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify.
Additionally, you can configure other AWS services to further analyze and act upon the event data
collected in CloudTrail logs. For more information, see:
All Amazon EC2 actions, and Amazon EBS management actions, are logged by CloudTrail and
are documented in the Amazon EC2 API Reference. For example, calls to the RunInstances,
DescribeInstances, or CreateImage actions generate entries in the CloudTrail log files.
Every event or log entry contains information about who generated the request. The identity
information helps you determine the following:
• Whether the request was made with root user or IAM user credentials.
• Whether the request was made with temporary security credentials for a role or federated user.
• Whether the request was made by another AWS service.
The following log file record shows that a user terminated an instance.
{
"Records":[
{
"eventVersion":"1.03",
"userIdentity":{
"type":"Root",
"principalId":"123456789012",
"arn":"arn:aws:iam::123456789012:root",
1171
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Audit users that connect via EC2 Instance Connect
"accountId":"123456789012",
"accessKeyId":"AKIAIOSFODNN7EXAMPLE",
"userName":"user"
},
"eventTime":"2016-05-20T08:27:45Z",
"eventSource":"ec2.amazonaws.com",
"eventName":"TerminateInstances",
"awsRegion":"us-west-2",
"sourceIPAddress":"198.51.100.1",
"userAgent":"aws-cli/1.10.10 Python/2.7.9 Windows/7botocore/1.4.1",
"requestParameters":{
"instancesSet":{
"items":[{
"instanceId":"i-1a2b3c4d"
}]
}
},
"responseElements":{
"instancesSet":{
"items":[{
"instanceId":"i-1a2b3c4d",
"currentState":{
"code":32,
"name":"shutting-down"
},
"previousState":{
"code":16,
"name":"running"
}
}]
}
},
"requestID":"be112233-1ba5-4ae0-8e2b-1c302EXAMPLE",
"eventID":"6e12345-2a4e-417c-aa78-7594fEXAMPLE",
"eventType":"AwsApiCall",
"recipientAccountId":"123456789012"
}
]
}
To audit SSH activity via EC2 Instance Connect using the AWS CloudTrail console
1172
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor your .NET and SQL Server applications
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "ABCDEFGONGNOMOOCB6XYTQEXAMPLE",
"arn": "arn:aws:iam::1234567890120:user/IAM-friendly-name",
"accountId": "123456789012",
"accessKeyId": "ABCDEFGUKZHNAW4OSN2AEXAMPLE",
"userName": "IAM-friendly-name",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2018-09-21T21:37:58Z"}
}
},
"eventTime": "2018-09-21T21:38:00Z",
"eventSource": "ec2-instance-connect.amazonaws.com",
"eventName": "SendSSHPublicKey ",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.456.789.012",
"userAgent": "aws-cli/1.15.61 Python/2.7.10 Darwin/16.7.0 botocore/1.10.60",
"requestParameters": {
"instanceId": "i-0123456789EXAMPLE",
"osUser": "ec2-user",
"SSHKey": {
"publicKey": "ssh-rsa ABCDEFGHIJKLMNO01234567890EXAMPLE"
}
},
"responseElements": null,
"requestID": "1a2s3d4f-bde6-11e8-a892-f7ec64543add",
"eventID": "1a2w3d4r5-a88f-4e28-b3bf-30161f75be34",
"eventType": "AwsApiCall",
"recipientAccountId": "0987654321"
}
If you have configured your AWS account to collect CloudTrail events in an S3 bucket, you can
download and audit the information programmatically. For more information, see Getting and
viewing your CloudTrail log files in the AWS CloudTrail User Guide.
To view a complete list of supported logs and metrics, see Logs and Metrics Supported by Amazon
CloudWatch Application Insights.
1173
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor your .NET and SQL Server applications
Feedback
You can provide feedback on automatically generated insights on detected problems by designating
them useful or not useful. Your feedback on the insights, along with your application diagnostics (metric
anomalies and log exceptions), are used to improve the future detection of similar problems.
For more information, see the CloudWatch Application Insights documentation in the Amazon
CloudWatch User Guide.
1174
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regions and Zones
You can control whether the instance receives a public IP address from Amazon's pool of public IP
addresses. The public IP address of an instance is associated with your instance only until it is stopped
or terminated. If you require a persistent public IP address, you can allocate an Elastic IP address for
your AWS account and associate it with an instance or a network interface. An Elastic IP address remains
associated with your AWS account until you release it, and you can move it from one instance to another
as needed. You can bring your own IP address range to your AWS account, where it appears as an address
pool, and then allocate Elastic IP addresses from your address pool.
To increase network performance and reduce latency, you can launch instances in a placement group.
You can get significantly higher packet per second (PPS) performance using enhanced networking. You
can accelerate high performance computing and machine learning applications using an Elastic Fabric
Adapter (EFA), which is a network device that you can attach to a supported instance type.
Features
• Regions and Zones (p. 1175)
• Amazon EC2 instance IP addressing (p. 1189)
• Amazon EC2 instance hostname types (p. 1204)
• Bring your own IP addresses (BYOIP) in Amazon EC2 (p. 1208)
• Assigning prefixes to Amazon EC2 network interfaces (p. 1222)
• Elastic IP addresses (p. 1233)
• Elastic network interfaces (p. 1245)
• Amazon EC2 instance network bandwidth (p. 1276)
• Enhanced networking on Windows (p. 1278)
• Placement groups (p. 1302)
• Network maximum transmission unit (MTU) for your EC2 instance (p. 1319)
• Virtual private clouds (p. 1323)
• Ports and Protocols for Windows Amazon Machine Images (AMIs) (p. 1325)
• EC2-Classic (p. 1369)
1175
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regions
• Local Zones provide you the ability to place resources, such as compute and storage, in multiple
locations closer to your end users.
• AWS Outposts brings native AWS services, infrastructure, and operating models to virtually any data
center, co-location space, or on-premises facility.
• Wavelength Zones allow developers to build applications that deliver ultra-low latencies to 5G devices
and end users. Wavelength deploys standard AWS compute and storage services to the edge of
telecommunication carriers' 5G networks.
AWS operates state-of-the-art, highly available data centers. Although rare, failures can occur that affect
the availability of instances that are in the same location. If you host all of your instances in a single
location that is affected by a failure, none of your instances would be available.
To help you determine which deployment is best for you, see AWS Wavelength FAQs.
Contents
• Regions (p. 1176)
• Availability Zones (p. 1180)
• Local Zones (p. 1184)
• Wavelength Zones (p. 1186)
• AWS Outposts (p. 1188)
Regions
Each Region is designed to be isolated from the other Regions. This achieves the greatest possible fault
tolerance and stability.
When you view your resources, you see only the resources that are tied to the Region that you specified.
This is because Regions are isolated from each other, and we don't automatically replicate resources
across Regions.
When you launch an instance, you must select an AMI that's in the same Region. If the AMI is in another
Region, you can copy the AMI to the Region you're using. For more information, see Copy an AMI (p. 158).
Note that there is a charge for data transfer between Regions. For more information, see Amazon EC2
Pricing - Data Transfer.
Contents
• Available Regions (p. 1176)
• Regions and endpoints (p. 1178)
• Describe your Regions (p. 1178)
• Get the Region name (p. 1179)
• Specify the Region for a resource (p. 1179)
Available Regions
Your account determines the Regions that are available to you.
• An AWS account provides multiple Regions so that you can launch Amazon EC2 instances in locations
that meet your requirements. For example, you might want to launch instances in Europe to be closer
to your European customers or to meet legal requirements.
• An AWS GovCloud (US-West) account provides access to the AWS GovCloud (US-West) Region and the
AWS GovCloud (US-East) Region. For more information, see AWS GovCloud (US).
1176
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regions
• An Amazon AWS (China) account provides access to the Beijing and Ningxia Regions only. For more
information, see Amazon Web Services in China.
The following table lists the Regions provided by an AWS account. You can't describe or access additional
Regions from an AWS account, such as the AWS GovCloud (US) Regions or the China Regions. To use
a Region introduced after March 20, 2019, you must enable the Region. For more information, see
Managing AWS Regions in the AWS General Reference.
1177
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regions
The number and mapping of Availability Zones per Region may vary between AWS accounts To list
the Availability Zones that are available to your account, you can use the Amazon EC2 console or the
command line interface. For more information, see Describe your Regions (p. 1178).
For more information about endpoints and protocols in AWS GovCloud (US-West), see Service Endpoints
in the AWS GovCloud (US) User Guide.
3. Your EC2 resources for this Region are displayed on the EC2 Dashboard in the Resources section.
1178
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regions
Use the describe-regions command as follows to describe the Regions that are enabled for your account.
To describe all Regions, including any Regions that are disabled for your account, add the --all-
regions option as follows.
Use the get-regions command as follows to describe the name of the specified Region.
Ohio
Considerations
Some AWS resources might not be available in all Regions. Ensure that you can create the resources that
you need in the desired Regions before you launch an instance.
1179
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Availability Zones
You can set the value of an environment variable to the desired Regional endpoint (for example,
https://ec2.us-east-2.amazonaws.com):
Alternatively, you can use the --region (AWS CLI) or -Region (AWS Tools for Windows PowerShell)
command line option with each individual command. For example, --region us-east-2.
For more information about the endpoints for Amazon EC2, see Service endpoints in the AWS General
Reference.
Availability Zones
Each Region has multiple, isolated locations known as Availability Zones. The code for Availability Zone is
its Region code followed by a letter identifier. For example, us-east-1a.
When you launch an instance, you select a Region and a virtual private cloud (VPC), and then you can
either select a subnet from one of the Availability Zones or let us choose one for you. If you distribute
your instances across multiple Availability Zones and one instance fails, you can design your application
so that an instance in another Availability Zone can handle requests. You can also use Elastic IP addresses
to mask the failure of an instance in one Availability Zone by rapidly remapping the address to an
instance in another Availability Zone.
The following diagram illustrates multiple Availability Zones in an AWS Region. Availability Zone A and
Availability Zone B each have one subnet, and each subnet has instances. Availability Zone C has no
subnets, therefore you can't launch instances into this Availability Zone.
1180
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Availability Zones
As Availability Zones grow over time, our ability to expand them can become constrained. If this
happens, we might restrict you from launching an instance in a constrained Availability Zone unless you
already have an instance in that Availability Zone. Eventually, we might also remove the constrained
Availability Zone from the list of Availability Zones for new accounts. Therefore, your account might have
a different number of available Availability Zones in a Region than another account.
Contents
• AZ IDs (p. 1182)
• Describe your Availability Zones (p. 1182)
• Launch instances in an Availability Zone (p. 1183)
• Migrate an instance to another Availability Zone (p. 1183)
1181
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Availability Zones
AZ IDs
To ensure that resources are distributed across the Availability Zones for a Region, we independently
map Availability Zones to codes for each AWS account. For example, the Availability Zone us-east-1a
for your AWS account might not be the same physical location as us-east-1a for another AWS account.
To coordinate Availability Zones across accounts, you must use the AZ ID, which is a unique and
consistent identifier for an Availability Zone. For example, use1-az1 is an AZ ID for the us-east-1
Region and it has the same physical location in every AWS account. You can view the AZ IDs for your
account to determine the physical location of your resources relative to the resources in another account.
For example, if you share a subnet in the Availability Zone with the AZ ID use1-az2 with another
account, this subnet is available to that account in the Availability Zone whose AZ ID is also use1-az2.
The following diagram illustrates two accounts with different mappings of Availability Zone code to AZ
ID.
• Use the describe-availability-zones command as follows to describe the Availability Zones within the
specified Region that are enabled for your account.
1182
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Availability Zones
• Use the describe-availability-zones command as follows to describe the Availability Zones regardless
of the opt-in status.
When you launch an instance, you can optionally specify an Availability Zone in the Region that you
are using. If you do not specify an Availability Zone, we select an Availability Zone for you. When you
launch your initial instances, we recommend that you accept the default Availability Zone, because this
allows us to select the best Availability Zone for you based on system health and available capacity. If
you launch additional instances, specify an Availability Zone only if your new instances must be close to,
or separated from, your running instances.
1. Create an AMI from the instance. The procedure depends on your operating system and the type of
root device volume for the instance. For more information, see the documentation that corresponds
to your operating system and root device volume:
1183
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Local Zones
5. If the original instance is a Reserved Instance, change the Availability Zone for your reservation. (If
you also changed the instance type, you can also change the instance type for your reservation.) For
more information, see Submit modification requests (p. 372).
6. (Optional) Terminate the original instance. For more information, see Terminate an instance (p. 602).
Local Zones
A Local Zone is an extension of an AWS Region in geographic proximity to your users. Local Zones have
their own connections to the internet and support AWS Direct Connect, so that resources created in a
Local Zone can serve local users with low-latency communications. For more information, see AWS Local
Zones.
The code for a Local Zone is its Region code followed by an identifier that indicates its physical location.
For example, us-west-2-lax-1 in Los Angeles.
The following diagram illustrates the AWS Region us-west-2, two of its Availability Zones, and two of
its Local Zones. The VPC spans the Availability Zones and one of the Local Zones. Each zone in the VPC
has one subnet, and each subnet has an instance.
To use a Local Zone, you must first enable it. For more information, see the section called “Opt in to
Local Zones” (p. 1185). Next, create a subnet in the Local Zone. Finally, launch resources in the Local
Zone subnet, such as instances, so that your applications are close to your users.
Contents
• Available Local Zones (p. 1185)
• Opt in to Local Zones (p. 1185)
• Launch instances in a Local Zone (p. 1185)
1184
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Local Zones
Use the describe-availability-zones command as follows to describe all Local Zones in the specified
Region, even if they are not enabled. To describe only the Local Zones that you've enabled, omit the --
all-availability-zones option.
Consideration
Some AWS resources might not be available in all Regions. Make sure that you can create the resources
that you need in the desired Regions or Local Zones before launching an instance in a specific Local Zone.
For a list of services supported in each Local Zone see AWS Local Zones Features.
1185
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Wavelength Zones
You can allocate the following IP addresses from a network border group:
For more information about how to launch an instance in a Local Zone, see Getting started with AWS
Local Zones in the AWS Local Zones User Guide.
Wavelength Zones
AWS Wavelength enables developers to build applications that deliver ultra-low latencies to mobile
devices and end users. Wavelength deploys standard AWS compute and storage services to the edge of
telecommunication carriers' 5G networks. Developers can extend a virtual private cloud (VPC) to one or
more Wavelength Zones, and then use AWS resources like Amazon EC2 instances to run applications that
require ultra-low latency and a connection to AWS services in the Region.
A Wavelength Zone is an isolated zone in the carrier location where the Wavelength infrastructure is
deployed. Wavelength Zones are tied to a Region. A Wavelength Zone is a logical extension of a Region,
and is managed by the control plane in the Region.
The code for a Wavelength Zone is its Region code followed by an identifier that indicates the physical
location. For example, us-east-1-wl1-bos-wlz-1 in Boston.
The following diagram illustrates the AWS Region us-west-2, two of its Availability Zones, and a
Wavelength Zone. The VPC spans the Availability Zones and the Wavelength Zone. Each zone in the VPC
has one subnet, and each subnet has an instance.
To use a Wavelength Zone, you must first opt in to the Zone. For more information, see the section called
“Enable Wavelength Zones” (p. 1187). Next, create a subnet in the Wavelength Zone. Finally, launch your
resources in the Wavelength Zones subnet, so that your applications are closer to your end users.
Wavelength Zones are not available in every Region. For information about the Regions that support
Wavelength Zones, see Available Wavelength Zones in the AWS Wavelength Developer Guide.
Contents
1186
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Wavelength Zones
• Use the describe-availability-zones command as follows to describe the Wavelength Zones within the
specified Region that are enabled for your account.
• Use the describe-availability-zones command as follows to describe the Wavelength Zones regardless
of the opt-in status.
Considerations
• Some AWS resources are not available in all Regions. Make sure that you can create the resources
that you need in the desired Region or Wavelength Zone before launching an instance in a specific
Wavelength Zone.
1187
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS Outposts
For information about how to launch an instance in a Wavelength Zone, see Get started with AWS
Wavelength in the AWS Wavelength Developer Guide.
AWS Outposts
AWS Outposts is a fully managed service that extends AWS infrastructure, services, APIs, and tools to
customer premises. By providing local access to AWS managed infrastructure, AWS Outposts enables
customers to build and run applications on premises using the same programming interfaces as in AWS
Regions, while using local compute and storage resources for lower latency and local data processing
needs.
An Outpost is a pool of AWS compute and storage capacity deployed at a customer site. AWS operates,
monitors, and manages this capacity as part of an AWS Region. You can create subnets on your Outpost
and specify them when you create AWS resources. Instances in Outpost subnets communicate with other
instances in the AWS Region using private IP addresses, all within the same VPC.
The following diagram illustrates the AWS Region us-west-2, two of its Availability Zones, and an
Outpost. The VPC spans the Availability Zones and the Outpost. The Outpost is in an on-premises
customer data center. Each zone in the VPC has one subnet, and each subnet has an instance.
To begin using AWS Outposts, you must create an Outpost and order Outpost capacity. For more
information about Outposts configurations, see our catalog. After your Outpost equipment is installed,
1188
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance IP addressing
the compute and storage capacity is available for you when you launch Amazon EC2 instances on your
Outpost.
The root volume for an instance on an Outpost rack must be 30 GB or smaller. You can specify data
volumes in the block device mapping of the AMI or the instance to provide additional storage. To trim
unused blocks from the boot volume, see How to Build Sparse EBS Volumes in the AWS Partner Network
Blog.
We recommend that you increase the NVMe timeout for the root volume. For more information, see I/O
operation timeout (p. 1751).
For information about how to create an Outpost, see Get started with AWS Outposts in the AWS
Outposts User Guide.
The following create-volume command creates an empty 50 GB volume on the specified Outpost.
You can dynamically modify the size of your Amazon EBS gp2 volumes without detaching them. For
more information about modifying a volume without detaching it, see Request modifications to your EBS
volumes (p. 1722).
Contents
• Private IPv4 addresses (p. 1190)
• Public IPv4 addresses (p. 1190)
• Elastic IP addresses (IPv4) (p. 1191)
• IPv6 addresses (p. 1191)
• Work with the IPv4 addresses for your instances (p. 1192)
• Work with the IPv6 addresses for your instances (p. 1194)
• Multiple IP addresses (p. 1196)
• EC2 instance hostnames (p. 1204)
1189
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Private IPv4 addresses
• IPv4-only subnets: You can only create resources in these subnets with IPv4 addresses assigned to
them.
• IPv6-only subnets: You can only create resources in these subnets with IPv6 addresses assigned to
them.
• IPv4 and IPv6 subnets: You can create resources in these subnets with either IPv4 or IPv6 addresses
assigned to them.
When you launch an EC2 instance into an IPv4-only or dual stack (IPv4 and IPv6) subnet, the instance
receives a primary private IP address from the IPv4 address range of the subnet. For more information,
see IP addressing in the Amazon VPC User Guide. If you don't specify a primary private IP address when
you launch the instance, we select an available IP address in the subnet's IPv4 range for you. Each
instance has a default network interface (eth0) that is assigned the primary private IPv4 address. You can
also specify additional private IPv4 addresses, known as secondary private IPv4 addresses. Unlike primary
private IP addresses, secondary private IP addresses can be reassigned from one instance to another. For
more information, see Multiple IP addresses (p. 1196).
A private IPv4 address, regardless of whether it is a primary or secondary address, remains associated
with the network interface when the instance is stopped and started, or hibernated and started, and is
released when the instance is terminated.
When you launch an instance in a default VPC, we assign it a public IP address by default. When you
launch an instance into a nondefault VPC, the subnet has an attribute that determines whether instances
launched into that subnet receive a public IP address from the public IPv4 address pool. By default, we
don't assign a public IP address to instances launched in a nondefault subnet.
You can control whether your instance receives a public IP address as follows:
• Modifying the public IP addressing attribute of your subnet. For more information, see Modify the
public IPv4 addressing attribute for your subnet in the Amazon VPC User Guide.
• Enabling or disabling the public IP addressing feature during launch, which overrides the subnet's
public IP addressing attribute. For more information, see Assign a public IPv4 address during instance
launch (p. 1193).
A public IP address is assigned to your instance from Amazon's pool of public IPv4 addresses, and is not
associated with your AWS account. When a public IP address is disassociated from your instance, it is
released back into the public IPv4 address pool, and you cannot reuse it.
1190
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic IP addresses (IPv4)
You cannot manually associate or disassociate a public IP (IPv4) address from your instance. Instead, in
certain cases, we release the public IP address from your instance, or assign it a new one:
• We release your instance's public IP address when it is stopped, hibernated, or terminated. Your
stopped or hibernated instance receives a new public IP address when it is started.
• We release your instance's public IP address when you associate an Elastic IP address with it. When you
disassociate the Elastic IP address from your instance, it receives a new public IP address.
• If the public IP address of your instance in a VPC has been released, it will not receive a new one if
there is more than one network interface attached to your instance.
• If your instance's public IP address is released while it has a secondary private IP address that is
associated with an Elastic IP address, the instance does not receive a new public IP address.
If you require a persistent public IP address that can be associated to and from instances as you require,
use an Elastic IP address instead.
If you use dynamic DNS to map an existing DNS name to a new instance's public IP address, it might take
up to 24 hours for the IP address to propagate through the Internet. As a result, new instances might
not receive traffic while terminated instances continue to receive requests. To solve this problem, use an
Elastic IP address. You can allocate your own Elastic IP address, and associate it with your instance. For
more information, see Elastic IP addresses (p. 1233).
Note
Instances that access other instances through their public NAT IP address are charged for
regional or Internet data transfer, depending on whether the instances are in the same Region.
IPv6 addresses
You can optionally associate an IPv6 CIDR block with your VPC and associate IPv6 CIDR blocks with
your subnets. The IPv6 CIDR block for your VPC is automatically assigned from Amazon's pool of IPv6
addresses; you cannot choose the range yourself. For more information, see the following topics in the
Amazon VPC User Guide:
IPv6 addresses are globally unique and can be configured to remain private or reachable over the
Internet. Your instance receives an IPv6 address if an IPv6 CIDR block is associated with your VPC and
subnet, and if one of the following is true:
• Your subnet is configured to automatically assign an IPv6 address to an instance during launch. For
more information, see Modify the IPv6 addressing attribute for your subnet.
• You assign an IPv6 address to your instance during launch.
• You assign an IPv6 address to the primary network interface of your instance after launch.
1191
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with the IPv4 addresses for your instances
• You assign an IPv6 address to a network interface in the same subnet, and attach the network
interface to your instance after launch.
When your instance receives an IPv6 address during launch, the address is associated with the primary
network interface (eth0) of the instance. You can disassociate the IPv6 address from the network
interface.
An IPv6 address persists when you stop and start, or hibernate and start, your instance, and is released
when you terminate your instance. You cannot reassign an IPv6 address while it's assigned to another
network interface—you must first unassign it.
You can assign additional IPv6 addresses to your instance by assigning them to a network interface
attached to your instance. The number of IPv6 addresses you can assign to a network interface and
the number of network interfaces you can attach to an instance varies per instance type. For more
information, see IP addresses per network interface per instance type (p. 1247).
Contents
• View the IPv4 addresses (p. 1192)
• Assign a public IPv4 address during instance launch (p. 1193)
The public IPv4 address is displayed as a property of the network interface in the console, but it's
mapped to the primary private IPv4 address through NAT. Therefore, if you inspect the properties of your
network interface on your instance, for example, through ifconfig (Linux) or ipconfig (Windows), the
public IPv4 address is not displayed. To determine your instance's public IPv4 address from an instance,
use instance metadata.
• Public IPv4 address — The public IPv4 address. If you associated an Elastic IP address with the
instance or the primary network interface, this is the Elastic IP address.
• Private IPv4 addresses — The private IPv4 address.
• Secondary private IPv4 addresses — Any secondary private IPv4 addresses.
4. Alternatively, under Network interfaces on the Networking tab, choose the interface ID for the
primary network interface (for example, eni-123abc456def78901). The following information is
available:
1192
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with the IPv4 addresses for your instances
• Public IPv4 address — The public IPv4 address. If you associated an Elastic IP address with the
instance or the primary network interface, this is the Elastic IP address.
• Secondary private IPv4 addresses — Any secondary private IPv4 addresses.
To view the IPv4 addresses for an instance using the command line
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1. Connect to your instance. For more information, see Connect to your Windows instance (p. 610).
2. Use the following command to access the private IP address:
If an Elastic IP address is associated with the instance, the value returned is that of the Elastic IP
address.
Considerations
• You can't manually disassociate the public IP address from your instance after launch. Instead, it's
automatically released in certain cases, after which you cannot reuse it. For more information, see
Public IPv4 addresses (p. 1190). If you require a persistent public IP address that you can associate
or disassociate at will, assign an Elastic IP address to the instance after launch instead. For more
information, see Elastic IP addresses (p. 1233).
• You cannot auto-assign a public IP address if you specify more than one network interface.
Additionally, you cannot override the subnet setting using the auto-assign public IP feature if you
specify an existing network interface for eth0.
• The public IP addressing feature is only available during launch. However, whether you assign a public
IP address to your instance during launch or not, you can associate an Elastic IP address with your
instance after it's launched. For more information, see Elastic IP addresses (p. 1233). You can also
modify your subnet's public IPv4 addressing behavior. For more information, see Modify the public
IPv4 addressing attribute for your subnet.
To assign a public IPv4 address during instance launch using the console
1193
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with the IPv6 addresses for your instances
Follow the procedure to launch an instance (p. 541), and when you configure Network Settings (p. 543),
choose the option to Auto-assign Public IP.
To enable or disable the public IP addressing feature using the command line
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
Contents
• View the IPv6 addresses (p. 1194)
• Assign an IPv6 address to an instance (p. 1195)
• Unassign an IPv6 address from an instance (p. 1195)
To view the IPv6 addresses for an instance using the command line
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1. Connect to your instance. For more information, see Connect to your Windows instance (p. 610).
2. Use the following command to view the IPv6 address (you can get the MAC address from
http://169.254.169.254/latest/meta-data/network/interfaces/macs/).
1194
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with the IPv6 addresses for your instances
Follow the procedure to launch an instance (p. 541), and when you configure Network Settings (p. 543),
choose the option to Auto-assign IPv6 IP.
• Use the --ipv6-addresses option with the run-instances command (AWS CLI)
• Use the Ipv6Addresses property for -NetworkInterface in the New-EC2Instance command (AWS
Tools for Windows PowerShell)
• assign-ipv6-addresses (AWS CLI)
• Register-EC2Ipv6AddressList (AWS Tools for Windows PowerShell)
1195
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
Multiple IP addresses
You can specify multiple private IPv4 and IPv6 addresses for your instances. The number of network
interfaces and private IPv4 and IPv6 addresses that you can specify for an instance depends on the
instance type. For more information, see IP addresses per network interface per instance type (p. 1247).
It can be useful to assign multiple IP addresses to an instance in your VPC to do the following:
• Host multiple websites on a single server by using multiple SSL certificates on a single server and
associating each certificate with a specific IP address.
• Operate network appliances, such as firewalls or load balancers, that have multiple IP addresses for
each network interface.
• Redirect internal traffic to a standby instance in case your instance fails, by reassigning the secondary
IP address to the standby instance.
Contents
• How multiple IP addresses work (p. 1196)
• Work with multiple IPv4 addresses (p. 1197)
• Work with multiple IPv6 addresses (p. 1200)
• You can assign a secondary private IPv4 address to any network interface.
• You can assign multiple IPv6 addresses to a network interface that's in a subnet that has an associated
IPv6 CIDR block.
• You must choose a secondary IPv4 address from the IPv4 CIDR block range of the subnet for the
network interface.
• You must choose IPv6 addresses from the IPv6 CIDR block range of the subnet for the network
interface.
• You associate security groups with network interfaces, not individual IP addresses. Therefore, each IP
address you specify in a network interface is subject to the security group of its network interface.
• Multiple IP addresses can be assigned and unassigned to network interfaces attached to running or
stopped instances.
• Secondary private IPv4 addresses that are assigned to a network interface can be reassigned to
another one if you explicitly allow it.
• An IPv6 address cannot be reassigned to another network interface; you must first unassign the IPv6
address from the existing network interface.
• When assigning multiple IP addresses to a network interface using the command line tools or API, the
entire operation fails if one of the IP addresses can't be assigned.
• Primary private IPv4 addresses, secondary private IPv4 addresses, Elastic IP addresses, and IPv6
addresses remain with a secondary network interface when it is detached from an instance or attached
to an instance.
• Although you can't detach the primary network interface from an instance, you can reassign the
secondary private IPv4 address of the primary network interface to another network interface.
1196
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
The following list explains how multiple IP addresses work with Elastic IP addresses (IPv4 only):
• Each private IPv4 address can be associated with a single Elastic IP address, and vice versa.
• When a secondary private IPv4 address is reassigned to another interface, the secondary private IPv4
address retains its association with an Elastic IP address.
• When a secondary private IPv4 address is unassigned from an interface, an associated Elastic IP
address is automatically disassociated from the secondary private IPv4 address.
Tasks
• Assign a secondary private IPv4 address (p. 1197)
• Configure the operating system on your instance to recognize secondary private IPv4
addresses (p. 1199)
• Associate an Elastic IP address with the secondary private IPv4 address (p. 1199)
• View your secondary private IPv4 addresses (p. 1199)
• Unassign a secondary private IPv4 address (p. 1200)
• To assign a secondary private IPv4 address when launching an instance (p. 1197)
• To assign a secondary IPv4 address during launch using the command line (p. 1198)
• To assign a secondary private IPv4 address to a network interface (p. 1198)
• To assign a secondary private IPv4 to an existing instance using the command line (p. 1199)
New console
1. Follow the procedure to launch an instance (p. 541), and when you configure Network
Settings (p. 543), choose Advanced network configuration.
2. Under Secondary IP, choose Automatically assign to have Amazon automatically assign a
secondary IPv4 address or choose Manually assign to manually enter a CIDR.
3. Complete the remaining steps to launch the instance (p. 541).
Old console
1197
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
5. In the Network Interfaces section, do the following, and then choose Next: Add Storage:
• To add another network interface, choose Add Device. The console enables you to specify
up to two network interfaces when you launch an instance. After you launch the instance,
choose Network Interfaces in the navigation pane to add additional network interfaces. The
total number of network interfaces that you can attach varies by instance type. For more
information, see IP addresses per network interface per instance type (p. 1247).
Important
When you add a second network interface, the system can no longer auto-assign
a public IPv4 address. You will not be able to connect to the instance over IPv4
unless you assign an Elastic IP address to the primary network interface (eth0). You
can assign the Elastic IP address after you complete the Launch wizard. For more
information, see Work with Elastic IP addresses (p. 1234).
• For each network interface, under Secondary IP addresses, choose Add IP, and then enter
a private IP address from the subnet range, or accept the default Auto-assign value to let
Amazon select an address.
6. On the next Add Storage page, you can specify volumes to attach to the instance besides the
volumes specified by the AMI (such as the root device volume), and then choose Next: Add Tags.
7. On the Add Tags page, specify tags for the instance, such as a user-friendly name, and then
choose Next: Configure Security Group.
8. On the Configure Security Group page, select an existing security group or create a new one.
Choose Review and Launch.
9. On the Review Instance Launch page, review your settings, and then choose Launch to choose
a key pair and launch your instance. If you're new to Amazon EC2 and haven't created any key
pairs, the wizard prompts you to create one.
Important
After you have added a secondary private IP address to a network interface, you must
connect to the instance and configure the secondary private IP address on the instance
itself. For more information, see Configure the operating system on your instance to
recognize secondary private IPv4 addresses (p. 1199).
To assign a secondary IPv4 address during launch using the command line
• You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
1198
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
Alternatively, you can assign a secondary private IPv4 address to an instance. Choose Instances in the
navigation pane, select the instance, and then choose Actions, Networking, Manage IP addresses. You
can configure the same information as you did in the steps above. The IP address is assigned to the
primary network interface (eth0) for the instance.
To assign a secondary private IPv4 to an existing instance using the command line
• You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
For information about configuring a Windows instance, see Configure a secondary private IPv4 address
for your Windows instance (p. 805).
To associate an Elastic IP address with a secondary private IPv4 address using the command
line
• You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
1199
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
4. On the Details tab in the details pane, check the Primary private IPv4 IP and Secondary private
IPv4 IPs fields for the primary private IPv4 address and any secondary private IPv4 addresses
assigned to the network interface.
• You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
Contents
1200
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
New console
1. Follow the procedure to launch an instance (p. 541), and when you configure Network
Settings (p. 543), choose Advanced network configuration.
2. To assign a secondary IPv6 address, under IPv6 IPs, choose Automatically assign to have
Amazon automatically assign a secondary IPv6 address or choose Manually assign to manually
enter a CIDR.
3. Complete the remaining steps to launch the instance (p. 541).
Old console
• To assign a single IPv6 address to the primary network interface (eth0), under IPv6 IPs,
choose Add IP. To add a secondary IPv6 address, choose Add IP again. You can enter an IPv6
address from the range of the subnet, or leave the default Auto-assign value to let Amazon
choose an IPv6 address from the subnet for you.
• Choose Add Device to add another network interface and repeat the steps above to add
one or more IPv6 addresses to the network interface. The console enables you to specify
up to two network interfaces when you launch an instance. After you launch the instance,
choose Network Interfaces in the navigation pane to add additional network interfaces. The
total number of network interfaces that you can attach varies by instance type. For more
information, see IP addresses per network interface per instance type (p. 1247).
6. Follow the next steps in the wizard to attach volumes and tag your instance.
7. On the Configure Security Group page, select an existing security group or create a new one. If
you want your instance to be reachable over IPv6, ensure that your security group has rules that
allow access from IPv6 addresses. For more information, see Security group rules for different
use cases (p. 1501). Choose Review and Launch.
8. On the Review Instance Launch page, review your settings, and then choose Launch to choose
a key pair and launch your instance. If you're new to Amazon EC2 and haven't created any key
pairs, the wizard prompts you to create one.
1201
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
You can use the Instances screen Amazon EC2 console to assign multiple IPv6 addresses to an existing
instance. This assigns the IPv6 addresses to the primary network interface (eth0) for the instance. To
assign a specific IPv6 address to the instance, ensure that the IPv6 address is not already assigned to
another instance or network interface.
Alternatively, you can assign multiple IPv6 addresses to an existing network interface. The network
interface must have been created in a subnet that has an associated IPv6 CIDR block. To assign a specific
IPv6 address to the network interface, ensure that the IPv6 address is not already assigned to another
network interface.
CLI overview
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1202
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multiple IP addresses
CLI overview
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
CLI overview
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1203
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2 instance hostnames
The hostname distinguishes the EC2 instances on your network. You may use the hostname of an
instance if, for example, you want to run scripts to communicate with some or all of the instances on
your network.
Contents
• Types of EC2 hostnames (p. 1204)
• Where you see Resource name and IP name (p. 1205)
• How to decide whether to choose Resource name or IP name (p. 1206)
• Modify Hostname type and DNS Hostname configurations (p. 1207)
• IP name: The legacy naming scheme where, when you launch an instance, the private IPv4 address
of the instance is included in the hostname of the instance. The IP name exists for the life of the EC2
instance. When used as the Private DNS hostname, it will only return the private IPv4 address (A
record).
• Resource name: When you launch an instance, the EC2 instance ID is included in the hostname of
the instance. The resource name exists for the life of the EC2 instance. When used as the Private
DNS hostname, it can return both the private IPv4 address (A record) and/or the IPv6 Global Unicast
Address (AAAA record).
The EC2 instance guest OS hostname type depends on the subnet settings:
• If the instance is launched into an IPv4-only subnet, you can select either IP name or resource name.
• If the instance is launched into a dual-stack (IPv4+IPv6) subnet, you can select either IP name or
resource name.
• If the instance is launched into an IPv6-only subnet, resource name is used automatically.
Contents
• IP name (p. 1205)
• Resource name (p. 1205)
• The difference between IP name and Resource name (p. 1205)
1204
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Where you see Resource name and IP name
IP name
When you launch an EC2 instance with the Hostname type of IP name, the guest OS hostname is
configured to use the private IPv4 address.
Resource name
When you launch EC2 instances in IPv6-only subnets, the Hostname type of Resource name is
selected by default. When you launch an instance in IPv4-only or dual-stack (IPv4+IPv6) subnets,
Resource name is an option that you can select. After you launch an instance, you can manage the
hostname configuration. For more information, see Modify Hostname type and DNS Hostname
configurations (p. 1207).
When you launch an EC2 instance with a Hostname type of Resource name, the guest OS hostname is
configured to use the EC2 instance ID.
Contents
• When creating an EC2 instance (p. 1205)
• When viewing the details of an existing EC2 instance (p. 1206)
1205
Amazon Elastic Compute Cloud
User Guide for Windows Instances
How to decide whether to choose
Resource name or IP name
Scenario 1
You create an EC2 instance in the wizard (see Launch an instance using the new launch instance
wizard (p. 539)) and, when you configure the details, you choose a subnet that you configured to be
IPv6-only.
In this case, the Hostname type of Resource name is selected automatically and is not modifiable. DNS
Hostname options of Enable IP name IPv4 (A record) DNS requests and Enable resource-based IPv4
(A record) DNS requests are deselected automatically and are not modifiable. Enable resource-based
IPv6 (AAAA record) DNS requests is selected by default but is modifiable. If selected, DNS requests to
the resource name will resolve to the IPv6 address (AAAA record) of this EC2 instance.
Scenario 2
You create an EC2 instance in the wizard (see Launch an instance using the new launch instance
wizard (p. 539)) and, when you configure the details, you choose a subnet configured with an IPv4 CIDR
block or both an IPv4 and IPv6 CIDR block ("dual stack").
In this case, Enable IP name IPv4 (A record) DNS requests is selected automatically and can't be
changed. This means that requests to the IP name will resolve to the IPv4 address (A record) of this EC2
instance.
The options default to the configurations of the subnet, but you can modify the options for this instance
depending on the subnet settings:
• Hostname type: Determines whether you want the guest OS hostname of the EC2 instance to be the
resource name or IP name. The default value is IP name.
• Enable resource-based IPv4 (A record) DNS requests: Determines whether requests to your resource
name resolve to the private IPv4 address (A record) of this EC2 instance. This option is not selected by
default.
• Enable resource-based IPv6 (AAAA record) DNS requests: Determines whether requests to your
resource name resolve to the IPv6 GUA address (AAAA record) of this EC2 instance. This option is not
selected by default.
In addition, if you connect to your EC2 instance directly over SSH and enter the hostname command,
you'll see the hostname in either the IP name or resource name format.
1206
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Modify Hostname type and DNS Hostname configurations
a hostname in the resource name format. In such cases, the DNS record for this EC2 instance can also
point to the resource name. This gives you the flexibility to choose whether that hostname resolves
to the IPv4 address, the IPv6 address, or both the IPv4 and IPv6 address of the instance. If you plan to
use IPv6 in the future or if you are using dual-stack subnets today, it’s best to use a Hostname type of
Resource name so that you change DNS resolution for the hostnames of your instances without making
any changes to the DNS records themselves. The resource name allows you to add and remove IPv4 and
IPv6 DNS resolution on an EC2 instance.
If instead you choose a Hostname type of IP name, and use it as the DNS hostname, it can only resolve
to the IPv4 address of the instance. It will not resolve to the IPv6 address of the instance even if the
instance has both an IPv4 address and an IPv6 address associated with it.
Contents
• Subnets (p. 1207)
• EC2 instances (p. 1207)
Subnets
Modify the configurations for a subnet by selecting a subnet in the VPC console and choosing Actions,
Edit subnet settings.
Note
Changing the subnet settings doesn't change the configuration of EC2 instances that are already
launched in the subnet.
• Hostname type: Determines whether you want the default setting of the guest OS hostname of the
EC2 instance launched in the subnet to be the resource name or IP name.
• Enable DNS hostname IPv4 (A record) requests: Determines whether DNS requests/queries to your
resource name resolve to the private IPv4 address (A record) of this EC2 instance.
• Enable DNS hostname IPv6 (AAAA record) requests: Determines whether DNS requests/queries to
your resource name resolve to the IPv6 address (AAAA record) of this EC2 instance.
EC2 instances
Follow the steps in this section to modify the Hostname type and DNS Hostname configurations for an
EC2 instance.
Important
• To change the Use resource based naming as guest OS hostname setting, you must first stop
the instance. To change the Answer DNS hostname IPv4 (A record) request or Answer DNS
hostname IPv6 (AAAA record) requests settings, you don't have to stop the instance.
• To modify any of the settings for non-EBS backed EC2 instance types, you cannot stop
the instance. You must terminate the instance and launch a new instance with the desired
Hostname type and DNS Hostname configurations.
1207
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Bring your own IP addresses
To modify the Hostname type and DNS Hostname configurations for an EC2 instance
To stop the instance, select the instance and choose Instance state, Stop instance.
3. Select the instance and choose Actions, Instance settings, Change resource based naming options.
• Use resource based naming as guest OS hostname: Determines whether you want the guest OS
hostname of the EC2 instance to be the resource name or IP name.
• Answer DNS hostname IPv4 (A record) requests: Determines whether DNS requests/queries to
your resource name resolve to the private IPv4 address of this EC2 instance.
• Answer DNS hostname IPv6 (AAAA record) requests: Determines whether DNS requests/queries
to your resource name resolve to the IPv6 address (AAAA record) of this EC2 instance.
4. Choose Save.
5. If you stopped the instance, start it again.
For a list of Regions where BYOIP is available, see Regional availability (p. 1222).
Note
• The steps on this page describe how to bring your own IP address range for use in Amazon
EC2 only.
• To bring your own IP address range for use in AWS Global Accelerator, see Bring your own IP
addresses (BYOIP) in the AWS Global Accelerator Developer Guide.
• To bring your own IP address range for use with Amazon VPC IP Address Manager, see
Tutorial: Bring your IP addresses to IPAM in the Amazon VPC IPAM User Guide.
Contents
• BYOIP definitions (p. 1209)
• Requirements and quotas (p. 1209)
• Onboarding prerequisites for your BYOIP address range (p. 1210)
• Onboard your BYOIP (p. 1215)
• Work with your address range (p. 1218)
• Validate your BYOIP (p. 1219)
• Regional availability (p. 1222)
• Learn more (p. 1222)
1208
Amazon Elastic Compute Cloud
User Guide for Windows Instances
BYOIP definitions
BYOIP definitions
• X.509 Self-sign certificate — A certificate standard most commonly used to encrypt and authenticate
data within a network. It is a certificate used by AWS to validate control over IP space from an RDAP
record. For more information about X.509 certificates, see RFC 3280.
• Registry Data Access Protocol (RDAP) — A querying resource for registration data. It is updated by
customers and used by AWS to verify control of an address space in the Regional Internet Registries
(RIR).
• Route Origin Authorization (ROA) — An object created by RIRs for customers to authenticate IP
advertisement in particular autonomous systems. For an overview, see Route Origin Authorizations
(ROAs) on the ARIN website.
• Local Internet Registry (LIR) — Organizations such as internet service providers that allocate a block
of IP addresses from a RIR for their customers.
1209
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboarding prerequisites
Preparation phase
1. Create an RSA key pair (p. 1211), and use it to generate a self-signed X.509 certificate for
authentication purposes. This certificate is only used during the provisioning phase.
2. Upload the self-signed certificate (p. 1214) to your RDAP record comments.
3. Create a ROA object (p. 1214) in your RIR. The ROA defines the desired address range, the
Autonomous System Numbers (ASNs) allowed to advertise the address range, and an expiration date to
register with the Resource Public Key Infrastructure (RPKI) of your RIR.
Note
A ROA is not required for non-publicly advertised IPv6 address space.
1210
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboarding prerequisites
To bring on multiple non-contiguous address ranges, you must repeat this process with each address
range. However, the preparation and RIR configuration steps don't need to be repeated if splitting a
contiguous block across several different Regions.
Bringing on an address range has no effect on any address ranges that you brought on previously.
Before onboarding your address range, complete the following prerequisites. For some tasks, you
run Linux commands. On Windows, you can use the Windows Subsystem for Linux to run the Linux
commands.
Copy the following commands and replace only the placeholder values (in colored italic text).
This procedure follows the best practice of encrypting your private RSA key and requiring a passphrase
to access it.
The -aes256 parameter specifies the algorithm used to encrypt the private key. The command
returns the following output, including prompts to set a passphrase:
......+++
.+++
Enter PEM pass phrase: xxxxxxx
Verifying - Enter PEM pass phrase: xxxxxxx
This returns a passphrase prompt and the contents of the key, which should be similar to the
following:
1211
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboarding prerequisites
v6V3CzMKDkmRr1NrONnSz5QsndQ04Z6ihAQlPmJ96g4wKtgoC7AYpyP0g1a+4/sj
b1+o3YQI4pD/F71c+qaztH7PRwKBgQDdc23yNmT3+Jyptf0fKjEvONK+xwUKzi9c
L/OzBq5yOIC1Pz2T85gOe1i8kwZws+xlpG6uBT6lmIJELd0k59FyupNu4dPvX5SD
6GGqdx4jk9KvI74usGeOBohmF0phTHkrWKBxXiyT0oS8zjnJlEn8ysIpGgO28jjr
LpaHNZ/MXQKBgQDfLNcnS0LzpsS2aK0tzyZU8SMyqVHOGMxj7quhneBq2T6FbiLD
T9TVlYaGNZ0j71vQaLI19qOubWymbautH0Op5KV8owdf4+bf1/NJaPIOzhDUSIjD
Qo01WW31Z9XDSRhKFTnWzmCjBdeIcajyzf10YKsycaAW9lItu8aBrMndnQKBgQDb
nNp/JyRwqjOrNljk7DHEs+SD39kHQzzCfqd+dnTPv2sc06+cpym3yulQcbokULpy
fmRo3bin/pvJQ3aZX/Bdh9woTXqhXDdrrSwWInVYMQPyPk8f/D9mIOJp5FUWMwHD
U+whIZSxsEeE+jtixlWtheKRYkQmzQZXbWdIhYyI3QKBgD+F/6wcZ85QW8nAUykA
3WrSIx/3cwDGdm4NRGct8ZOZjTHjiy9ojMOD1L7iMhRQ/3k3hUsin5LDMp/ryWGG
x4uIaLat40kiC7T4I66DM7P59euqdz3w0PD+VU+h7GSivvsFDdySUt7bNK0AUVLh
dMJfWxDN8QV0b5p3WuWH1U8B
-----END PRIVATE KEY-----
Private-Key: (2048 bit)
modulus:
00:c5:05:71:d1:23:81:d5:28:08:61:de:c7:a2:72:
2a:28:8b:30:91:4d:b2:5e:d7:e6:2c:c4:d4:e3:6b:
85:f2:2b:2a:55:18:81:56:0c:68:59:b3:8e:05:08:
79:4f:38:e4:95:27:e3:6a:3f:be:30:f7:aa:0c:ec:
33:d2:df:1a:3d:91:a4:32:64:11:67:d9:81:29:d8:
40:6a:e6:f7:f7:d3:b2:87:35:19:99:65:49:a4:9f:
4c:c7:39:21:29:36:66:36:7c:cc:48:48:1c:5e:c2:
5c:51:14:09:e2:c2:64:9d:ff:c4:c3:bc:72:4c:63:
d1:6f:00:8b:d6:b9:3b:2f:e6:5d:2d:24:a9:3e:6b:
dd:4a:e3:eb:4e:dd:47:43:47:b4:a7:a3:95:97:13:
17:ec:06:b5:b7:83:5c:9d:a3:74:c1:b3:1f:22:e7:
f6:22:54:e7:0d:02:9c:bb:81:ed:bf:16:2c:18:dd:
a0:97:24:1e:ab:ea:7b:85:e8:7f:26:46:02:38:af:
8b:e4:31:1b:0e:94:08:49:0e:76:4f:35:ec:1e:6e:
8a:3e:2b:74:37:97:06:e0:6e:63:8a:0f:fc:fd:b2:
f9:3c:37:ff:a1:51:30:6d:21:7d:1f:46:d6:c6:f8:
f2:c8:c3:7c:56:44:71:ab:31:29:f6:07:3b:0f:56:
e0:cb
publicExponent: 65537 (0x10001)
privateExponent:
0a:22:54:8f:68:5f:26:42:af:e3:b0:dc:dd:eb:37:
65:ec:7a:ec:0e:6e:0d:58:d7:9b:17:e8:c7:65:e1:
76:ea:67:7c:07:0d:a8:0a:6d:57:a7:d7:b7:44:8f:
50:d6:e1:53:16:c1:28:d6:ec:86:82:46:b9:f1:70:
5c:f9:62:d5:25:e7:a7:3b:e4:75:4e:07:c9:ca:38:
ce:06:e1:5c:5b:04:44:d6:23:61:f3:86:cd:33:f0:
74:12:e9:34:c0:7a:93:74:e9:e1:11:ec:7b:a7:4d:
ae:51:f4:8c:38:69:8a:82:fc:71:01:01:74:12:72:
54:5e:57:d3:0c:a6:11:b9:95:98:2d:23:80:7f:cc:
c6:c0:40:3d:65:ba:64:a8:9c:83:d5:0b:32:55:a2:
01:9d:cc:44:06:4f:8c:71:e0:a5:89:00:02:c5:16:
28:06:c2:07:05:50:71:58:c6:3b:9f:56:8d:f6:63:
cd:35:f9:a5:0b:55:54:7e:bc:ae:e7:22:1f:cf:03:
4d:90:b0:8c:29:23:06:1c:60:f8:e2:24:24:12:c4:
e7:09:21:f3:68:c8:1d:28:af:67:ad:df:97:02:f0:
cf:e1:34:f8:78:44:2d:26:49:ae:7d:8c:63:a2:71:
9a:29:37:a8:d3:54:38:5f:d9:fb:79:ac:76:3d:a5:
b9
prime1:
00:e3:c2:50:bf:de:3c:69:f3:32:72:e8:ff:28:25:
02:af:ed:37:6f:33:05:23:e1:54:96:38:76:41:1c:
bb:f8:7a:f2:5a:6a:26:b4:b9:08:c8:a3:55:03:6b:
c0:18:8a:da:a1:5f:53:66:08:27:a1:18:7f:32:b9:
78:ff:bf:a5:77:0b:33:0a:0e:49:91:af:53:6b:38:
d9:d2:cf:94:2c:9d:d4:34:e1:9e:a2:84:04:25:3e:
62:7d:ea:0e:30:2a:d8:28:0b:b0:18:a7:23:f4:83:
56:be:e3:fb:23:6f:5f:a8:dd:84:08:e2:90:ff:17:
bd:5c:fa:a6:b3:b4:7e:cf:47
prime2:
00:dd:73:6d:f2:36:64:f7:f8:9c:a9:b5:fd:1f:2a:
1212
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboarding prerequisites
31:2f:38:d2:be:c7:05:0a:ce:2f:5c:2f:f3:b3:06:
ae:72:38:80:b5:3f:3d:93:f3:98:0e:7b:58:bc:93:
06:70:b3:ec:65:a4:6e:ae:05:3e:a5:98:82:44:2d:
dd:24:e7:d1:72:ba:93:6e:e1:d3:ef:5f:94:83:e8:
61:aa:77:1e:23:93:d2:af:23:be:2e:b0:67:8e:06:
88:66:17:4a:61:4c:79:2b:58:a0:71:5e:2c:93:d2:
84:bc:ce:39:c9:94:49:fc:ca:c2:29:1a:03:b6:f2:
38:eb:2e:96:87:35:9f:cc:5d
exponent1:
00:df:2c:d7:27:4b:42:f3:a6:c4:b6:68:ad:2d:cf:
26:54:f1:23:32:a9:51:ce:18:cc:63:ee:ab:a1:9d:
e0:6a:d9:3e:85:6e:22:c3:4f:d4:d5:95:86:86:35:
9d:23:ef:5b:d0:68:b2:35:f6:a3:ae:6d:6c:a6:6d:
ab:ad:1f:43:a9:e4:a5:7c:a3:07:5f:e3:e6:df:d7:
f3:49:68:f2:0e:ce:10:d4:48:88:c3:42:8d:35:59:
6d:f5:67:d5:c3:49:18:4a:15:39:d6:ce:60:a3:05:
d7:88:71:a8:f2:cd:fd:74:60:ab:32:71:a0:16:f6:
52:2d:bb:c6:81:ac:c9:dd:9d
exponent2:
00:db:9c:da:7f:27:24:70:aa:33:ab:36:58:e4:ec:
31:c4:b3:e4:83:df:d9:07:43:3c:c2:7e:a7:7e:76:
74:cf:bf:6b:1c:d3:af:9c:a7:29:b7:ca:e9:50:71:
ba:24:50:ba:72:7e:64:68:dd:b8:a7:fe:9b:c9:43:
76:99:5f:f0:5d:87:dc:28:4d:7a:a1:5c:37:6b:ad:
2c:16:22:75:58:31:03:f2:3e:4f:1f:fc:3f:66:20:
e2:69:e4:55:16:33:01:c3:53:ec:21:21:94:b1:b0:
47:84:fa:3b:62:c6:55:ad:85:e2:91:62:44:26:cd:
06:57:6d:67:48:85:8c:88:dd
coefficient:
3f:85:ff:ac:1c:67:ce:50:5b:c9:c0:53:29:00:dd:
6a:d2:23:1f:f7:73:00:c6:76:6e:0d:44:67:2d:f1:
93:99:8d:31:e3:8b:2f:68:8c:c3:83:d4:be:e2:32:
14:50:ff:79:37:85:4b:22:9f:92:c3:32:9f:eb:c9:
61:86:c7:8b:88:68:b6:ad:e3:49:22:0b:b4:f8:23:
ae:83:33:b3:f9:f5:eb:aa:77:3d:f0:d0:f0:fe:55:
4f:a1:ec:64:a2:be:fb:05:0d:dc:92:52:de:db:34:
ad:00:51:52:e1:74:c2:5f:5b:10:cd:f1:05:74:6f:
9a:77:5a:e5:87:d5:4f:01
$ cat public-key.pem
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxQVx0SOB1SgIYd7HonIq
KIswkU2yXtfmLMTU42uF8isqVRiBVgxoWbOOBQh5TzjklSfjaj++MPeqDOwz0t8a
PZGkMmQRZ9mBKdhAaub399OyhzUZmWVJpJ9MxzkhKTZmNnzMSEgcXsJcURQJ4sJk
nf/Ew7xyTGPRbwCL1rk7L+ZdLSSpPmvdSuPrTt1HQ0e0p6OVlxMX7Aa1t4NcnaN0
wbMfIuf2IlTnDQKcu4HtvxYsGN2glyQeq+p7heh/JkYCOK+L5DEbDpQISQ52TzXs
Hm6KPit0N5cG4G5jig/8/bL5PDf/oVEwbSF9H0bWxvjyyMN8VkRxqzEp9gc7D1bg
ywIDAQAB
-----END PUBLIC KEY-----
3. Generate an X.509 certificate using the key pair created in the previous. In this example, the
certificate expires in 365 days, after which time it cannot be trusted. Be sure to set the expiration
appropriately. The tr -d "\n" command strips newline characters (line breaks) from the output.
You need to provide a Common Name when prompted, but the other fields can be left blank.
1213
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboarding prerequisites
$ openssl req -new -x509 -key private-key.pem -days 365 | tr -d "\n" > certificate.pem
Note
The Common Name is not needed for AWS provisioning. It can be any internal or public
domain name.
$ cat certificate.pem
The output should be a long, PEM-encoded string without line breaks, prefaced by -----BEGIN
CERTIFICATE----- and followed by -----END CERTIFICATE-----.
• For ARIN, add the certificate in the "Public Comments" section for your address range. Do not add it to
the comments section for your organization.
• For RIPE, add the certificate as a new "descr" field for your address range. Do not add it to the
comments section for your organization.
• For APNIC, email the certificate to [email protected] to manually add it to the "remarks" field for
your address range. Send the email using the APNIC authorized contact for the IP addresses.
You can remove the certificate from your RIR's record after the provisioning stage below has been
completed.
1214
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboard your BYOIP
that you can bring is /48 for CIDRs that are publicly advertised and /56 for CIDRs that are not publicly
advertised.
Important
If you are creating a ROA object for Amazon VPC IP Address Manager (IPAM), when you create
the ROAs, for IPv4 CIDRs you must set the maximum length of an IP address prefix to /24.
For IPv6 CIDRs, if you are adding them to an advertisable pool, the maximum length of an IP
address prefix must be /48. This ensures that you have full flexibility to divide your public IP
address across AWS Regions. IPAM enforces the maximum length you set. For more information
about BYOIP addresses to IPAM, see Tutorial: BYOIP address CIDRs to IPAM in the Amazon VPC
IPAM User Guide.
It might take up to 24 hours for the ROA to become available to Amazon. For more information, consult
your RIR:
When you migrate advertisements from an on-premises workload to AWS, you must create a ROA for
your existing ASN before creating the ROAs for Amazon's ASNs. Otherwise, you might see an impact to
your existing routing and advertisements.
Note
This step is not required for non-publicly advertised IPv6 address space.
Topics
• Provision a publicly advertised address range in AWS (p. 1215)
• Provision an IPv6 address range that's not publicly advertised (p. 1216)
• Advertise the address range through AWS (p. 1217)
• Deprovision the address range (p. 1217)
1. Compose message
Compose the plaintext authorization message. The format of the message is as follows, where the
date is the expiry date of the message:
1|aws|account|cidr|YYYYMMDD|SHA256|RSAPSS
1215
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboard your BYOIP
Replace the account number, address range, and expiry date with your own values to create a
message resembling the following:
text_message="1|aws|0123456789AB|198.51.100.0/24|20211231|SHA256|RSAPSS"
This is not to be confused with a ROA message, which has a similar appearance.
2. Sign message
Sign the plaintext message using the private key that you created previously. The signature returned
by this command is a long string that you need to use in the next step.
Important
We recommend that you copy and paste this command. Except for the message content, do
not modify or replace any of the values.
3. Provision address
Use the AWS CLI provision-byoip-cidr command to provision the address range. The --cidr-
authorization-context option uses the message and signature strings that you created
previously.
Important
You must specify the AWS Region where the BYOIP range should be provisioned if it differs
from your AWS CLI configuration Default region name.
It can take up to one week to complete the provisioning process for publicly advertisable ranges. Use
the describe-byoip-cidrs command to monitor progress, as in this example:
If there are issues during provisioning and the status goes to failed-provision, you must run the
provision-byoip-cidr command again after the issues have been resolved.
1216
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Onboard your BYOIP
Important
• You can only specify whether an address range is publicly advertised during provisioning. You
cannot change the advertisable status later on.
• Amazon VPC doesn't support unique local address (ULA) CIDRs. All VPCs must have unique
IPv6 CIDRs. Two VPCs can’t have the same IPv6 CIDR range.
To provision an IPv6 address range that will not be publicly advertised, use the following provision-
byoip-cidr command.
If you provisioned an IPv6 address range that will not be publicly advertised, you do not need to
complete this step.
We recommend that you stop advertising the address range from other locations before you advertise
it through AWS. If you keep advertising your IP address range from other locations, we can't reliably
support it or troubleshoot issues. Specifically, we can't guarantee that traffic to the address range will
enter our network.
To minimize down time, you can configure your AWS resources to use an address from your address
pool before it is advertised, and then simultaneously stop advertising it from the current location and
start advertising it through AWS. For more information about allocating an Elastic IP address from your
address pool, see Allocate an Elastic IP address (p. 1235).
Limitations
• You can run the advertise-byoip-cidr command at most once every 10 seconds, even if you specify
different address ranges each time.
• You can run the withdraw-byoip-cidr command at most once every 10 seconds, even if you specify
different address ranges each time.
To stop advertising the address range, use the following withdraw-byoip-cidr command.
You cannot deprovision a portion of the address range. If you want to use a more specific address range
with AWS, deprovision the entire address range and provision a more specific address range.
1217
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with your address range
(IPv4) To release each Elastic IP address, use the following release-address command.
(IPv6) To disassociate an IPv6 CIDR block, use the following disassociate-vpc-cidr-block command.
To stop advertising the address range, use the following withdraw-byoip-cidr command.
To view information about the IPv4 address pools that you've provisioned in your account, use the
following describe-public-ipv4-pools command.
To create an Elastic IP address from your IPv4 address pool, use the allocate-address command. You can
use the --public-ipv4-pool option to specify the ID of the address pool returned by describe-
byoip-cidrs. Or you can use the --address option to specify an address from the address range that
you provisioned.
To create a VPC and specify an IPv6 CIDR from your IPv6 address pool, use the following create-vpc
command. To let Amazon choose the IPv6 CIDR from your IPv6 address pool, omit the --ipv6-cidr-
block option.
To associate an IPv6 CIDR block from your IPv6 address pool with a VPC, use the following associate-
vpc-cidr-block command. To let Amazon choose the IPv6 CIDR from your IPv6 address pool, omit the --
ipv6-cidr-block option.
1218
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Validate your BYOIP
To view your VPCs and the associated IPv6 address pool information, use the describe-vpcs command. To
view information about associated IPv6 CIDR blocks from a specific IPv6 address pool, use the following
get-associated-ipv6-pool-cidrs command.
If you disassociate the IPv6 CIDR block from your VPC, it's released back into your IPv6 address pool.
Validate that the certificate has been uploaded and is valid via the whois command.
You can inspect the Public Comments containing the certificate using the following command:
This returns output with the contents of the key, which should be similar to the following:
Public Comments:
-----BEGIN CERTIFICATE-----
MIID1zCCAr+gAwIBAgIUBkRPNSLrPqbRAFP8RDAHSP+I1TowDQYJKoZIhvcNAQE
LBQAwezELMAkGA1UEBhMCTloxETAPBgNVBAgMCEF1Y2tsYW5kMREwDwYDVQQHDA
hBdWNrbGFuZDEcMBoGA1UECgwTQW1hem9uIFdlYiBTZXJ2aWNlczETMBEGA1UEC
wwKQllPSVAgRGVtbzETMBEGA1UEAwwKQllPSVAgRGVtbzAeFw0yMTEyMDcyMDI0
NTRaFw0yMjEyMDcyMDI0NTRaMHsxCzAJBgNVBAYTAk5aMREwDwYDVQQIDAhBdWN
rbGFuZDERMA8GA1UEBwwIQXVja2xhbmQxHDAaBgNVBAoME0FtYXpvbiBXZWIgU2
VydmljZXMxEzARBgNVBAsMCkJZT0lQIERlbW8xEzARBgNVBAMMCkJZT0lQIERlb
W8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfmacvDp0wZ0ceiXXc
R/q27mHI/U5HKt7SST4X2eAqufR9wXkfNanAEskgAseyFypwEEQr4CJijI/5hp9
prh+jsWHWwkFRoBRR9FBtwcU/45XDXLga7D3stsI5QesHVRwOaXUdprAnndaTug
mDPkD0vrl475JWDSIm+PUxGWLy+60aBqiaZq35wU/x+wXlAqBXg4MZK2KoUu27k
Yt2zhmy0S7Ky+oRfRJ9QbAiSu/RwhQbh5Mkp1ZnVIc7NqnhdeIW48QaYjhMlUEf
xdaqYUinzz8KpjfADZ4Hvqj9jWZ/eXo/9b2rGlHWkJsbhr0VEUyAGu1bwkgcdww
3A7NjOxQbAgMBAAGjUzBRMB0GA1UdDgQWBBStFyujN6SYBr2glHpGt0XGF7GbGT
AfBgNVHSMEGDAWgBStFyujN6SYBr2glHpGt0XGF7GbGTAPBgNVHRMBAf8EBTADA
QH/MA0GCSqGSIb3DQEBCwUAA4IBAQBX6nn6YLhz521lfyVfxY0t6o3410bQAeAF
08ud+ICtmQ4IO4A4B7zV3zIVYr0clrOOaFyLxngwMYN0XY5tVhDQqk4/gmDNEKS
Zy2QkX4Eg0YUWVzOyt6fPzjOvJLcsqc1hcF9wySL507XQz76Uk5cFypBOzbnk35
UkWrzA9KK97cXckfIESgK/k1N4ecwxwG6VQ8mBGqVpPpey+dXpzzzv1iBKN/VY4
ydjgH/LBfdTsVarmmy2vtWBxwrqkFvpdhSGCvRDl/qdO/GIDJi77dmZWkh/ic90
MNk1f38gs1jrCj8lThoar17Uo9y/Q5qJIsoNPyQrJRzqFU9F3FBjiPJF
-----END CERTIFICATE-----
For RIPE, use whois -r -h whois.ripe.net 2001:0DB8:7269::/48 to look up the RDAP record
for your address range. Check the descr section for the inetnum object (network range) in the
command output. The certificate should be added as a new descr field for the address range.
You can inspect the descr containing the certificate using the following command:
1219
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Validate your BYOIP
This returns output with the contents of the key, which should be similar to the following:
descr:
-----BEGIN CERTIFICATE-----MIID1zCCAr+gAwIBAgIUBkRPNSLrPqbRAFP8
RDAHSP+I1TowDQYJKoZIhvcNAQELBQAwezELMAkGA1UEBhMCTloxETAPBgNVBAg
MCEF1Y2tsYW5kMREwDwYDVQQHDAhBdWNrbGFuZDEcMBoGA1UECgwTQW1hem9uIF
dlYiBTZXJ2aWNlczETMBEGA1UECwwKQllPSVAgRGVtbzETMBEGA1UEAwwKQllPS
VAgRGVtbzAeFw0yMTEyMDcyMDI0NTRaFw0yMjEyMDcyMDI0NTRaMHsxCzAJBgNV
BAYTAk5aMREwDwYDVQQIDAhBdWNrbGFuZDERMA8GA1UEBwwIQXVja2xhbmQxHDA
aBgNVBAoME0FtYXpvbiBXZWIgU2VydmljZXMxEzARBgNVBAsMCkJZT0lQIERlbW
8xEzARBgNVBAMMCkJZT0lQIERlbW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwg
gEKAoIBAQCfmacvDp0wZ0ceiXXcR/q27mHI/U5HKt7SST4X2eAqufR9wXkfNanA
EskgAseyFypwEEQr4CJijI/5hp9prh+jsWHWwkFRoBRR9FBtwcU/45XDXLga7D3
stsI5QesHVRwOaXUdprAnndaTugmDPkD0vrl475JWDSIm+PUxGWLy+60aBqiaZq
35wU/x+wXlAqBXg4MZK2KoUu27kYt2zhmy0S7Ky+oRfRJ9QbAiSu/RwhQbh5Mkp
1ZnVIc7NqnhdeIW48QaYjhMlUEfxdaqYUinzz8KpjfADZ4Hvqj9jWZ/eXo/9b2r
GlHWkJsbhr0VEUyAGu1bwkgcdww3A7NjOxQbAgMBAAGjUzBRMB0GA1UdDgQWBBS
tFyujN6SYBr2glHpGt0XGF7GbGTAfBgNVHSMEGDAWgBStFyujN6SYBr2glHpGt0
XGF7GbGTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBX6nn6Y
Lhz521lfyVfxY0t6o3410bQAeAF08ud+ICtmQ4IO4A4B7zV3zIVYr0clrOOaFyL
xngwMYN0XY5tVhDQqk4/gmDNEKSZy2QkX4Eg0YUWVzOyt6fPzjOvJLcsqc1hcF9
wySL507XQz76Uk5cFypBOzbnk35UkWrzA9KK97cXckfIESgK/k1N4ecwxwG6VQ8
mBGqVpPpey+dXpzzzv1iBKN/VY4ydjgH/LBfdTsVarmmy2vtWBxwrqkFvpdhSGC
vRDl/qdO/GIDJi77dmZWkh/ic90MNk1f38gs1jrCj8lThoar17Uo9y/Q5qJIsoN
PyQrJRzqFU9F3FBjiPJF
-----END CERTIFICATE-----
For APNIC, use whois -h whois.apnic.net 2001:0DB8:6170::/48 to look up the RDAP record
for your BYOIP address range. Check the remarks section for the inetnum object (network range) in
the command output. The certificate should be added as a new remarks field for the address range.
You can inspect the remarks containing the certificate using the following command:
This returns output with the contents of the key, which should be similar to the following:
remarks:
-----BEGIN CERTIFICATE-----
MIID1zCCAr+gAwIBAgIUBkRPNSLrPqbRAFP8RDAHSP+I1TowDQYJKoZIhvcNAQE
LBQAwezELMAkGA1UEBhMCTloxETAPBgNVBAgMCEF1Y2tsYW5kMREwDwYDVQQHDA
hBdWNrbGFuZDEcMBoGA1UECgwTQW1hem9uIFdlYiBTZXJ2aWNlczETMBEGA1UEC
wwKQllPSVAgRGVtbzETMBEGA1UEAwwKQllPSVAgRGVtbzAeFw0yMTEyMDcyMDI0
NTRaFw0yMjEyMDcyMDI0NTRaMHsxCzAJBgNVBAYTAk5aMREwDwYDVQQIDAhBdWN
rbGFuZDERMA8GA1UEBwwIQXVja2xhbmQxHDAaBgNVBAoME0FtYXpvbiBXZWIgU2
VydmljZXMxEzARBgNVBAsMCkJZT0lQIERlbW8xEzARBgNVBAMMCkJZT0lQIERlb
W8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfmacvDp0wZ0ceiXXc
R/q27mHI/U5HKt7SST4X2eAqufR9wXkfNanAEskgAseyFypwEEQr4CJijI/5hp9
prh+jsWHWwkFRoBRR9FBtwcU/45XDXLga7D3stsI5QesHVRwOaXUdprAnndaTug
mDPkD0vrl475JWDSIm+PUxGWLy+60aBqiaZq35wU/x+wXlAqBXg4MZK2KoUu27k
Yt2zhmy0S7Ky+oRfRJ9QbAiSu/RwhQbh5Mkp1ZnVIc7NqnhdeIW48QaYjhMlUEf
xdaqYUinzz8KpjfADZ4Hvqj9jWZ/eXo/9b2rGlHWkJsbhr0VEUyAGu1bwkgcdww
3A7NjOxQbAgMBAAGjUzBRMB0GA1UdDgQWBBStFyujN6SYBr2glHpGt0XGF7GbGT
AfBgNVHSMEGDAWgBStFyujN6SYBr2glHpGt0XGF7GbGTAPBgNVHRMBAf8EBTADA
QH/MA0GCSqGSIb3DQEBCwUAA4IBAQBX6nn6YLhz521lfyVfxY0t6o3410bQAeAF
08ud+ICtmQ4IO4A4B7zV3zIVYr0clrOOaFyLxngwMYN0XY5tVhDQqk4/gmDNEKS
Zy2QkX4Eg0YUWVzOyt6fPzjOvJLcsqc1hcF9wySL507XQz76Uk5cFypBOzbnk35
UkWrzA9KK97cXckfIESgK/k1N4ecwxwG6VQ8mBGqVpPpey+dXpzzzv1iBKN/VY4
1220
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Validate your BYOIP
ydjgH/LBfdTsVarmmy2vtWBxwrqkFvpdhSGCvRDl/qdO/GIDJi77dmZWkh/ic90
MNk1f38gs1jrCj8lThoar17Uo9y/Q5qJIsoNPyQrJRzqFU9F3FBjiPJF
-----END CERTIFICATE-----
Validate the successful creation of the ROA objects usingthe RIPEstat Data API. Be sure to test
your address range against the Amazon ASNs 16509 and 14618, plus the ASNs that are currently
authorized to advertise the address range.
You can inspect the ROA objects from different Amazon ASNs with your address range by using the
following command:
In this example output, the response has a result of "status": "valid" for the Amazon ASN
16509. This indicates the ROA object for the address range was created successfully:
{
"messages": [],
"see_also": [],
"version": "0.3",
"data_call_name": "rpki-validation",
"data_call_status": "supported",
"cached": false,
"data": {
"validating_roas": [
{
"origin": "16509",
"prefix": "2001:0DB8::/32",
"max_length": 48,
"validity": "valid"
},
{
"origin": "14618",
"prefix": "2001:0DB8::/32",
"max_length": 48,
"validity": "invalid_asn"
},
{
"origin": "64496",
"prefix": "2001:0DB8::/32",
"max_length": 48,
"validity": "invalid_asn"
}
],
"status": "valid",
"validator": "routinator",
"resource": "16509",
"prefix": "2001:0DB8::/32"
},
"query_id": "20230224152430-81e6384e-21ba-4a86-852a-31850787105f",
"process_time": 58,
"server_id": "app116",
"build_version": "live.2023.2.1.142",
"status": "ok",
"status_code": 200,
"time": "2023-02-24T15:24:30.773654"
}
1221
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Regional availability
A status of “unknown” indicates the ROA object for the address range has not been created. A status of
“invalid_asn” indicates that the ROA object for the address range was not created successfully.
Regional availability
The BYOIP feature is currently available in the Africa (Cape Town), Asia Pacific (Hong-Kong), Asia Pacific
(Hyderabad), Asia Pacific (Jakarta), Asia Pacific (Mumbai), Asia Pacific (Osaka), Asia Pacific (Sydney), Asia
Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Canada (Central), Europe (Dublin), Europe
(Frankfurt), Europe (London), Europe (Milan), Europe (Paris), Europe (Stockholm), Middle East (Bahrain),
Middle East (UAE), South America (Sao Paulo), US West (Northern California), US East (N. Virginia), US
East (Ohio), US West (Oregon), AWS GovCloud (US-West) AWS GovCloud (US-East) Regions.
Learn more
For more information, see the AWS Online Tech talk Deep Dive on Bring Your Own IP.
• Automatic assignment — AWS chooses the prefix from your VPC subnet’s IPv4 or IPv6 CIDR block and
assigns it to your network interface.
• Manual Assignment — You specify the prefix from your VPC subnet’s IPv4 or IPv6 CIDR block, and
AWS verifies that the prefix is not already assigned to other resources before assigning it to your
network interface.
• Increased IP addresses on a network interface — When you use a prefix, you assign a block of IP
addresses as opposed to individual IP addresses. This increases the number of IP addresses for a
network interface.
• Simplified VPC management for containers — In container applications, each container requires a
unique IP address. Assigning prefixes to your instance simplifies the management of your VPCs, as
you can launch and terminate containers without having to call Amazon EC2 APIs for individual IP
assignments.
Topics
• Basics for assigning prefixes (p. 1222)
• Considerations and limits for prefixes (p. 1223)
• Work with prefixes (p. 1223)
1222
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Considerations and limits for prefixes
• To use prefixes, you assign a prefix to your network interface, attach the network interface to your
instance, and then configure your operating system.
• When you choose the option to specify a prefix, the prefix must meet the following requirements:
• The IPv4 prefix that you can specify is /28.
• The IPv6 prefix that you can specify is /80.
• The prefix is in the subnet CIDR of the network interface, and does not overlap with other prefixes or
IP addresses assigned to existing resources in the subnet.
• You can assign a prefix to the primary or secondary network interface.
• You can assign an Elastic IP address to a network interface that has a prefix assigned to it.
• You can also assign an Elastic IP address to the IP address part of the assigned prefix.
• We resolve the private DNS host name of an instance to the primary private IPv4 address.
• We assign each private IPv4 address for a network interface, including those from prefixes, using the
following format:
• us-east-1 Region
ip-private-ipv4-address.ec2.internal
ip-private-ipv4-address.region.compute.internal
• Network interfaces with prefixes are supported with instances built on the Nitro System (p. 210).
• Prefixes for network interfaces are limited to IPv6 addresses and private IPv4 addresses.
• The maximum number of IP addresses that you can assign to a network interface depends on the
instance type. Each prefix that you assign to a network interface counts as one IP address. For
example, a c5.large instance has a limit of 10 IPv4 addresses per network interface. Each network
interface for this instance has a primary IPv4 address. If a network interface has no secondary IPv4
addresses, you can assign up to 9 prefixes to the network interface. For each additional IPv4 address
that you assign to a network interface, you can assign one less prefix to the network interface. For
more information, see IP addresses per network interface per instance type (p. 1247).
• Prefixes are included in source/destination checks.
1223
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
After you have created the network interface, use the attach-network-interface AWS CLI command to
attach the network interface to your instance. You must configure your operating system to work with
network interfaces with prefixes. For more information, see Configure your operating system for network
interfaces with prefixes (p. 1230).
Topics
• Assign automatic prefixes during network interface creation (p. 1224)
• Assign specific prefixes during network interface creation (p. 1226)
Console
a. To automatically assign an IPv4 prefix, for IPv4 prefix delegation, choose Auto-assign.
Then for Number of IPv4 prefixes, specify the number of prefixes to assign.
b. To automatically assign an IPv6 prefix, for IPv6 prefix delegation, choose Auto-assign.
Then for Number of IPv6 prefixes, specify the number of prefixes to assign.
Note
IPv6 prefix delegation appears only if the selected subnet is enabled for IPv6.
5. Select the security groups to associate with the network interface and assign resource tags if
needed.
6. Choose Create network interface.
AWS CLI
Example output
1224
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "IPv4 automatic example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c4EXAMPLE"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:98:65:dd:18:47",
"NetworkInterfaceId": "eni-02b80b4668EXAMPLE",
"OwnerId": "123456789012",
"PrivateIpAddress": "10.0.0.62",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.62"
}
],
"Ipv4Prefixes": [
{
"Ipv4Prefix": "10.0.0.208/28"
}
],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-047cfed18eEXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b21EXAMPLE"
}
}
Example output
{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "IPv6 automatic example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c4EXAMPLE"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:bb:e4:31:fe:09",
"NetworkInterfaceId": "eni-006edbcfa4EXAMPLE",
"OwnerId": "123456789012",
1225
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
"PrivateIpAddress": "10.0.0.73",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.73"
}
],
"Ipv6Prefixes": [
{
"Ipv6Prefix": "2600:1f13:fc2:a700:1768::/80"
}
],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-047cfed18eEXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b21EXAMPLE"
}
}
Console
a. To assign a specific IPv4 prefix, for IPv4 prefix delegation, choose Custom. Then choose
Add new prefix and enter the prefix to use.
b. To assign a specific IPv6 prefix, for IPv6 prefix delegation, choose Custom. Then choose
Add new prefix and enter the prefix to use.
Note
IPv6 prefix delegation appears only if the selected subnet is enabled for IPv6.
5. Select the security groups to associate with the network interface and assign resource tags if
needed.
6. Choose Create network interface.
AWS CLI
Use the create-network-interface command and set --ipv4-prefixes to the prefixes. AWS selects
IP addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28.
1226
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
Example output
{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "IPv4 manual example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c4EXAMPLE"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:98:65:dd:18:47",
"NetworkInterfaceId": "eni-02b80b4668EXAMPLE",
"OwnerId": "123456789012",
"PrivateIpAddress": "10.0.0.62",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.62"
}
],
"Ipv4Prefixes": [
{
"Ipv4Prefix": "10.0.0.208/28"
}
],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-047cfed18eEXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b21EXAMPLE"
}
}
Example output
{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "IPv6 automatic example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c4EXAMPLE"
}
],
1227
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:bb:e4:31:fe:09",
"NetworkInterfaceId": "eni-006edbcfa4EXAMPLE",
"OwnerId": "123456789012",
"PrivateIpAddress": "10.0.0.73",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.73"
}
],
"Ipv6Prefixes": [
{
"Ipv6Prefix": "2600:1f13:fc2:a700:1768::/80"
}
],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-047cfed18eEXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b21EXAMPLE"
}
}
Console
AWS CLI
You can use the assign-ipv6-addresses command to assign IPv6 prefixes and the assign-private-ip-
addresses command to assign IPv4 prefixes to existing network interfaces.
1228
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
Example output
{
"NetworkInterfaceId": "eni-081fbb4095EXAMPLE",
"AssignedIpv4Prefixes": [
{
"Ipv4Prefix": "10.0.0.176/28"
}
]
}
Example output
{
"AssignedIpv6Prefixes": [
"2600:1f13:fc2:a700:18bb::/80"
],
"NetworkInterfaceId": "eni-00d577338cEXAMPLE"
}
Console
1229
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
6. Choose Save.
AWS CLI
Use the assign-private-ip-addresses command and set --ipv4-prefixes to the prefix. AWS
selects IPv4 addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28.
Example output
{
"NetworkInterfaceId": "eni-081fbb4095EXAMPLE",
"AssignedIpv4Prefixes": [
{
"Ipv4Prefix": "10.0.0.208/28"
}
]
}
Example output
{
"NetworkInterfaceId": "eni-00d577338cEXAMPLE",
"AssignedIpv6Prefixes": [
{
"Ipv6Prefix": "2600:1f13:fc2:a700:18bb::/80"
}
]
}
If you are not using Amazon Linux, you can use a Container Network Interface (CNI) for Kubernetes plug-
in, or dockerd if you use Docker to manage your containers.
1230
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
Console
AWS CLI
You can use the describe-network-interfaces AWS CLI command to view the prefixes assigned to
your network interfaces.
Example output
{
"NetworkInterfaces": [
{
"AvailabilityZone": "us-west-2a",
"Description": "IPv4 automatic example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c4EXAMPLE"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:98:65:dd:18:47",
"NetworkInterfaceId": "eni-02b80b4668EXAMPLE",
"OwnerId": "123456789012",
"PrivateIpAddress": "10.0.0.62",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.62"
}
],
"Ipv4Prefixes": [
{
"Ipv4Prefix": "10.0.0.208/28"
}
],
"Ipv6Prefixes": [],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "available",
"SubnetId": "subnet-05eef9fb78EXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b2146bf252"
},
1231
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with prefixes
{
"AvailabilityZone": "us-west-2a",
"Description": "IPv6 automatic example",
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-044c2de2c411c91b5"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "02:bb:e4:31:fe:09",
"NetworkInterfaceId": "eni-006edbcfa4EXAMPLE",
"OwnerId": "123456789012",
"PrivateIpAddress": "10.0.0.73",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.0.73"
}
],
"Ipv4Prefixes": [],
"Ipv6Prefixes": [
{
"Ipv6Prefix": "2600:1f13:fc2:a700:1768::/80"
}
],
"RequesterId": "AIDAIV5AJI5LXF5XXDPCO",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "available",
"SubnetId": "subnet-05eef9fb78EXAMPLE",
"TagSet": [],
"VpcId": "vpc-0e12f52b21EXAMPLE"
}
]
}
Console
• To remove all assigned prefixes, for IPv4 prefix delegation and IPv6 prefix delegation,
choose Do not assign.
• To remove specific assigned prefixes, for IPv4 prefix delegation or IPv6 prefix delegation,
choose Custom and then choose Unassign next to the prefixes to remove.
Note
IPv6 prefix delegation appears only if the selected subnet is enabled for IPv6.
1232
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic IP addresses
5. Choose Save.
AWS CLI
You can use the unassign-ipv6-addresses command to remove IPv6 prefixes and the unassign-
private-ip-addresses commands to remove IPv4 prefixes from your existing network interfaces.
Use the unassign-private-ip-addresses command and set --ipv4-prefix to the address that you
want to remove.
Use the unassign-ipv6-addresses command and set --ipv6-prefix to the address that you want
to remove.
Elastic IP addresses
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address
is allocated to your AWS account, and is yours until you release it. By using an Elastic IP address, you
can mask the failure of an instance or software by rapidly remapping the address to another instance
in your account. Alternatively, you can specify the Elastic IP address in a DNS record for your domain, so
that your domain points to your instance. For more information, see the documentation for your domain
registrar.
An Elastic IP address is a public IPv4 address, which is reachable from the internet. If your instance does
not have a public IPv4 address, you can associate an Elastic IP address with your instance to enable
communication with the internet. For example, this allows you to connect to your instance from your
local computer.
Contents
• Elastic IP address pricing (p. 1233)
• Elastic IP address basics (p. 1234)
• Work with Elastic IP addresses (p. 1234)
• Elastic IP address limit (p. 1244)
1233
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic IP address basics
For more information, see Elastic IP Addresses on the Amazon EC2 Pricing, On-Demand Pricing page.
Tasks
• Allocate an Elastic IP address (p. 1235)
• Describe your Elastic IP addresses (p. 1235)
• Tag an Elastic IP address (p. 1236)
• Associate an Elastic IP address with an instance or network interface (p. 1237)
• Disassociate an Elastic IP address (p. 1238)
• Transfer Elastic IP addresses (p. 1238)
1234
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
You can allocate an Elastic IP address using one of the following methods.
Console
• Amazon's pool of IPv4 addresses—If you want an IPv4 address to be allocated from
Amazon's pool of IPv4 addresses.
• Public IPv4 address that you bring to your AWS account—If you want to allocate an IPv4
address from an IP address pool that you have brought to your AWS account. This option is
disabled if you do not have any IP address pools.
• Customer owned pool of IPv4 addresses—If you want to allocate an IPv4 address from a
pool created from your on-premises network for use with an AWS Outpost. This option is
disabled if you do not have an AWS Outpost.
5. (Optional) Add or remove a tag.
[Remove a tag] Choose Remove to the right of the tag’s Key and Value.
6. Choose Allocate.
AWS CLI
1235
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
Console
AWS CLI
You can tag an Elastic IP address using one of the following methods.
Console
AWS CLI
PowerShell
The New-EC2Tag command needs a Tag parameter, which specifies the key and value pair to be
used for the Elastic IP address tag. The following commands create the Tag parameter.
1236
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
You can associate an Elastic IP address with an instance or network interface using one of the following
methods.
Console
AWS CLI
1237
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
You can disassociate an Elastic IP address using one of the following methods.
Console
AWS CLI
• Organizational restructuring – Use Elastic IP address transfers to quickly move workloads from one
AWS account to another. You don't have to wait for new Elastic IP addresses to be allowlisted in your
security groups and NACLs.
• Centralized security administration – Use a centralized AWS security account to track and transfer
Elastic IP addresses that have been vetted for security compliance.
• Disaster recovery – Use Elastic IP address transfers to quickly remap IPs for public-facing internet
workloads during emergency events.
Tasks
• Enable Elastic IP address transfer (p. 1238)
• Disable Elastic IP address transfer (p. 1240)
• Accept a transferred Elastic IP address (p. 1240)
1238
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
• You can transfer Elastic IP addresses from any AWS account (source account) to any other AWS account
in the same AWS Region (transfer account).
• When you transfer an Elastic IP address, there is a two-step handshake between the AWS accounts.
When the source account starts the transfer, the transfer accounts have seven days to accept the
Elastic IP address transfer. During those seven days, the source account can view the pending transfer
(for example in the AWS console or by using the describe-address-transfers AWS CLI command). After
seven days, the transfer expires and ownership of the Elastic IP address returns to the source account.
• Accepted transfers are visible to the source account (for example in the AWS console or by using the
describe-address-transfers AWS CLI command) for three days after the transfers have been accepted.
• AWS does not notify transfer accounts about pending Elastic IP address transfer requests. The owner
of the source account must notify the owner of the transfer account that there is an Elastic IP address
transfer request that they must accept.
• Any tags that are associated with an Elastic IP address being transferred are reset when the transfer is
complete.
• You cannot transfer Elastic IP addresses allocated from public IPv4 address pools that you bring to
your AWS account – commonly referred to as Bring Your Own IP (BYOIP) address pools.
• If you attempt to transfer an Elastic IP address that has a reverse DNS record associated with it, you
can begin the transfer process, but the transfer account will not be able to accept the transfer until the
associated DNS record is removed.
• If you have enabled and configured AWS Outposts, you might have allocated Elastic IP addresses from
a customer-owned IP address pool (CoIP). You cannot transfer Elastic IP addresses allocated from a
CoIP. However, you can use AWS RAM to share a CoIP with another account. For more information, see
Customer-owned IP addresses in the AWS Outposts User Guide.
• You can use Amazon VPC IPAM to track the transfer of Elastic IP addresses to accounts in an
organization from AWS Organizations. For more information, see View IP address history. If an Elastic
IP address is transferred to an AWS account outside of the organization, the IPAM audit history of the
Elastic IP address is lost.
Console
• Choose Single account if you are transferring the Elastic IP addresses to a single AWS
account.
• Choose Multiple accounts if you are transferring the Elastic IP addresses to multiple AWS
accounts.
6. Under Transfer account ID, enter the IDs of the AWS accounts that you want to transfer the
Elastic IP addresses to.
7. Confirm the transfer by entering enable in the text box.
8. Choose Submit.
9. To accept the transfer, see Accept a transferred Elastic IP address (p. 1240). To disable the
transfer, see Disable Elastic IP address transfer (p. 1240).
1239
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
AWS CLI
These steps must be completed by the source account that enabled the transfer.
Console
AWS CLI
When you transfer an Elastic IP address, there is a two-step handshake between the AWS accounts. When
the source account starts the transfer, the transfer accounts have seven days to accept the Elastic IP
address transfer. During those seven days, the source account can view the pending transfer (for example
in the AWS console or by using the describe-address-transfers AWS CLI command). After seven days, the
transfer expires and ownership of the Elastic IP address returns to the source account.
When accepting transfers, note the following exceptions that might occur and how to resolve them:
• AddressLimitExceeded: If your transfer account has exceeded the Elastic IP address quota, the source
account can enable Elastic IP address transfer, but this exception occurs when the transfer account
1240
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
tries to accept the transfer. By default, all AWS accounts are limited to 5 Elastic IP addresses per
Region. See Elastic IP address limit (p. 1244) for instructions on increasing the limit.
• InvalidTransfer.AddressCustomPtrSet: If you or someone in your organization has configured the
Elastic IP address that you are attempting to transfer to use reverse DNS lookup, the source account
can enable transfer for the Elastic IP address, but this exception occurs when the transfer account tries
to accept the transfer. To resolve this issue, the source account must remove the DNS record for the
Elastic IP address. For more information, see Use reverse DNS for email applications (p. 1242).
• InvalidTransfer.AddressAssociated: If an Elastic IP address is associated with an ENI or EC2 instance,
the source account can enable transfer for the Elastic IP address, but this exception occurs when the
transfer account tries to accept the transfer. To resolve this issue, the source account must disassociate
the Elastic IP address. For more information, see Disassociate an Elastic IP address (p. 1238).
Console
AWS CLI
1241
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
Console
AWS CLI
• You cannot recover an Elastic IP address if it has been allocated to another AWS account, or if it will
result in your exceeding your Elastic IP address limit.
• You cannot recover tags associated with an Elastic IP address.
• You can recover an Elastic IP address using the Amazon EC2 API or a command line tool only.
AWS CLI
Use the allocate-address AWS CLI command and specify the IP address using the --address
parameter as follows.
PowerShell
Use the New-EC2Address AWS Tools for Windows PowerShell command and specify the IP address
using the -Address parameter as follows.
1242
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with Elastic IP addresses
Considerations
• Before you create a reverse DNS record, you must set a corresponding forward DNS record (record type
A) that points to your Elastic IP address.
• If a reverse DNS record is associated with an Elastic IP address, the Elastic IP address is locked to your
account and cannot be released from your account until the record is removed.
• AWS GovCloud (US) Region
You can't create a reverse DNS record using the console or AWS CLI. AWS must assign the static reverse
DNS records for you. Open Request to remove reverse DNS and email sending limitations and provide
us with your Elastic IP addresses and reverse DNS records.
Console
AWS CLI
Use the modify-address-attribute command in the AWS CLI, as shown in the following example:
Console
1243
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic IP address limit
AWS CLI
Use the reset-address-attribute command in the AWS CLI, as shown in the following example:
Note
If you receive the following error when you run the command, you can submit a Request to
remove email sending limitations to customer support for assistance.
The address with allocation id cannot be released because it is locked to your account.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ and choose Elastic IPs from the
navigation pane.
You can verify your limit in either the Amazon EC2 console or the Service Quotas console. Do one of the
following:
Choose Limits from the navigation pane, and then enter IP in the search field. The limit is EC2-VPC
Elastic IPs. If you have access to EC2-Classic, there is an additional limit, EC2-Classic Elastic IPs.
• Open the Service Quotas console at https://console.aws.amazon.com/servicequotas/.
On the Dashboard, choose Amazon Elastic Compute Cloud (Amazon EC2). If Amazon Elastic Compute
Cloud (Amazon EC2) is not listed on the Dashboard, choose AWS services, enter EC2 in the search
field, and then choose Amazon Elastic Compute Cloud (Amazon EC2).
On the Amazon EC2 service quotas page, enter IP in the search field. The limit is EC2-VPC Elastic
IPs. If you have access to EC2-Classic, there is an additional limit, EC2-Classic Elastic IPs. For more
information, choose the limit.
1244
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network interfaces
If you think your architecture warrants additional Elastic IP addresses, you can request a quota increase
directly from the Service Quotas console.
• A primary private IPv4 address from the IPv4 address range of your VPC
• One or more secondary private IPv4 addresses from the IPv4 address range of your VPC
• One Elastic IP address (IPv4) per private IPv4 address
• One public IPv4 address
• One or more IPv6 addresses
• One or more security groups
• A MAC address
• A source/destination check flag
• A description
You can create and configure network interfaces and attach them to instances in the same Availability
Zone. Your account might also have requester-managed network interfaces, which are created and
managed by AWS services to enable you to use other resources and services. You cannot manage these
network interfaces yourself. For more information, see Requester-managed network interfaces (p. 1275).
This AWS resource is referred to as a network interface in the AWS Management Console and the Amazon
EC2 API. Therefore, we use "network interface" in this documentation instead of "elastic network
interface". The term "network interface" in this documentation always means "elastic network interface".
Contents
• Network interface basics (p. 1245)
• IP addresses per network interface per instance type (p. 1247)
• Work with network interfaces (p. 1264)
• Best practices for configuring network interfaces (p. 1272)
• Scenarios for network interfaces (p. 1272)
• Requester-managed network interfaces (p. 1275)
Each instance has a default network interface, called the primary network interface. You cannot detach
a primary network interface from an instance. You can create and attach additional network interfaces.
The maximum number of network interfaces that you can use varies by instance type. For more
information, see IP addresses per network interface per instance type (p. 1247).
1245
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network interface basics
In a VPC, all subnets have a modifiable attribute that determines whether network interfaces created in
that subnet (and therefore instances launched into that subnet) are assigned a public IPv4 address. For
more information, see Subnet settings in the Amazon VPC User Guide. The public IPv4 address is assigned
from Amazon's pool of public IPv4 addresses. When you launch an instance, the IP address is assigned to
the primary network interface that's created.
When you create a network interface, it inherits the public IPv4 addressing attribute from the subnet.
If you later modify the public IPv4 addressing attribute of the subnet, the network interface keeps the
setting that was in effect when it was created. If you launch an instance and specify an existing network
interface as the primary network interface, the public IPv4 address attribute is determined by this
network interface.
If you have an Elastic IP address, you can associate it with one of the private IPv4 addresses for the
network interface. You can associate one Elastic IP address with each private IPv4 address.
If you disassociate an Elastic IP address from a network interface, you can release it back to the address
pool. This is the only way to associate an Elastic IP address with an instance in a different subnet or VPC,
as network interfaces are specific to subnets.
If you associate IPv6 CIDR blocks with your VPC and subnet, you can assign one or more IPv6 addresses
from the subnet range to a network interface. Each IPv6 address can be assigned to one network
interface.
All subnets have a modifiable attribute that determines whether network interfaces created in that
subnet (and therefore instances launched into that subnet) are automatically assigned an IPv6 address
from the range of the subnet. For more information, see Subnet settings in the Amazon VPC User Guide.
When you launch an instance, the IPv6 address is assigned to the primary network interface that's
created.
Prefix Delegation
A Prefix Delegation prefix is a reserved private IPv4 or IPv6 CIDR range that you allocate for automatic
or manual assignment to network interfaces that are associated with an instance. By using Delegated
Prefixes, you can launch services faster by assigning a range of IP addresses as a single prefix.
Termination behavior
You can set the termination behavior for a network interface that's attached to an instance. You can
specify whether the network interface should be automatically deleted when you terminate the instance
to which it's attached.
Source/destination checking
You can enable or disable source/destination checks, which ensure that the instance is either the source
or the destination of any traffic that it receives. Source/destination checks are enabled by default. You
must disable source/destination checks if the instance runs services such as network address translation,
routing, or firewalls.
Monitoring IP traffic
You can enable a VPC flow log on your network interface to capture information about the IP traffic
going to and from a network interface. After you've created a flow log, you can view and retrieve its data
in Amazon CloudWatch Logs. For more information, see VPC Flow Logs in the Amazon VPC User Guide.
1246
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Topics
• General Purpose (p. 1247)
• Compute Optimized (p. 1252)
• Memory Optimized (p. 1255)
• Storage Optimized (p. 1261)
• Accelerated Computing (p. 1263)
General Purpose
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
m4.large 2 10 10
m4.xlarge 4 15 15
m4.2xlarge 4 15 15
m4.4xlarge 8 30 30
m4.10xlarge 8 30 30
m4.16xlarge 8 30 30
m5.large 3 10 10
m5.xlarge 4 15 15
1247
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
m5.2xlarge 4 15 15
m5.4xlarge 8 30 30
m5.8xlarge 8 30 30
m5.12xlarge 8 30 30
m5.16xlarge 15 50 50
m5.24xlarge 15 50 50
m5.metal 15 50 50
m5a.large 3 10 10
m5a.xlarge 4 15 15
m5a.2xlarge 4 15 15
m5a.4xlarge 8 30 30
m5a.8xlarge 8 30 30
m5a.12xlarge 8 30 30
m5a.16xlarge 15 50 50
m5a.24xlarge 15 50 50
m5ad.large 3 10 10
m5ad.xlarge 4 15 15
m5ad.2xlarge 4 15 15
m5ad.4xlarge 8 30 30
m5ad.8xlarge 8 30 30
m5ad.12xlarge 8 30 30
m5ad.16xlarge 15 50 50
m5ad.24xlarge 15 50 50
m5d.large 3 10 10
m5d.xlarge 4 15 15
m5d.2xlarge 4 15 15
m5d.4xlarge 8 30 30
m5d.8xlarge 8 30 30
m5d.12xlarge 8 30 30
m5d.16xlarge 15 50 50
1248
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
m5d.24xlarge 15 50 50
m5d.metal 15 50 50
m5dn.large 3 10 10
m5dn.xlarge 4 15 15
m5dn.2xlarge 4 15 15
m5dn.4xlarge 8 30 30
m5dn.8xlarge 8 30 30
m5dn.12xlarge 8 30 30
m5dn.16xlarge 15 50 50
m5dn.24xlarge 15 50 50
m5dn.metal 15 50 50
m5n.large 3 10 10
m5n.xlarge 4 15 15
m5n.2xlarge 4 15 15
m5n.4xlarge 8 30 30
m5n.8xlarge 8 30 30
m5n.12xlarge 8 30 30
m5n.16xlarge 15 50 50
m5n.24xlarge 15 50 50
m5n.metal 15 50 50
m5zn.large 3 10 10
m5zn.xlarge 4 15 15
m5zn.2xlarge 4 15 15
m5zn.3xlarge 8 30 30
m5zn.6xlarge 8 30 30
m5zn.12xlarge 15 50 50
m5zn.metal 15 50 50
m6a.large 3 10 10
m6a.xlarge 4 15 15
m6a.2xlarge 4 15 15
1249
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
m6a.4xlarge 8 30 30
m6a.8xlarge 8 30 30
m6a.12xlarge 8 30 30
m6a.16xlarge 15 50 50
m6a.24xlarge 15 50 50
m6a.32xlarge 15 50 50
m6a.48xlarge 15 50 50
m6a.metal 15 50 50
m6i.large 3 10 10
m6i.xlarge 4 15 15
m6i.2xlarge 4 15 15
m6i.4xlarge 8 30 30
m6i.8xlarge 8 30 30
m6i.12xlarge 8 30 30
m6i.16xlarge 15 50 50
m6i.24xlarge 15 50 50
m6i.32xlarge 15 50 50
m6i.metal 15 50 50
m6id.large 3 10 10
m6id.xlarge 4 15 15
m6id.2xlarge 4 15 15
m6id.4xlarge 8 30 30
m6id.8xlarge 8 30 30
m6id.12xlarge 8 30 30
m6id.16xlarge 15 50 50
m6id.24xlarge 15 50 50
m6id.32xlarge 15 50 50
m6id.metal 15 50 50
m6idn.large 3 10 10
m6idn.xlarge 4 15 15
1250
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
m6idn.2xlarge 4 15 15
m6idn.4xlarge 8 30 30
m6idn.8xlarge 8 30 30
m6idn.12xlarge 8 30 30
m6idn.16xlarge 15 50 50
m6idn.24xlarge 15 50 50
m6idn.32xlarge 14 50 50
m6idn.metal 14 50 50
m6in.large 3 10 10
m6in.xlarge 4 15 15
m6in.2xlarge 4 15 15
m6in.4xlarge 8 30 30
m6in.8xlarge 8 30 30
m6in.12xlarge 8 30 30
m6in.16xlarge 15 50 50
m6in.24xlarge 15 50 50
m6in.32xlarge 14 50 50
m6in.metal 14 50 50
t2.nano 2 2 2
t2.micro 2 2 2
t2.small 3 4 4
t2.medium 3 6 6
t2.large 3 12 12
t2.xlarge 3 15 15
t2.2xlarge 3 15 15
t3.nano 2 2 2
t3.micro 2 2 2
t3.small 3 4 4
t3.medium 3 6 6
1251
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
t3.large 3 12 12
t3.xlarge 4 15 15
t3.2xlarge 4 15 15
t3a.nano 2 2 2
t3a.micro 2 2 2
t3a.small 2 4 4
t3a.medium 3 6 6
t3a.large 3 12 12
t3a.xlarge 4 15 15
t3a.2xlarge 4 15 15
Compute Optimized
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
c3.large 3 10 10
c3.xlarge 4 15 15
c3.2xlarge 4 15 15
c3.4xlarge 8 30 30
c3.8xlarge 8 30 30
c4.large 3 10 10
c4.xlarge 4 15 15
c4.2xlarge 4 15 15
c4.4xlarge 8 30 30
c4.8xlarge 8 30 30
c5.large 3 10 10
c5.xlarge 4 15 15
c5.2xlarge 4 15 15
c5.4xlarge 8 30 30
1252
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
c5.9xlarge 8 30 30
c5.12xlarge 8 30 30
c5.18xlarge 15 50 50
c5.24xlarge 15 50 50
c5.metal 15 50 50
c5a.large 3 10 10
c5a.xlarge 4 15 15
c5a.2xlarge 4 15 15
c5a.4xlarge 8 30 30
c5a.8xlarge 8 30 30
c5a.12xlarge 8 30 30
c5a.16xlarge 15 50 50
c5a.24xlarge 15 50 50
c5ad.large 3 10 10
c5ad.xlarge 4 15 15
c5ad.2xlarge 4 15 15
c5ad.4xlarge 8 30 30
c5ad.8xlarge 8 30 30
c5ad.12xlarge 8 30 30
c5ad.16xlarge 15 50 50
c5ad.24xlarge 15 50 50
c5d.large 3 10 10
c5d.xlarge 4 15 15
c5d.2xlarge 4 15 15
c5d.4xlarge 8 30 30
c5d.9xlarge 8 30 30
c5d.12xlarge 8 30 30
c5d.18xlarge 15 50 50
c5d.24xlarge 15 50 50
c5d.metal 15 50 50
1253
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
c5n.large 3 10 10
c5n.xlarge 4 15 15
c5n.2xlarge 4 15 15
c5n.4xlarge 8 30 30
c5n.9xlarge 8 30 30
c5n.18xlarge 15 50 50
c5n.metal 15 50 50
c6a.large 3 10 10
c6a.xlarge 4 15 15
c6a.2xlarge 4 15 15
c6a.4xlarge 8 30 30
c6a.8xlarge 8 30 30
c6a.12xlarge 8 30 30
c6a.16xlarge 15 50 50
c6a.24xlarge 15 50 50
c6a.32xlarge 15 50 50
c6a.48xlarge 15 50 50
c6a.metal 15 50 50
c6i.large 3 10 10
c6i.xlarge 4 15 15
c6i.2xlarge 4 15 15
c6i.4xlarge 8 30 30
c6i.8xlarge 8 30 30
c6i.12xlarge 8 30 30
c6i.16xlarge 15 50 50
c6i.24xlarge 15 50 50
c6i.32xlarge 15 50 50
c6i.metal 15 50 50
c6id.large 3 10 10
c6id.xlarge 4 15 15
1254
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
c6id.2xlarge 4 15 15
c6id.4xlarge 8 30 30
c6id.8xlarge 8 30 30
c6id.12xlarge 8 30 30
c6id.16xlarge 15 50 50
c6id.24xlarge 15 50 50
c6id.32xlarge 15 50 50
c6id.metal 15 50 50
c6in.large 3 10 10
c6in.xlarge 4 15 15
c6in.2xlarge 4 15 15
c6in.4xlarge 8 30 30
c6in.8xlarge 8 30 30
c6in.12xlarge 8 30 30
c6in.16xlarge 15 50 50
c6in.24xlarge 15 50 50
c6in.32xlarge 14 50 50
c6in.metal 14 50 50
Memory Optimized
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
hpc6id.32xlarge2 50 50
r3.large 3 10 10
r3.xlarge 4 15 15
r3.2xlarge 4 15 15
r3.4xlarge 8 30 30
r3.8xlarge 8 30 30
1255
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
r4.large 3 10 10
r4.xlarge 4 15 15
r4.2xlarge 4 15 15
r4.4xlarge 8 30 30
r4.8xlarge 8 30 30
r4.16xlarge 15 50 50
r5.large 3 10 10
r5.xlarge 4 15 15
r5.2xlarge 4 15 15
r5.4xlarge 8 30 30
r5.8xlarge 8 30 30
r5.12xlarge 8 30 30
r5.16xlarge 15 50 50
r5.24xlarge 15 50 50
r5.metal 15 50 50
r5a.large 3 10 10
r5a.xlarge 4 15 15
r5a.2xlarge 4 15 15
r5a.4xlarge 8 30 30
r5a.8xlarge 8 30 30
r5a.12xlarge 8 30 30
r5a.16xlarge 15 50 50
r5a.24xlarge 15 50 50
r5ad.large 3 10 10
r5ad.xlarge 4 15 15
r5ad.2xlarge 4 15 15
r5ad.4xlarge 8 30 30
r5ad.8xlarge 8 30 30
r5ad.12xlarge 8 30 30
r5ad.16xlarge 15 50 50
1256
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
r5ad.24xlarge 15 50 50
r5b.large 3 10 10
r5b.xlarge 4 15 15
r5b.2xlarge 4 15 15
r5b.4xlarge 8 30 30
r5b.8xlarge 8 30 30
r5b.12xlarge 8 30 30
r5b.16xlarge 15 50 50
r5b.24xlarge 15 50 50
r5b.metal 15 50 50
r5d.large 3 10 10
r5d.xlarge 4 15 15
r5d.2xlarge 4 15 15
r5d.4xlarge 8 30 30
r5d.8xlarge 8 30 30
r5d.12xlarge 8 30 30
r5d.16xlarge 15 50 50
r5d.24xlarge 15 50 50
r5d.metal 15 50 50
r5dn.large 3 10 10
r5dn.xlarge 4 15 15
r5dn.2xlarge 4 15 15
r5dn.4xlarge 8 30 30
r5dn.8xlarge 8 30 30
r5dn.12xlarge 8 30 30
r5dn.16xlarge 15 50 50
r5dn.24xlarge 15 50 50
r5dn.metal 15 50 50
r5n.large 3 10 10
r5n.xlarge 4 15 15
1257
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
r5n.2xlarge 4 15 15
r5n.4xlarge 8 30 30
r5n.8xlarge 8 30 30
r5n.12xlarge 8 30 30
r5n.16xlarge 15 50 50
r5n.24xlarge 15 50 50
r5n.metal 15 50 50
r6a.large 3 10 10
r6a.xlarge 4 15 15
r6a.2xlarge 4 15 15
r6a.4xlarge 8 30 30
r6a.8xlarge 8 30 30
r6a.12xlarge 8 30 30
r6a.16xlarge 15 50 50
r6a.24xlarge 15 50 50
r6a.32xlarge 15 50 50
r6a.48xlarge 15 50 50
r6a.metal 15 50 50
r6i.large 3 10 10
r6i.xlarge 4 15 15
r6i.2xlarge 4 15 15
r6i.4xlarge 8 30 30
r6i.8xlarge 8 30 30
r6i.12xlarge 8 30 30
r6i.16xlarge 15 50 50
r6i.24xlarge 15 50 50
r6i.32xlarge 15 50 50
r6i.metal 15 50 50
r6idn.large 3 10 10
r6idn.xlarge 4 15 15
1258
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
r6idn.2xlarge 4 15 15
r6idn.4xlarge 8 30 30
r6idn.8xlarge 8 30 30
r6idn.12xlarge 8 30 30
r6idn.16xlarge 15 50 50
r6idn.24xlarge 15 50 50
r6idn.32xlarge 14 50 50
r6idn.metal 14 50 50
r6in.large 3 10 10
r6in.xlarge 4 15 15
r6in.2xlarge 4 15 15
r6in.4xlarge 8 30 30
r6in.8xlarge 8 30 30
r6in.12xlarge 8 30 30
r6in.16xlarge 15 50 50
r6in.24xlarge 15 50 50
r6in.32xlarge 14 50 50
r6in.metal 14 50 50
r6id.large 3 10 10
r6id.xlarge 4 15 15
r6id.2xlarge 4 15 15
r6id.4xlarge 8 30 30
r6id.8xlarge 8 30 30
r6id.12xlarge 8 30 30
r6id.16xlarge 15 50 50
r6id.24xlarge 15 50 50
r6id.32xlarge 15 50 50
r6id.metal 15 50 50
u-3tb1.56xlarge8 30 30
u-6tb1.56xlarge15 50 50
1259
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
15
u-6tb1.112xlarge 50 50
u-6tb1.metal 5 30 30
15
u-9tb1.112xlarge 50 50
u-9tb1.metal 5 30 30
15
u-12tb1.112xlarge 50 50
u-12tb1.metal 5 30 30
u-18tb1.metal 15 50 50
u-24tb1.metal 15 50 50
x1.16xlarge 8 30 30
x1.32xlarge 8 30 30
x2idn.16xlarge 15 50 50
x2idn.24xlarge 15 50 50
x2idn.32xlarge 15 50 50
x2idn.metal 15 50 50
x2iedn.xlarge 4 15 15
x2iedn.2xlarge 4 15 15
x2iedn.4xlarge 8 30 30
x2iedn.8xlarge 8 30 30
x2iedn.16xlarge15 50 50
x2iedn.24xlarge15 50 50
x2iedn.32xlarge15 50 50
x2iedn.metal 15 50 50
x2iezn.2xlarge 4 15 15
x2iezn.4xlarge 8 30 30
x2iezn.6xlarge 8 30 30
x2iezn.8xlarge 8 30 30
x2iezn.12xlarge15 50 50
x2iezn.metal 15 50 50
x1e.xlarge 3 10 10
x1e.2xlarge 4 15 15
1260
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
x1e.4xlarge 4 15 15
x1e.8xlarge 4 15 15
x1e.16xlarge 8 30 30
x1e.32xlarge 8 30 30
z1d.large 3 10 10
z1d.xlarge 4 15 15
z1d.2xlarge 4 15 15
z1d.3xlarge 8 30 30
z1d.6xlarge 8 30 30
z1d.12xlarge 15 50 50
z1d.metal 15 50 50
Storage Optimized
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
d2.xlarge 4 15 15
d2.2xlarge 4 15 15
d2.4xlarge 8 30 30
d2.8xlarge 8 30 30
d3.xlarge 4 3 3
d3.2xlarge 4 5 5
d3.4xlarge 4 10 10
d3.8xlarge 3 20 20
d3en.xlarge 4 3 3
d3en.2xlarge 4 5 5
d3en.4xlarge 4 10 10
d3en.6xlarge 4 15 15
d3en.8xlarge 4 20 20
d3en.12xlarge 3 30 30
h1.2xlarge 4 15 15
1261
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
h1.4xlarge 8 30 30
h1.8xlarge 8 30 30
h1.16xlarge 15 50 50
i2.xlarge 4 15 15
i2.2xlarge 4 15 15
i2.4xlarge 8 30 30
i2.8xlarge 8 30 30
i3.large 3 10 10
i3.xlarge 4 15 15
i3.2xlarge 4 15 15
i3.4xlarge 8 30 30
i3.8xlarge 8 30 30
i3.16xlarge 15 50 50
i3.metal 15 50 50
i3en.large 3 10 10
i3en.xlarge 4 15 15
i3en.2xlarge 4 15 15
i3en.3xlarge 4 15 15
i3en.6xlarge 8 30 30
i3en.12xlarge 8 30 30
i3en.24xlarge 15 50 50
i3en.metal 15 50 50
i4i.large 3 10 10
i4i.xlarge 4 15 15
i4i.2xlarge 4 15 15
i4i.4xlarge 8 30 30
i4i.8xlarge 8 30 30
i4i.16xlarge 15 50 50
i4i.32xlarge 15 50 50
1262
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IP addresses per network interface per instance type
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
i4i.metal 15 50 50
Accelerated Computing
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
f1.2xlarge 4 15 15
f1.4xlarge 8 30 30
f1.16xlarge 8 50 50
g3.4xlarge 8 30 30
g3.8xlarge 8 30 30
g3.16xlarge 15 50 50
g4ad.xlarge 2 4 4
g4ad.2xlarge 2 4 4
g4ad.4xlarge 3 10 10
g4ad.8xlarge 4 15 15
g4ad.16xlarge 8 30 30
g4dn.xlarge 3 10 10
g4dn.2xlarge 3 10 10
g4dn.4xlarge 3 10 10
g4dn.8xlarge 4 15 15
g4dn.12xlarge 8 30 30
g4dn.16xlarge 4 15 15
g4dn.metal 15 50 50
g5.xlarge 4 15 15
g5.2xlarge 4 15 15
g5.4xlarge 8 30 30
g5.8xlarge 8 30 30
g5.12xlarge 15 50 50
1263
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
Instance type Maximum network Private IPv4 addresses IPv6 addresses per
interfaces per interface interface
g5.16xlarge 8 30 30
g5.24xlarge 15 50 50
g5.48xlarge 7 50 50
p2.xlarge 4 15 15
p2.8xlarge 8 30 30
p2.16xlarge 8 30 30
p3.2xlarge 4 15 15
p3.8xlarge 8 30 30
p3.16xlarge 8 30 30
p3dn.24xlarge 15 50 50
You can use the describe-instance-types AWS CLI command to display information about an instance
type, such as the supported network interfaces and IP addresses per interface. The following example
displays this information for all C5 instances.
Contents
• Create a network interface (p. 1265)
• View details about a network interface (p. 1266)
• Attach a network interface to an instance (p. 1266)
• Detach a network interface from an instance (p. 1267)
• Manage IP addresses (p. 1268)
• Modify network interface attributes (p. 1269)
1264
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
New console
Old console
1265
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
New console
Old console
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1266
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
Important
For EC2 instances in an IPv6-only subnet, if you attach a secondary network interface to the
instance, the private DNS hostname of the second network interface will resolve to the first
IPv6 address on the instance's first network interface. For more information about EC2 instance
private DNS hostnames, see Amazon EC2 instance hostname types (p. 1204).
If the public IPv4 address on your instance is released, it does not receive a new one if there is more than
one network interface attached to the instance. For more information about the behavior of public IPv4
addresses, see Public IPv4 addresses (p. 1190).
Instances page
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
If you try to detach a network interface that is attached to a resource from another service, such as
an Elastic Load Balancing load balancer, a Lambda function, a WorkSpace, or a NAT gateway, you get
an error that you do not have permission to access the resource. To find which service created the
resource attached to a network interface, check the description of the network interface. If you delete
the resource, then its network interface is deleted.
1267
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
Instances page
To detach a network interface from an instance using the Network Interfaces page
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
Manage IP addresses
You can manage the following IP addresses for your network interfaces:
1268
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
To manage the IPv4 and IPv6 addresses of a network interface using the console
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
• assign-ipv6-addresses
• associate-address
• disassociate-address
• unassign-ipv6-addresses
To manage the IP addresses of a network interface using the Tools for Windows PowerShell
• Register-EC2Address
• Register-EC2Ipv6AddressList
• Unregister-EC2Address
• Unregister-EC2Ipv6AddressList
1269
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
The security group and network interface must be created for the same VPC. To change the security
group for interfaces owned by other services, such as Elastic Load Balancing, do so through that
service.
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1270
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with network interfaces
New console
Old console
To add or edit tags for a network interface using the command line
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
You cannot delete a network interface that is in use. First, you must detach the network
interface (p. 1267).
New console
1271
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Best practices for configuring network interfaces
3. Select the checkbox for the network interface, and then choose Actions, Delete.
4. When prompted for confirmation, choose Delete.
Old console
You can use one of the following commands. For more information about these command line interfaces,
see Access Amazon EC2 (p. 3).
1272
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scenarios for network interfaces
Criteria
• The primary network interface on the instance (eth0) handles public traffic.
• The secondary network interface on the instance (eth1) handles backend management traffic. It's
connected to a separate subnet that has more restrictive access controls, and is located within the
same Availability Zone (AZ) as the primary network interface.
Settings
• The primary network interface, which may or may not be behind a load balancer, has an associated
security group that allows access to the server from the internet. For example, allow TCP port 80 and
443 from 0.0.0.0/0 or from the load balancer.
• The secondary network interface has an associated security group that allows RDP access only,
initiated from one of the following locations:
• An allowed range of IP addresses, either within the VPC, or from the internet.
• A private subnet within the same AZ as the primary network interface.
• A virtual private gateway.
Note
To ensure failover capabilities, consider using a secondary private IPv4 for incoming traffic on
a network interface. In the event of an instance failure, you can move the interface and/or
secondary private IPv4 address to a standby instance.
1273
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Scenarios for network interfaces
1274
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Requester-managed network interfaces
a critical service such as a database instance or a NAT instance. If the instance fails, you (or more likely,
the code running on your behalf) can attach the network interface to a hot standby instance. Because
the interface maintains its private IP addresses, Elastic IP addresses, and MAC address, network traffic
begins flowing to the standby instance as soon as you attach the network interface to the replacement
instance. Users experience a brief loss of connectivity between the time the instance fails and the time
that the network interface is attached to the standby instance, but no changes to the route table or your
DNS server are required.
Considerations
• You can view the requester-managed network interfaces in your account. You can add or remove tags,
but you can't change other properties of a requester-managed network interface.
• You can't detach a requester-managed network interface.
• When you delete the resource associated with a requester-managed network interface, the AWS
service detaches the network interface and deletes it. If the service detached a network interface but
didn't delete it, you can delete the detached network interface.
• Description: A description provided by the AWS service that created the interface. For example,
"VPC Endpoint Interface vpce 089f2123488812123".
• Requester-managed: Indicates whether the network interface is managed by AWS.
• Requester ID: The alias or AWS account ID of the principal or service that created the network
interface. If you created the network interface, this is your AWS account ID. Otherwise, another
principal or service created it.
The following is example output that shows the key fields that you can use to determine the purpose of
the network interface: Description and InterfaceType.
{
...
"Description": "VPC Endpoint Interface vpce-089f2123488812123",
...
"InterfaceType": "vpc_endpoint",
...
"NetworkInterfaceId": "eni-0d11e3ccd2c0e6c57",
1275
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network bandwidth
...
"RequesterId": "727180483921",
"RequesterManaged": true,
...
}
To view requester-managed network interfaces using the Tools for Windows PowerShell
The following is example output that shows the key fields that you can use to determine the purpose of
the network interface: Description and InterfaceType.
Multi-flow traffic
Bandwidth for aggregate multi-flow traffic available to an instance depends on the destination of the
traffic.
• Within the Region – Traffic can utilize the full network bandwidth available to the instance.
• To other Regions, an internet gateway, Direct Connect, or local gateways (LGW) – Traffic can utilize up
to 50% of the network bandwidth available to a current generation instance (p. 204) with a minimum
of 32 vCPUs. Bandwidth for a current generation instance with less than 32 vCPUs is limited to 5 Gbps.
Single-flow traffic
Baseline bandwidth for single-flow (5-tuple) traffic is limited to 5 Gbps when instances are not in the
same cluster placement group (p. 1303). To reduce latency and increase single-flow bandwidth, try one
of the following:
• Use a cluster placement group to achieve up to 10 Gbps bandwidth for instances within the same
placement group.
• Set up multiple paths between two endpoints to achieve higher bandwidth with Multipath TCP
(MPTCP).
• Configure ENA Express for eligible instances within the same subnet to achieve up to 25 Gbps between
those instances.
1276
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Available instance bandwidth
Typically, instances with 16 vCPUs or fewer (size 4xlarge and smaller) are documented as having "up
to" a specified bandwidth; for example, "up to 10 Gbps". These instances have a baseline bandwidth. To
meet additional demand, they can use a network I/O credit mechanism to burst beyond their baseline
bandwidth. Instances can use burst bandwidth for a limited time, typically from 5 to 60 minutes,
depending on the instance size.
An instance receives the maximum number of network I/O credits at launch. If the instance exhausts its
network I/O credits, it returns to its baseline bandwidth. A running instance earns network I/O credits
whenever it uses less network bandwidth than its baseline bandwidth. A stopped instance does not earn
network I/O credits. Instance burst is on a best effort basis, even when the instance has credits available,
as burst bandwidth is a shared resource.
There are separate network I/O credit buckets for inbound and outbound traffic.
The following documentation describes the network performance for all instances, plus the baseline
network bandwidth available for instances that can use burst bandwidth.
You can use the describe-instance-types AWS CLI command to display information about an instance
type. The following example displays network performance information for all C5 instances.
1277
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor instance bandwidth
+--------------+--------------------+
You can configure whether Amazon EC2 sends metric data for the instance to CloudWatch using one-
minute periods or five-minute periods. It is possible that the network performance metrics would show
that an allowance was exceeded and packets were dropped while the CloudWatch instance metrics do
not. This can happen when the instance has a short spike in demand for network resources (known as a
microburst), but the CloudWatch metrics are not granular enough to reflect these microsecond spikes.
Learn more
For information about the supported network speed for each instance type, see Amazon EC2 Instance
Types.
Contents
• Enhanced networking support (p. 1278)
• Enable enhanced networking on your instance (p. 1279)
• Enable enhanced networking with the Elastic Network Adapter (ENA) on Windows
instances (p. 1279)
• Improve network performance with ENA Express on Windows instances (p. 1289)
• Enable enhanced networking with the Intel 82599 VF interface on Windows instances (p. 1295)
• Operating system optimizations (p. 1299)
• Monitor network performance for your EC2 instance (p. 1300)
You can enable enhanced networking using one of the following mechanisms:
The Elastic Network Adapter (ENA) supports network speeds of up to 100 Gbps for supported
instance types.
1278
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Enable enhanced networking on your instance
The current generation instances use ENA for enhanced networking, except for C4, D2, and M4
instances smaller than m4.16xlarge.
Intel 82599 Virtual Function (VF) interface
The Intel 82599 Virtual Function interface supports network speeds of up to 10 Gbps for supported
instance types.
The following instance types use the Intel 82599 VF interface for enhanced networking: C3, C4, D2,
I2, M4 (excluding m4.16xlarge), and R3.
For a summary of the enhanced networking mechanisms by instance type, see Summary of networking
and storage features (p. 212).
If your instance type supports the Intel 82599 VF interface for enhanced networking, follow
the procedures in Enable enhanced networking with the Intel 82599 VF interface on Windows
instances (p. 1295).
Contents
• Requirements (p. 1279)
• Enhanced networking performance (p. 1280)
• Test whether enhanced networking is enabled (p. 1280)
• Enable enhanced networking on Windows (p. 1281)
• Install or upgrade Elastic Network Adapter (ENA) driver (p. 1282)
• Amazon ENA driver versions (p. 1285)
• Subscribe to notifications (p. 744)
Requirements
To prepare for enhanced networking using the ENA, set up your instance as follows:
• Launch the instance using a current generation (p. 204) instance type, other than C4, D2, M4 instances
smaller than m4.16xlarge, or T2.
• If the instance is running Windows Server 2008 R2 SP1, ensure that is has the SHA-2 code signing
support update.
• Ensure that the instance has internet connectivity.
• Use AWS CloudShell from the AWS Management Console, or install and configure the AWS CLI or
the AWS Tools for Windows PowerShell on any computer you choose, preferably your local desktop
or laptop. For more information, see Access Amazon EC2 (p. 3) or the AWS CloudShell User Guide.
Enhanced networking cannot be managed from the Amazon EC2 console.
1279
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
• If you have important data on the instance that you want to preserve, you should back that data up
now by creating an AMI from your instance. Updating kernels and kernel modules, as well as enabling
the enaSupport attribute, might render incompatible instances or operating systems unreachable. If
you have a recent backup, your data will still be retained if this happens.
Note
We require TLS 1.2 and recommend TLS 1.3. Your client must meet this requirement to
download from Amazon Simple Storage Service (Amazon S3). For more information, see TLS 1.2
to become the minimum TLS protocol level for all AWS API endpoints.
To check whether an instance has the enhanced networking enaSupport attribute set, use one of the
following commands. If the attribute is set, the response is true.
To check whether an AMI has the enhanced networking enaSupport attribute set, use one of the
following commands. If the attribute is set, the response is true.
1280
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -
Schedule
a. From your local computer, check the EC2 instance ENA support attribute on your instance by
running one of the following commands. If the attribute is not enabled, the output will be "[]"
or blank. EnaSupport is set to false by default.
1281
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
If you encounter problems when you restart the instance, you can also disable ENA support
using one of the following commands:
c. Verify that the attribute has been set to true using describe-instances or Get-EC2Instance as
shown previously. You should now see the following output:
[
true
]
6. From your local computer, start the instance using the Amazon EC2 console or one of the following
commands: start-instances (AWS CLI/AWS CloudShell), Start-EC2Instance (AWS Tools for Windows
PowerShell). If your instance is managed by AWS OpsWorks, you should start the instance using the
AWS OpsWorks console so that the instance state remains in sync.
7. On the instance, validate that the ENA driver is installed and enabled as follows:
a. Right-click the network icon and choose Open Network and Sharing Center.
b. Choose the Ethernet adapter (for example, Ethernet 2).
c. Choose Details. For Network Connection Details, check that Description is Amazon Elastic
Network Adapter.
8. (Optional) Create an AMI from the instance. The AMI inherits the enaSupport attribute from the
instance. Therefore, you can use this AMI to launch another instance with ENA enabled by default.
For more information, see Create a custom Windows AMI (p. 143).
If you use an instance store volume to store data while the instance is running, that data is erased when
you stop the instance. Before you stop your instance, verify that you've copied any data that you need
from your instance store volumes to persistent storage, such as Amazon EBS or Amazon S3.
Prerequisites
To install or upgrade the ENA driver, your Windows instance must meet the following prerequisites:
1282
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
You can use the Systems Manager Distributor feature to deploy packages to your Systems Manager
managed nodes. With Systems Manager Distributor, you can install the ENA driver package once,
or with scheduled updates. For more information about how to install the ENA driver package
(AwsEnaNetworkDriver) with Systems Manager Distributor, see Install or update packages in the
AWS Systems Manager User Guide.
PowerShell
This section covers how to download and install ENA driver packages on your instance with
PowerShell cmdlets.
Note
Alternatively, you can download the latest driver package from a browser window on
your instance.
3. Use the expand-archive cmdlet to extract the zip archive that you downloaded to your instance:
The install steps are the same whether you've downloaded the latest driver or a specific version. To
install the ENA driver, follow these steps.
1283
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
1. To install the driver, run the install.ps1 PowerShell script from the AwsEnaNetworkDriver
directory on your instance. If you get an error, make sure that you’re using PowerShell 3.0 or
later.
2. If the installer doesn’t automatically reboot your instance, run the Restart-Computer
PowerShell cmdlet.
PS C:\> Restart-Computer
1284
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
The following table shows the corresponding ENA driver version to download for each Windows Server
version.
ENA Windows driver version 2.5.0 has been rolled back due
to failure to initialize on the Windows domain controller.
Windows Client and Windows Server are unaffected.
Bug Fix
1285
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
Bug Fix
Bug Fix
1286
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
Performance Optimizations
Bug Fix
Bug Fixes
1287
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Elastic Network Adapter (ENA)
2.1.0 ENA Windows driver v2.1 introduces new ENA device July 1, 2019
capabilities, provides a performance boost, adds new
features, and includes multiple stability improvements.
• New features
• Use standardized Windows registry key for Jumbo
frames configuration.
• Allow VLAN ID setting via the ENA driver properties GUI.
• Improved Recovery flows
• Improved failure identification mechanism.
• Added support for tunable recovery parameters.
• Support up to 32 I/O queues for newer EC2 instances
that have more than 8 vCPUs.
• ~90% reduction of driver memory footprint.
• Performance optimizations
• Reduced transmit path latency.
• Support for receive checksum offload.
• Performance optimization for heavily loaded system
(optimized usage of locking mechanisms).
• Further enhancements to reduce CPU utilization and
improve system responsiveness under load.
• Bug Fixes
• Fix crash due to invalid parsing of non-contiguous Tx
headers.
• Fix driver v1.5 crash during the elastic network interface
detach on Bare Metal instances.
• Fix LSO pseudo-header checksum calculation error over
IPv6.
• Fix potential memory resource leak upon initialization
failure.
• Disable TCP/UDP checksum offload for IPv4 fragments.
• Fix for VLAN configuration. VLAN was incorrectly
disabled when only VLAN priority should have been
disabled.
• Enable correct parsing of custom driver messages by the
event viewer.
• Fix failure to initialize driver due to invalid timestamp
handling.
• Fix race condition between data processing and ENA
device disabling.
1.2.3 Includes reliability fixes and unifies support for Windows February 13, 2018
Server 2008 R2 through Windows Server 2016.
1288
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
1.0.8 The initial release. Included in AMIs for Windows Server July 2016
2008 R2, Windows Server 2012 RTM, Windows Server 2012
R2, and Windows Server 2016.
Subscribe to notifications
Amazon SNS can notify you when new versions of EC2 Windows Drivers are released. Use the following
procedure to subscribe to these notifications.
arn:aws:sns:us-east-1:801119661308:ec2-windows-drivers
b. For Protocol, choose Email.
c. For Endpoint, enter an email address that you can use to receive the notifications.
d. Choose Create subscription.
6. You'll receive a confirmation email. Open the email and follow the directions to complete your
subscription.
Whenever new EC2 Windows drivers are released, we send notifications to subscribers. If you no longer
want to receive these notifications, use the following procedure to unsubscribe.
• Increases the maximum bandwidth a single flow can use from 5 Gbps to 25 Gbps within the subnet.
• Reduces tail latency of network traffic between EC2 instances, especially during periods of high
network load.
1289
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
Note
If your application sends or receives a high volume of packets per second, and needs to optimize
for latency most of the time, especially during periods when there is no congestion on the
network, Enhanced networking (p. 1278) might be a better fit for your network.
During periods of time when network traffic is light, you might notice a slight increase in packet latency
(tens of microseconds) when the packet uses ENA Express. During those times, applications that prioritize
specific network performance characteristics can benefit from ENA Express as follows:
• Processes can benefit from increased maximum single flow bandwidth from 5 Gbps to 25 Gbps within
the same subnet.
• Longer running processes should experience reduced tail latency during periods of network
congestion.
• Processes can benefit from a smoother and more standard distribution for network response times.
To ensure that ENA Express can manage network traffic as intended, sending and receiving instances and
the communication between them must meet all of the following requirements:
• Both sending and receiving instance types are supported. See the Supported instance types for ENA
Express (p. 1291) table for more information.
• Both sending and receiving instances must have ENA Express configured. If there are differences in the
configuration, you can run into situations where traffic defaults to standard ENA transmission. The
following scenario shows what can happen.
Instance 2 Yes No
In this case, TCP traffic between the two instances can use ENA Express, as both instances
have enabled it. However, since one of the instances does not use ENA Express for UDP traffic,
communication between these two instances over UDP uses standard ENA transmission.
• The sending and receiving instances must run in the same subnet.
• The network path between the instances must not include middleware boxes. ENA Express doesn't
currently support middleware boxes.
• To utilize full bandwidth potential, use driver version 2.2.9 or higher.
If any requirement is unmet, the instances use the standard TCP/UDP protocol but without SRD to
communicate.
1290
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
Note
Amazon EC2 refers to the relationship between an instance and a network interface that's
attached to it as an attachment. ENA Express settings apply to the attachment. If the network
interface is detached from the instance, the attachment no longer exists, and the ENA
Express settings that applied to it are no longer in force. The same is true when an instance is
terminated, even if the network interface remains.
General purpose
m6i.32xlarge x86_64
m6i.metal x86_64
m6id.32xlarge x86_64
m6id.metal x86_64
Compute optimized
c6i.32xlarge x86_64
c6i.metal x86_64
c6id.32xlarge x86_64
c6id.metal x86_64
Memory optimized
r6i.32xlarge x86_64
r6i.metal x86_64
r6id.32xlarge x86_64
r6id.metal x86_64
Storage optimized
i4i.32xlarge x86_64
i4i.metal x86_64
Console
This tab covers how to find information about your current ENA Express settings and to view
instance type support in the AWS Management Console.
1291
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
AWS CLI
This tab covers how to find information about your current ENA Express settings and to view
instance type support in the AWS CLI.
For information on instance type settings for a specific instance type, run the describe-instance-
types command in the AWS CLI, and substitute the instance type as follows:
1292
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
For information on instance type settings, run the describe-network-interfaces command in the AWS
CLI as follows:
Console
This tab covers how to manage ENA Express settings for network interfaces that are attached to an
instance.
1293
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ENA Express
Note
If the network interface you selected is not attached to an instance, this action does not
appear in the menu.
5. To use ENA Express, select the Enable check box.
6. When ENA Express is enabled, you can configure UDP settings. To use ENA Express UDP, select
the Enable check box.
7. To save your settings, choose Save.
Configure ENA Express when you attach a network interface to an EC2 instance
AWS CLI
This tab covers how to configure ENA Express settings in the AWS CLI.
To configure ENA Express when you attach a network interface to an instance, run the attach-
network-interface command in the AWS CLI, as shown in the following examples:
Example 1: Use ENA Express for TCP traffic, but not for UDP traffic
1294
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Intel 82599 VF
Example 2: Use ENA Express for both TCP traffic and UDP traffic
To update ENA Express settings for a network interface that's attached to an instance, run the
modify-network-interface-attribute command in the AWS CLI, as shown in the following examples:
Example 1: Use ENA Express for TCP traffic, but not for UDP traffic
Example 2: Use ENA Express for both TCP traffic and UDP traffic
Contents
1295
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Intel 82599 VF
Requirements
To prepare for enhanced networking using the Intel 82599 VF interface, set up your instance as follows:
• Select from the following supported instance types: C3, C4, D2, I2, M4 (excluding m4.16xlarge), and
R3.
• Launch the instance from a 64-bit HVM AMI. You can't enable enhanced networking on Windows
Server 2008 and Windows Server 2003. Enhanced networking is already enabled for Windows Server
2012 R2 and Windows Server 2016 and later AMIs. Windows Server 2012 R2 includes Intel driver
1.0.15.3 and we recommend that you upgrade that driver to the latest version using the Pnputil.exe
utility.
• Ensure that the instance has internet connectivity.
• Use AWS CloudShell from the AWS Management Console, or install and configure the AWS CLI or
the AWS Tools for Windows PowerShell on any computer you choose, preferably your local desktop
or laptop. For more information, see Access Amazon EC2 (p. 3) or the AWS CloudShell User Guide.
Enhanced networking cannot be managed from the Amazon EC2 console.
• If you have important data on the instance that you want to preserve, you should back that data
up now by creating an AMI from your instance. Updating kernels and kernel modules, as well as
enabling the sriovNetSupport attribute, might render incompatible instances or operating systems
unreachable. If you have a recent backup, your data will still be retained if this happens.
Driver
To verify that the driver is installed, connect to your instance and open Device Manager. You should see
"Intel(R) 82599 Virtual Function" listed under Network adapters.
To check whether an instance has the enhanced networking sriovNetSupport attribute set, use one of
the following commands:
If the attribute isn't set, SriovNetSupport is empty. If the attribute is set, the value is simple, as shown
in the following example output.
"SriovNetSupport": {
1296
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Intel 82599 VF
"Value": "simple"
},
To check whether an AMI already has the enhanced networking sriovNetSupport attribute set, use
one of the following commands:
If the attribute isn't set, SriovNetSupport is empty. If the attribute is set, the value is simple.
PS C:\> C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -
Schedule
Important
The administrator password will reset when you enable the initialize instance EC2 Launch
script. You can modify the configuration file to disable the administrator password reset by
specifying it in the settings for the initialization tasks. For steps on how to disable password
reset, see Configure initialization tasks (p. 705).
3. From the instance, download the Intel network adapter driver for your operating system:
• Windows Server 2019 including for Server version 1809 and later*
1297
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Intel 82599 VF
*Server versions 1803 and earlier as well as 1809 and later are not specifically addressed on the Intel
Drivers and Software pages.
4. Install the Intel network adapter driver for your operating system.
• Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, and Windows Server
2012
1. In the Downloads folder, extract the contents of the Wired_driver_version_x64.zip file.
2. In the extracted folder, locate the Wired_driver_version_x64.exe file and rename it to
Wired_driver_version_x64.zip.
3. Extract the contents of the Wired_driver_version_x64.zip file.
4. Open the command line, navigate to the extracted folder, and run one of the following
commands to use the pnputil utility to add and install the INF file in the driver store.
• Windows Server 2019
5. From your local computer, stop the instance using the Amazon EC2 console or one of the following
commands: stop-instances (AWS CLI), Stop-EC2Instance (AWS Tools for Windows PowerShell). If your
instance is managed by AWS OpsWorks, you should stop the instance in the AWS OpsWorks console
so that the instance state remains in sync.
6. From your local computer, enable the enhanced networking attribute using one of the following
commands:
1298
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Operating system optimizations
7. (Optional) Create an AMI from the instance, as described in Create a custom Windows AMI (p. 143).
The AMI inherits the enhanced networking attribute from the instance. Therefore, you can use this
AMI to launch another instance with enhanced networking enabled by default.
8. From your local computer, start the instance using the Amazon EC2 console or one of the following
commands: start-instances (AWS CLI), Start-EC2Instance (AWS Tools for Windows PowerShell). If
your instance is managed by AWS OpsWorks, you should start the instance in the AWS OpsWorks
console so that the instance state remains in sync.
In addition to these operating system optimizations, you should also consider the maximum transmission
unit (MTU) of your network traffic, and adjust according to your workload and network architecture. For
more information, see Network maximum transmission unit (MTU) for your EC2 instance (p. 1319).
AWS regularly measures average round trip latencies between instances launched in a cluster placement
group of 50us and tail latencies of 200us at the 99.9 percentile. If your applications require consistently
low latencies, we recommend using the latest version of the ENA drivers on fixed performance instances
built on the Nitro System.
Windows is hyper-thread aware and will ensure the RSS queues of a single NIC are always placed on
different physical cores. Therefore, unless hyper-threading is disabled, in order to completely prevent
contention with other NICs, spread the RSS configuration of each NIC among a range of 16 logical
processors. The Set-NetAdapterRss cmdlet allows you to define the per-NIC range of valid logical
processors by defining the values of BaseProcessorGroup, BaseProcessorNumber, MaxProcessingGroup,
MaxProcessorNumber, and NumaNode (optional). If there are not enough physical cores to completely
eliminate inter-NIC contention, minimize the overlapping ranges or reduce the number of logical
processors in the ENI ranges depending on the expected workload of the ENI (in other words, a low
volume admin network ENI may not need as many RSS queues assigned). Also, as previously noted,
1299
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network performance metrics
various components must run on CPU 0, and therefore we recommend excluding it from all RSS
configurations when sufficient vCPUs are available.
For example, when there are three ENIs on a 72 vCPU instance with 2 NUMA nodes with hyper-threading
enabled, the following commands spread the network load between the two CPUs without overlap and
prevent the use of core 0 completely.
Note that these settings are persistent for each network adapter. If an instance is resized to one with
a different number of vCPUs, you should reevaluate the RSS configuration for each enabled ENI. The
complete Microsoft documentation for the Set-NetAdapterRss cmdlet can be found here: https://
docs.microsoft.com/en-us/powershell/module/netadapter/set-netadapterrss.
Special note for SQL workloads: We also recommend that you review your I/O thread affinity settings
along with your ENI RSS configuration to minimize I/O and network contention for the same CPUs. See
affinity mask Server Configuration Option.
Amazon EC2 defines network maximums at the instance level to ensure a high-quality networking
experience, including consistent network performance across instance sizes. AWS provides maximums for
the following for each instance:
• Bandwidth capability – Each EC2 instance has a maximum bandwidth for aggregate inbound and
outbound traffic, based on instance type and size. Some instances use a network I/O credit mechanism
to allocate network bandwidth based on average bandwidth utilization. Amazon EC2 also has
maximum bandwidth for traffic to AWS Direct Connect and the internet. For more information, see
Amazon EC2 instance network bandwidth (p. 1276).
• Packet-per-second (PPS) performance – Each EC2 instance has a maximum PPS performance, based
on instance type and size.
• Connections tracked – The security group tracks each connection established to ensure that return
packets are delivered as expected. There is a maximum number of connections that can be tracked per
instance. For more information, see Security group connection tracking (p. 1491)
• Link-local service access – Amazon EC2 provides a maximum PPS per network interface for traffic to
services such as the DNS service, the Instance Metadata Service, and the Amazon Time Sync Service.
When the network traffic for an instance exceeds a maximum, AWS shapes the traffic that exceeds the
maximum by queueing and then dropping network packets. You can monitor when traffic exceeds a
maximum using the network performance metrics. These metrics inform you, in real time, of impact to
network traffic and possible network performance issues.
Contents
• Requirements (p. 1301)
• Metrics for the ENA driver (p. 1301)
1300
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network performance metrics
• View the network performance metrics for your Windows instance (p. 1302)
Requirements
• Install ENA driver version 2.2.2 or later. To verify the installed version, use Device Manager as follows.
1. Open Device Manager by running devmgmt.msc.
2. Expand Network Adapters.
3. Choose Amazon Elastic Network Adapter, Properties.
4. On the Driver tab, locate Driver Version.
1301
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement groups
Manifest installation
If you launched the instance using an AMI that contains ENA driver 2.2.2 or later, or used the install
script in the driver package for ENA driver 2.2.2, the manifest is already installed. To install the manifest
manually, use the following steps:
unlodctr /m:EnaPerfCounters.man
2. Copy the manifest file EnaPerfCounters.man from the driver installation package to
%SystemRoot%\System32\drivers.
3. Install the new manifest using the following command:
lodctr /m:EnaPerfCounters.man
Placement groups
When you launch a new EC2 instance, the EC2 service attempts to place the instance in such a way that
all of your instances are spread out across underlying hardware to minimize correlated failures. You can
use placement groups to influence the placement of a group of interdependent instances to meet the
needs of your workload. Depending on the type of workload, you can create a placement group using
one of the following placement strategies:
• Cluster – packs instances close together inside an Availability Zone. This strategy enables workloads
to achieve the low-latency network performance necessary for tightly-coupled node-to-node
communication that is typical of high-performance computing (HPC) applications.
• Partition – spreads your instances across logical partitions such that groups of instances in one
partition do not share the underlying hardware with groups of instances in different partitions. This
1302
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement group strategies
strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra,
and Kafka.
• Spread – strictly places a small group of instances across distinct underlying hardware to reduce
correlated failures.
The following image shows instances that are placed into a cluster placement group.
Cluster placement groups are recommended for applications that benefit from low network latency,
high network throughput, or both. They are also recommended when the majority of the network
traffic is between the instances in the group. To provide the lowest latency and the highest packet-per-
second network performance for your placement group, choose an instance type that supports enhanced
networking. For more information, see Enhanced Networking (p. 1278).
• Use a single launch request to launch the number of instances that you need in the placement group.
• Use the same instance type for all instances in the placement group.
If you try to add more instances to the placement group later, or if you try to launch more than one
instance type in the placement group, you increase your chances of getting an insufficient capacity error.
If you stop an instance in a placement group and then start it again, it still runs in the placement group.
However, the start fails if there isn't enough capacity for the instance.
1303
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement group strategies
If you receive a capacity error when launching an instance in a placement group that already has running
instances, stop and start all of the instances in the placement group, and try the launch again. Starting
the instances may migrate them to hardware that has capacity for all of the requested instances.
The following image is a simple visual representation of a partition placement group in a single
Availability Zone. It shows instances that are placed into a partition placement group with three
partitions—Partition 1, Partition 2, and Partition 3. Each partition comprises multiple instances. The
instances in a partition do not share racks with the instances in the other partitions, allowing you to
contain the impact of a single hardware failure to only the associated partition.
Partition placement groups can be used to deploy large distributed and replicated workloads, such as
HDFS, HBase, and Cassandra, across distinct racks. When you launch instances into a partition placement
group, Amazon EC2 tries to distribute the instances evenly across the number of partitions that you
specify. You can also launch instances into a specific partition to have more control over where the
instances are placed.
A partition placement group can have partitions in multiple Availability Zones in the same Region. A
partition placement group can have a maximum of seven partitions per Availability Zone. The number
of instances that can be launched into a partition placement group is limited only by the limits of your
account.
In addition, partition placement groups offer visibility into the partitions — you can see which instances
are in which partitions. You can share this information with topology-aware applications, such as HDFS,
HBase, and Cassandra. These applications use this information to make intelligent data replication
decisions for increasing data availability and durability.
If you start or launch an instance in a partition placement group and there is insufficient unique
hardware to fulfill the request, the request fails. Amazon EC2 makes more distinct hardware available
over time, so you can try your request again later.
Spread placement groups are recommended for applications that have a small number of critical
instances that should be kept separate from each other. Launching instances in a spread level placement
1304
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement group rules and limitations
group reduces the risk of simultaneous failures that might occur when instances share the same
equipment. Spread level placement groups provide access to distinct hardware, and are therefore
suitable for mixing instance types or launching instances over time.
If you start or launch an instance in a spread placement group and there is insufficient unique hardware
to fulfill the request, the request fails. Amazon EC2 makes more distinct hardware available over time,
so you can try your request again later. Placement groups can spread instances across racks or hosts. You
can use host level spread placement groups only with AWS Outposts.
The following image shows seven instances in a single Availability Zone that are placed into a spread
placement group. The seven instances are placed on seven different racks, each rack has its own network
and power source.
A rack spread placement group can span multiple Availability Zones in the same Region. For rack spread
level placement groups, you can have a maximum of seven running instances per Availability Zone per
group.
Host spread level placement groups are only available with AWS Outposts. For host spread level
placement groups, there are no restrictions for running instances per Outposts. For more information,
see the section called “Placement groups on AWS Outposts” (p. 1318).
• You can create a maximum of 500 placement groups per account in each Region.
• The name that you specify for a placement group must be unique within your AWS account for the
Region.
• You can't merge placement groups.
• An instance can be launched in one placement group at a time; it cannot span multiple placement
groups.
• On-Demand Capacity Reservation (p. 494) and zonal Reserved Instances (p. 342) provide a capacity
reservation for EC2 instances in a specific Availability Zone. The capacity reservation can be used by
instances in a placement group. When using a cluster placement group with capacity reservation, it is
recommended that you reserve capacity within the cluster placement group. For more information, see
Capacity Reservations in cluster placement groups.
1305
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement group rules and limitations
Zonal Reserved Instances (p. 342) provide a capacity reservation for instances in a specific Availability
Zone. The capacity reservation can be used by instances in a placement group. However, it is not
possible to explicitly reserve capacity in a placement group using a zonal Reserved Instance.
• You cannot launch Dedicated Hosts in placement groups.
• A partition placement group supports a maximum of seven partitions per Availability Zone. The
number of instances that you can launch in a partition placement group is limited only by your account
limits.
• When instances are launched into a partition placement group, Amazon EC2 tries to evenly distribute
the instances across all partitions. Amazon EC2 doesn’t guarantee an even distribution of instances
across all partitions.
• A partition placement group with Dedicated Instances can have a maximum of two partitions.
• Capacity Reservations do not reserve capacity in a partition placement group.
• A rack spread placement group supports a maximum of seven running instances per Availability
Zone. For example, in a Region with three Availability Zones, you can run a total of 21 instances in
the group, with seven instances in each Availability Zone. If you try to start an eighth instance in the
1306
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
same Availability Zone and in the same spread placement group, the instance will not launch. If you
need more than seven instances in an Availability Zone, we recommend that you use multiple spread
placement groups. Using multiple spread placement groups does not provide guarantees about the
spread of instances between groups, but it does help ensure the spread for each group, thus limiting
the impact from certain classes of failures.
• Spread placement groups are not supported for Dedicated Instances.
• Host level spread placement groups are only supported for placement groups on AWS Outposts. There
are no restrictions for the number of running instances with host level spread placement groups.
• Capacity Reservations do not reserve capacity in a spread placement group.
Console
AWS CLI
1307
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
Use the create-placement-group command. The following example creates a placement group
named my-cluster that uses the cluster placement strategy, and it applies a tag with a key of
purpose and a value of production.
Use the create-placement-group command. Specify the --strategy parameter with the value
partition, and specify the --partition-count parameter with the desired number of
partitions. In this example, the partition placement group is named HDFS-Group-A and is created
with five partitions.
PowerShell
To create a placement group using the AWS Tools for Windows PowerShell
When you tag a placement group, the instances that are launched into the placement group are not
automatically tagged. You need to explicitly tag the instances that are launched into the placement
group. For more information, see Add a tag when you launch an instance (p. 1902).
You can view, add, and delete tags using the new console and the command line tools.
New console
You can view, add, and delete tags using one of the following methods.
Console
• To add a tag, choose Add tag, and then enter the tag key and value. You can add up to 50
tags per placement group. For more information, see Tag restrictions (p. 1898).
• To delete a tag, choose Remove next to the tag that you want to delete.
6. Choose Save changes.
AWS CLI
1308
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
Use the describe-tags command to view the tags for the specified resource. In the following
example, you describe the tags for all of your placement groups.
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "pg-0123456789EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
},
{
"Key": "Environment",
"ResourceId": "pg-9876543210EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
}
]
}
You can also use the describe-tags command to view the tags for a placement group by specifying
its ID. In the following example, you describe the tags for pg-0123456789EXAMPLE.
--filters Name=resource-id,Values=pg-0123456789EXAMPLE
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "pg-0123456789EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
}
]
}
You can also view the tags of a placement group by describing the placement group.
Use the describe-placement-groups command to view the configuration of the specified placement
group, which includes any tags that were specified for the placement group.
{
"PlacementGroups": [
{
"GroupName": "my-cluster",
"State": "available",
"Strategy": "cluster",
"GroupId": "pg-0123456789EXAMPLE",
"Tags": [
{
1309
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
"Key": "Environment",
"Value": "Production"
}
]
}
]
}
You can use the create-tags command to tag existing resources. In the following example, the
existing placement group is tagged with Key=Cost-Center and Value=CC-123.
You can use the delete-tags command to delete tags from existing resources. For examples, see
Examples in the AWS CLI Command Reference.
PowerShell
Console
• Under Instance type, select an instance type that can be launched into a placement group.
• In the Summary box, under Number of instances, enter the total number of instances that
you need in this placement group, because you might not be able to add instances to the
placement group later.
1310
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
• Under Advanced details, for Placement group name, you can choose to add the instances to
a new or existing placement group. If you choose a placement group with a partition strategy,
for Target partition, choose the partition in which to launch the instances.
Old Console
From the EC2 console dashboard, in the Launch instance box, choose Launch instance, and
then choose Launch instance from the options that appear. Complete the wizard as directed,
taking care to do the following:
• On the Choose an Instance Type page, select an instance type that can be launched into a
placement group.
• On the Configure Instance Details page, the following fields are applicable to placement
groups:
• For Number of instances, enter the total number of instances that you need in this
placement group, because you might not be able to add instances to the placement group
later.
• For Placement group, select the Add instance to placement group check box. If you do not
see Placement group on this page, verify that you have selected an instance type that can
be launched into a placement group. Otherwise, this option is not available.
• For Placement group name, you can choose to add the instances to an existing placement
group or to a new placement group that you create.
• For Placement group strategy, choose the appropriate strategy. If you choose partition,
for Target partition, choose Auto distribution to have Amazon EC2 do a best effort to
distribute the instances evenly across all the partitions in the group. Alternatively, specify
the partition in which to launch the instances.
AWS CLI
Use the run-instances command and specify the placement group name using the --placement
"GroupName = my-cluster" parameter. In this example, the placement group is named my-
cluster.
To launch instances into a specific partition of a partition placement group using the AWS CLI
Use the run-instances command and specify the placement group name and partition using the
--placement "GroupName = HDFS-Group-A, PartitionNumber = 3" parameter. In this
example, the placement group is named HDFS-Group-A and the partition number is 3.
PowerShell
To launch instances into a placement group using AWS Tools for Windows PowerShell
1311
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
Use the New-EC2Instance command and specify the placement group name using the -
Placement_GroupName parameter.
Console
To view the placement group and partition number of an instance using the console
AWS CLI
To view the partition number for an instance in a partition placement group using the AWS CLI
The response contains the placement information, which includes the placement group name and
the partition number for the instance.
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 3,
"Tenancy": "default"
}
To filter instances for a specific partition placement group and partition number using the AWS
CLI
Use the describe-instances command and specify the --filters parameter with the placement-
group-name and placement-partition-number filters. In this example, the placement group is
named HDFS-Group-A and the partition number is 7.
The response lists all the instances that are in the specified partition within the specified placement
group. The following is example output showing only the instance ID, instance type, and placement
information for the returned instances.
"Instances": [
1312
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
{
"InstanceId": "i-0a1bc23d4567e8f90",
"InstanceType": "r4.large",
},
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
{
"InstanceId": "i-0a9b876cd5d4ef321",
"InstanceType": "r4.large",
},
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
],
Before you move or remove the instance, the instance must be in the stopped state. You can move or
remove an instance using the AWS CLI or an AWS SDK.
AWS CLI
PowerShell
To move an instance to a placement group using the AWS Tools for Windows PowerShell
1313
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Working with placement groups
AWS CLI
PowerShell
To remove an instance from a placement group using the AWS Tools for Windows
PowerShell
Requirement
Before you can delete a placement group, it must contain no instances. You can terminate (p. 602) all
instances that you launched in the placement group, move (p. 1313)instances to another placement
group, or remove (p. 1314) instances from the placement group.
Console
AWS CLI
Use the delete-placement-group command and specify the placement group name to delete the
placement group. In this example, the placement group name is my-cluster.
1314
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share a placement group
PowerShell
To delete a placement group using the AWS Tools for Windows PowerShell
Note
The AWS account from which you want to share a placement group must have the following
permissions in the IAM policy.
• ec2:PutResourcePolicy
• ec2:DeleteResourcePolicy
Topics
• Rules and limitations (p. 1315)
• Share across Availability Zones (p. 1316)
• Share a placement group (p. 1316)
• Identify a shared placement group (p. 1316)
• Launch an instance in a shared placement group (p. 1317)
• Unshare a shared placement group (p. 1318)
• To share a placement group, you must own it in your AWS account. You cannot share a placement
group that has been shared with you.
• When you share a partition or spread placement group, the placement group limits do not change. A
shared partition placement group supports a maximum of seven partitions per Availability Zone, and a
shared spread placement group supports a maximum of seven running instances per Availability Zone.
• To share a placement group with your AWS organization or an organizational unit in your AWS
organization, you must enable sharing with AWS Organizations. For more information, see Sharing
your AWS resources.
• You are responsible for managing the instances owned by you in a shared placement group.
1315
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share a placement group
• You cannot view or modify instances and capacity reservations that are associated with a shared
placement group but not owned by you.
To identify the location of your Dedicated Hosts relative to your accounts, you must use the Availability
Zone ID (AZ ID). The Availability Zone ID is a unique and consistent identifier for an Availability Zone
across all AWS accounts. For example, use1-az1 is an Availability Zone ID for the us-east-1 Region
and it is the same location in every AWS account.
To view the Availability Zone IDs for the Availability Zones in your account:
If you are part of an organization in AWS Organizations sharing within your organization is enabled,
consumers in your organization are granted access to the shared placement group.
If the placement group is shared with an AWS account outside of your organization, the AWS account
owner will receive an invitation to join the resource share. They can access the shared placement group
after accepting the invitation.
You can share a placement group across AWS accounts using https://console.aws.amazon.com/ram or
AWS CLI.
1. Open https://console.aws.amazon.com/ec2/.
2. In the left navigation pane, choose Placement Groups.
1316
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share a placement group
3. The Placement Groups screen on the right lists all the placement groups owned by you and
shared with you. The Amazon Resource Name (ARN) of a placement group contains the details
of its owner.
AWS CLI
The describe-placement-groups command lists all the placement groups owned by you and
shared with you. The Amazon Resource Name (ARN) of a placement group contains the details of its
owner.
You can use the Placement Group Name only if you are the owner of the placement group being shared.
We recommend using the Placement Group Group Id to avoid potential placement group name collisions
between AWS accounts.
You can find the Group Id of a placement group using the describe-placement-groups command
or in the https://console.aws.amazon.com/ec2/ on the Placement Groups screen under Network &
Security.
• On the Choose an Instance Type page, select an instance type that can be launched into a
placement group.
• On the Configure Instance Details page, the following fields are applicable to placement
groups:
• For Number of instances, enter the total number of instances that you need in this
placement group, because you might not be able to add instances to the placement group
later.
• For Placement group, select the Add instance to placement group check box. If you do not
see Placement group on this page, verify that you have selected an instance type that can
be launched into a placement group. Otherwise, this option is not available.
• For Placement group name, you can choose to add the instances to an existing placement
group or to a new placement group that you create.
• For Placement group strategy, choose the appropriate strategy. If you choose partition,
for Target partition, choose Auto distribution to have Amazon EC2 do a best effort to
distribute the instances evenly across all the partitions in the group. Alternatively, specify
the partition in which to launch the instances.
AWS CLI
Use the run-instances command and specify the placement group Group Id.
1317
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Placement groups on AWS Outposts
Use the run-instances command and specify the Group Id and PartitionNumber of the shared
placement group.
Tip
Use VPC peering to connect instances owned by separate AWS accounts and get the full latency
benefits offered by shared cluster placement groups. For more information, see What is VPC
peering?
When you unshare a shared placement group, the following changes will take effect.
• The AWS accounts with which a placement group was shared will no longer be able to launch instances
or reserve capacity.
• If your instances were running in a shared placement group, they will be disassociated from the
placement group but continue to run normally in your AWS account.
• If you had capacity reservations in a shared placement group, they will be disassociated from the
placement group but you will continue to have access to them in your AWS account.
You can unshare a shared placement group using one of the following methods.
To unshare a shared placement group using AWS Command Line Interface, use the disassociate-
resource-share command.
An Outpost is a pool of AWS compute and storage capacity deployed at a customer site. AWS operates,
monitors, and manages this capacity as part of an AWS Region.
You can create placement groups on Outposts that you have created in your account. This allows you
to spread out instances across underlying hardware on an Outpost at your site. You create and use
placement groups on Outposts in the same way that you create and use placement groups in regular
Availability Zones. When you create a placement group with a spread strategy on an Outpost, you can
1318
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network MTU
choose to have the placement group spread instances across hosts or racks. Spreading instances across
hosts allows you to use a spread strategy with a single rack Outpost.
Prerequisite
You must have an Outpost installed at your site. For more information, see Create an Outpost and order
Outpost capacity in the AWS Outposts User Guide.
1. Create a subnet on the Outpost. For more information, see Create a subnet in the AWS Outposts User
Guide.
2. Create a placement group in the associated Region of the Outpost. If you create a placement group
with a spread strategy, you can choose host or rack spread level to determine how the group will
spread instances across the underlying hardware on your Outpost. For more information, see the
section called “Create a placement group” (p. 1307).
3. Launch an instance into the placement group. For Subnet choose the subnet that you created in
Step 1, and for Placement group name, select the placement group that you created in Step 2. For
more information, see Launch an instance on the Outpost in the AWS Outposts User Guide.
Ethernet frames can come in different formats, and the most common format is the standard Ethernet
v2 frame format. It supports 1500 MTU, which is the largest Ethernet packet size supported over most of
the internet. The maximum supported MTU for an instance depends on its instance type.
• Traffic that goes from one instance to another within a VPC in the same Wavelength Zone has an MTU
of 1300.
• Traffic that goes from one instance to another that uses the carrier IP within a Wavelength Zone has an
MTU of 1500.
• Traffic that goes from one instance to another between a Wavelength Zone and the Region that uses a
public IP address has an MTU of 1500.
• Traffic that goes from one instance to another between a Wavelength Zone and the Region that uses a
private IP address has an MTU of 1300.
To see Network MTU information for Linux instances, switch to this page in the Amazon EC2 User Guide
for Linux Instances guide: Network maximum transmission unit (MTU) for your EC2 instance.
Contents
• Jumbo frames (9001 MTU) (p. 1320)
• Path MTU Discovery (p. 1320)
• Check the path MTU between two hosts (p. 1321)
• Check and set the MTU on your Windows instance (p. 1321)
1319
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Jumbo frames (9001 MTU)
If packets are over 1500 bytes, they are fragmented, or they are dropped if the Don't Fragment flag is
set in the IP header.
Jumbo frames should be used with caution for internet-bound traffic or any traffic that leaves a VPC.
Packets are fragmented by intermediate systems, which slows down this traffic. To use jumbo frames
inside a VPC and not slow traffic that's bound for outside the VPC, you can configure the MTU size by
route, or use multiple elastic network interfaces with different MTU sizes and different routes.
For instances that are collocated inside a cluster placement group, jumbo frames help to achieve the
maximum network throughput possible, and they are recommended in this case. For more information,
see Placement groups (p. 1302).
You can use jumbo frames for traffic between your VPCs and your on-premises networks over AWS Direct
Connect. For more information, and for how to verify Jumbo Frame capability, see Setting Network MTU
in the AWS Direct Connect User Guide.
All Amazon EC2 instance types support 1500 MTU and all current generation instance types (p. 212)
support jumbo frames. The following previous generation instance types support jumbo frames: A1, C3,
G2, I2, M3, and R3.
For more information about supported MTU sizes for transit gateways, see MTU in Amazon VPC Transit
Gateways.
For IPv4, when a host sends a packet that's larger than the MTU of the receiving host or that's larger
than the MTU of a device along the path, the receiving host or device drops the packet, and then returns
the following ICMP message: Destination Unreachable: Fragmentation Needed and Don't
Fragment was Set (Type 3, Code 4). This instructs the transmitting host to split the payload into
multiple smaller packets, and then retransmit them.
The IPv6 protocol does not support fragmentation in the network. When a host sends a packet that's
larger than the MTU of the receiving host or that's larger than the MTU of a device along the path,
the receiving host or device drops the packet, and then returns the following ICMP message: ICMPv6
1320
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Check the path MTU between two hosts
Packet Too Big (PTB) (Type 2). This instructs the transmitting host to split the payload into multiple
smaller packets, and then retransmit them.
By default, security groups do not allow any inbound ICMP traffic. If you don't explicitly configure an
ICMP inbound rule for your security group, PMTUD is blocked. For more information about configuring
ICMP rules in a network ACL, see Path MTU Discovery in the Amazon VPC User Guide.
Important
Path MTU Discovery does not guarantee that jumbo frames will not be dropped by some
routers. An internet gateway in your VPC will forward packets up to 1500 bytes only. 1500 MTU
packets are recommended for internet traffic.
.\mturoute.exe www.elifulkerson.com
* ICMP Fragmentation is not permitted. *
* Speed optimization is enabled. *
* Maximum payload is 10000 bytes. *
+ ICMP payload of 1472 bytes succeeded.
- ICMP payload of 1473 bytes is too big.
Path MTU: 1500 bytes.
If your instance runs in a Wavelength Zone, the maximum MTU value is 1300.
ENA Driver
For Driver Versions 1.5 and Earlier
You can change the MTU setting using Device Manager or the Set-NetAdapterAdvancedProperty
command.
To get the current MTU setting using the Get-NetAdapterAdvancedProperty command, use the
following command. Check the entry for the interface name MTU. A value of 9001 indicates that Jumbo
frames are enabled. Jumbo frames are disabled by default.
1321
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Check and set the MTU on your Windows instance
You can change the MTU setting using Device Manager or the Set-NetAdapterAdvancedProperty
command.
To get the current MTU setting using the Get-NetAdapterAdvancedProperty command, use the
following command. Check the entry for the interface name *JumboPacket. A value of 9015 indicates
that Jumbo frames are enabled. Jumbo frames are disabled by default.
Run the following commands and include the Ethernet name you want to query.
To get the current MTU setting using the Get-NetAdapterAdvancedProperty command, use the
following command. Check the entry for the interface name *JumboPacket. A value of 9014 indicates
that Jumbo frames are enabled. (Note that the MTU size includes the header and the payload.) Jumbo
frames are disabled by default.
1322
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Troubleshoot
AWS PV driver
You cannot change the MTU setting using Device Manager, but you can change it using the netsh
command.
Get the current MTU setting using the following command. The name of the interface can vary. In the
output, look for an entry with the name "Ethernet," "Ethernet 2," or "Local Area Connection". You'll need
the interface name to enable or disable jumbo frames. A value of 9001 indicates that Jumbo frames are
enabled.
Troubleshoot
If you experience connectivity issues between your EC2 instance and an Amazon Redshift cluster when
using jumbo frames, see Queries Appear to Hang in the Amazon Redshift Management Guide
1323
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create additional VPCs
To create a VPC
1324
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Access the internet from your instances
• If your instances can be in a public subnet, select a nonzero value for Number of public
subnets. Keep both options under DNS options selected. You can optionally add private subnets
now or later on.
• If your instances must be in a private subnet, select 0 for Number of public subnets. For
Number of private subnets, select a number depending on your needs (the possible values
correspond to 1 or 2 private subnets per Availability Zone). For NAT gateways, if your instances
in both Availability Zones send or receive a significant volume of traffic across Availability Zones,
select 1 per AZ. Otherwise, select In 1 AZ and launch instances that send or receive cross-zone
traffic in the same Availability Zone as the NAT gateway.
8. Expand Customize subnet CIDR blocks. Either keep the default suggestions, or enter a CIDR block
for each subnet. For more information, see Subnet CIDR blocks in the Amazon VPC User Guide.
9. Review the Preview pane, which shows the VPC resources that will be created based on your
selections.
10. Choose Create VPC.
For the subnets that you create in your VPCs, do one of the following to ensure that instances that you
launch in these subnets have access to the internet:
• Configure an internet gateway. For more information, see Connect to the internet using an internet
gateway in the Amazon VPC User Guide.
• Configure a public NAT gateway. For more information, see Access the internet from a private subnet
in the Amazon VPC User Guide.
Contents
• AllJoyn Router (p. 1326)
• Cast to Device (p. 1326)
• Core Networking (p. 1328)
• Delivery Optimization (p. 1358)
• Diag Track (p. 1359)
• DIAL Protocol Server (p. 1359)
• Distributed File System (DFS) Management (p. 1359)
1325
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AllJoyn Router
AllJoyn Router
OS Rule Description Port Protocol Direction
Cast to Device
OS Rule Description Port Protocol Direction
1326
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Cast to Device
1327
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
Core Networking
Windows Server 2016, 2019, and 2022
1328
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1329
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
Internet IGMP 2 In
Group messages
Management are sent and
Protocol received by
(IGMP-In) nodes to
create, join,
and depart
multicast
groups.
1330
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1331
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1332
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1333
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1334
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1335
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1336
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1337
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1338
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1339
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1340
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1341
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1342
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1343
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1344
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1345
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1346
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1347
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1348
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1349
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1350
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1351
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1352
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1353
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1354
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1355
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1356
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Core Networking
1357
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Delivery Optimization
Delivery Optimization
Windows DeliveryOptimization-
Inbound Local: 7680 TCP In
Server 2019 TCP-In rule to allow
Delivery Remote: Any
Windows Optimization
Server 2022 to connect
to remote
endpoints.
DeliveryOptimization-
Inbound Local: 7680 UDP In
UDP-In rule to allow
Delivery Remote: Any
Optimization
to connect
to remote
endpoints.
1358
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Diag Track
Diag Track
Windows Server 2019 and 2022
1359
Amazon Elastic Compute Cloud
User Guide for Windows Instances
File and Printer Sharing
1360
Amazon Elastic Compute Cloud
User Guide for Windows Instances
File and Printer Sharing
1361
Amazon Elastic Compute Cloud
User Guide for Windows Instances
File Server Remote Management
1362
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ICMP v4 All
ICMP v4 All
Microsoft Edge
1363
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Multicast
Multicast
Windows Server 2019 and 2022
Remote Desktop
Windows Server 2012 R2, 2016, 2019, and 2022
1364
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Remote Desktop
1365
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows Device Management
1366
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows Device Management
1367
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows Feature Experience Pack
Windows
Server 2012
Windows
Server 2012 R2
Windows
Server 2016
Windows
Server 2019
1368
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EC2-Classic
For more information about Amazon EC2 security groups, see Amazon EC2 Security Groups for Windows
Instances.
EC2-Classic
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC (p. 1385).
With EC2-Classic, your instances run in a single, flat network that you share with other customers. With
Amazon VPC, your instances run in a virtual private cloud (VPC) that's logically isolated to your AWS
account.
The EC2-Classic platform was introduced in the original release of Amazon EC2. If you created your
AWS account after 2013-12-04, it does not support EC2-Classic, so you must launch your Amazon EC2
instances in a VPC.
1369
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Differences between instances in EC2-Classic and a VPC
If your account supports EC2-Classic but you have not created a nondefault VPC, you can do one of the
following to launch instances that require a VPC:
• Create a nondefault VPC and launch your VPC-only instance into it by specifying a subnet ID or a
network interface ID in the request. Note that you must create a nondefault VPC if you do not have
a default VPC and you are using the AWS CLI, Amazon EC2 API, or AWS SDK to launch a VPC-only
instance.
• Launch your VPC-only instance using the Amazon EC2 console. The Amazon EC2 console creates a
nondefault VPC in your account and launches the instance into the subnet in the first Availability Zone.
The console creates the VPC with the following attributes:
• One subnet in each Availability Zone, with the public IPv4 addressing attribute set to true so that
instances receive a public IPv4 address.
• An internet gateway, and a main route table that routes traffic in the VPC to the Internet gateway.
This enables the instances you launch in the VPC to communicate over the Internet. For more
information, see Internet gateways in the Amazon VPC User Guide.
• A default security group for the VPC and a default network ACL that is associated with each subnet.
For more information, see Default security groups and Default network ACLs in the Amazon VPC
User Guide.
If you have other resources in EC2-Classic, you can take steps to migrate them to a VPC. For more
information, see Migrate from EC2-Classic to a VPC (p. 1385).
Public IPv4 Your instance receives a Your instance launched in Your instance doesn't
address (from public IPv4 address from a default subnet receives receive a public IPv4
Amazon's the EC2-Classic public IPv4 a public IPv4 address address by default, unless
public IP address pool. by default, unless you you specify otherwise
address pool) specify otherwise during during launch, or you
launch, or you modify modify the subnet's public
the subnet's public IPv4 IPv4 address attribute.
address attribute.
Private IPv4 Your instance receives a Your instance receives a Your instance receives a
address private IPv4 address from static private IPv4 address static private IPv4 address
the EC2-Classic range each from the address range of from the address range of
time it's started. your default VPC. your VPC.
Multiple We select a single You can assign multiple You can assign multiple
private IPv4 private IP address for private IPv4 addresses to private IPv4 addresses to
addresses your instance; multiple your instance. your instance.
1370
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Differences between instances in EC2-Classic and a VPC
Reassociating If the Elastic IP address is If the Elastic IP address is If the Elastic IP address
an Elastic IP already associated with already associated with is already associated
address another instance, the another instance, the with another instance,
address is automatically address is automatically it succeeds only if you
associated with the new associated with the new allowed reassociation.
instance. instance.
Tagging Elastic You cannot apply tags to You can apply tags to an You can apply tags to an
IP addresses an Elastic IP address. Elastic IP address. Elastic IP address.
DNS DNS hostnames are DNS hostnames are DNS hostnames are
hostnames enabled by default. enabled by default. disabled by default.
Security group A security group can A security group can A security group can
reference security groups reference security groups reference security groups
that belong to other AWS for your VPC, or for a for your VPC only.
accounts. peer VPC in a VPC peering
connection.
Security group You can't change the You can assign up to 5 You can assign up to 5
association security groups of your security groups to an security groups to an
running instance. You can instance. instance.
either modify the rules
of the assigned security You can assign security You can assign security
groups, or replace the groups to your instance groups to your instance
instance with a new one when you launch it and when you launch it and
(create an AMI from the while it's running. while it's running.
instance, launch a new
instance from this AMI
with the security groups
that you need, disassociate
any Elastic IP address
from the original instance
and associate it with the
new instance, and then
terminate the original
instance).
Security group You can add rules for You can add rules for You can add rules for
rules inbound traffic only. inbound and outbound inbound and outbound
traffic. traffic.
1371
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Differences between instances in EC2-Classic and a VPC
Tenancy Your instance runs on You can run your instance You can run your instance
shared hardware. on shared hardware or on shared hardware or
single-tenant hardware. single-tenant hardware.
Accessing the Your instance can access By default, your instance By default, your instance
Internet the Internet. Your instance can access the Internet. cannot access the Internet.
automatically receives a Your instance receives Your instance doesn't
public IP address, and can a public IP address by receive a public IP address
access the Internet directly default. An Internet by default. Your VPC may
through the AWS network gateway is attached to have an Internet gateway,
edge. your default VPC, and your depending on how it was
default subnet has a route created.
to the Internet gateway.
IPv6 IPv6 addressing is not You can optionally You can optionally
addressing supported. You cannot associate an IPv6 CIDR associate an IPv6 CIDR
assign IPv6 addresses to block with your VPC, and block with your VPC, and
your instances. assign IPv6 addresses to assign IPv6 addresses to
instances in your VPC. instances in your VPC.
After you launch an instance in EC2-Classic, you can't change its security groups. However, you can
add rules to or remove rules from a security group, and those changes are automatically applied to all
instances that are associated with the security group after a short period.
Your AWS account automatically has a default security group per Region for EC2-Classic. If you try
to delete the default security group, you'll get the following error: Client.InvalidGroup.Reserved: The
security group 'default' is reserved.
You can create custom security groups. The security group name must be unique within your account for
the Region. To create a security group for use in EC2-Classic, choose No VPC for the VPC.
You can add inbound rules to your default and custom security groups. You can't change the outbound
rules for an EC2-Classic security group. When you create a security group rule, you can use a different
security group for EC2-Classic in the same Region as the source or destination. To specify a security
group for another AWS account, add the AWS account ID as a prefix; for example, 111122223333/sg-
edcd9784.
In EC2-Classic, you can have up to 500 security groups in each Region for each account. You can add
up to 100 rules to a security group. You can have up to 800 security group rules per instance. This is
calculated as the multiple of rules per security group and security groups per instance. If you reference
other security groups in your security group rules, we recommend that you use security group names
that are 22 characters or less in length.
If you create a custom firewall configuration in EC2-Classic, you must create a rule in your firewall that
allows inbound traffic from port 53 (DNS)—with a destination port from the ephemeral range—from
1372
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Share and access resources between EC2-Classic and a VPC
the address of the Amazon DNS server; otherwise, internal DNS resolution from your instances fails. If
your firewall doesn't automatically allow DNS query responses, then you need to allow traffic from the
IP address of the Amazon DNS server. To get the IP address of the Amazon DNS server, use the following
command from within your instance:
Elastic IP addresses
If your account supports EC2-Classic, there's one pool of Elastic IP addresses for use with the EC2-Classic
platform and another for use with your VPCs. You can't associate an Elastic IP address that you allocated
for use with a VPC with an instance in EC2-Classic, or vice-versa.
If your account supports EC2-Classic, you might have set up resources for use in EC2-Classic. If you
want to migrate from EC2-Classic to a VPC, you must recreate those resources in your VPC. For more
information about migrating from EC2-Classic to a VPC, see Migrate from EC2-Classic to a VPC (p. 1385).
The following resources can be shared or accessed between EC2-Classic and a VPC.
Resource Notes
AMI
Bundle task
EBS volume
Elastic IP address (IPv4) You can migrate an Elastic IP address from EC2-
Classic to a VPC. You can't migrate an Elastic IP
address that was originally allocated for use in a
VPC to EC2-Classic. For more information, see the
section called “Elastic IP addresses” (p. 1387).
1373
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
Resource Notes
VPC. For more information, see Migrate from EC2-
Classic to a VPC (p. 1385).
Key pair
Placement group
Reserved Instance You can change the network platform for your
Reserved Instances from EC2-Classic to a VPC.
For more information, see Modify Reserved
Instances (p. 370).
Snapshot
The following resources can't be shared or moved between EC2-Classic and a VPC:
• Spot Instances
ClassicLink
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC (p. 1385).
ClassicLink allows you to link EC2-Classic instances to a VPC in your account, within the same Region. If
you associate the VPC security groups with a EC2-Classic instance, this enables communication between
your EC2-Classic instance and instances in your VPC using private IPv4 addresses. ClassicLink removes
the need to make use of public IPv4 addresses or Elastic IP addresses to enable communication between
instances in these platforms.
ClassicLink is available to all users with accounts that support the EC2-Classic platform, and can be used
with any EC2-Classic instance. There is no additional charge for using ClassicLink. Standard charges for
data transfer and instance usage apply.
Contents
1374
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
ClassicLink basics
There are two steps to linking an EC2-Classic instance to a VPC using ClassicLink. First, you must enable
the VPC for ClassicLink. By default, all VPCs in your account are not enabled for ClassicLink, to maintain
their isolation. After you've enabled the VPC for ClassicLink, you can then link any running EC2-Classic
instance in the same Region in your account to that VPC. Linking your instance includes selecting security
groups from the VPC to associate with your EC2-Classic instance. After you've linked the instance, it
can communicate with instances in your VPC using their private IP addresses, provided the VPC security
groups allow it. Your EC2-Classic instance does not lose its private IP address when linked to the VPC.
A linked EC2-Classic instance can communicate with instances in a VPC, but it does not form part of the
VPC. If you list your instances and filter by VPC, for example, through the DescribeInstances API
request, or by using the Instances screen in the Amazon EC2 console, the results do not return any EC2-
Classic instances that are linked to the VPC. For more information about viewing your linked EC2-Classic
instances, see View your ClassicLink-enabled VPCs and linked instances (p. 1379).
By default, if you use a public DNS hostname to address an instance in a VPC from a linked EC2-Classic
instance, the hostname resolves to the instance's public IP address. The same occurs if you use a public
DNS hostname to address a linked EC2-Classic instance from an instance in the VPC. If you want the
public DNS hostname to resolve to the private IP address, you can enable ClassicLink DNS support for
the VPC. For more information, see Enable ClassicLink DNS support (p. 1379).
If you no longer require a ClassicLink connection between your instance and the VPC, you can unlink
the EC2-Classic instance from the VPC. This disassociates the VPC security groups from the EC2-Classic
instance. A linked EC2-Classic instance is automatically unlinked from a VPC when it's stopped. After
you've unlinked all linked EC2-Classic instances from the VPC, you can disable ClassicLink for the VPC.
If you use Elastic Load Balancing, you can register your linked EC2-Classic instances with the load
balancer. You must create your load balancer in the ClassicLink-enabled VPC and enable the Availability
Zone in which the instance runs. If you terminate the linked EC2-Classic instance, the load balancer
deregisters the instance.
If you use Amazon EC2 Auto Scaling, you can create an Amazon EC2 Auto Scaling group with instances
that are automatically linked to a specified ClassicLink-enabled VPC at launch. For more information, see
Linking EC2-Classic Instances to a VPC in the Amazon EC2 Auto Scaling User Guide.
If you use Amazon RDS instances or Amazon Redshift clusters in your VPC, and they are publicly
accessible (accessible from the Internet), the endpoint you use to address those resources from a linked
EC2-Classic instance by default resolves to a public IP address. If those resources are not publicly
accessible, the endpoint resolves to a private IP address. To address a publicly accessible RDS instance
or Redshift cluster over private IP using ClassicLink, you must use their private IP address or private DNS
hostname, or you must enable ClassicLink DNS support for the VPC.
1375
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
If you use a private DNS hostname or a private IP address to address an RDS instance, the linked EC2-
Classic instance cannot use the failover support available for Multi-AZ deployments.
You can use the Amazon EC2 console to find the private IP addresses of your Amazon Redshift, Amazon
ElastiCache, or Amazon RDS resources.
For more information about policies for working with ClassicLink, see the following example: Example
IAM policies for ClassicLink (p. 1381).
After you've linked your instance to a VPC, you cannot change which VPC security groups are associated
with the instance. To associate different security groups with your instance, you must first unlink the
instance, and then link it to the VPC again, choosing the required security groups.
VPCs that are in the 10.0.0.0/16 and 10.1.0.0/16 IP address ranges can be enabled for ClassicLink
only if they do not have any existing static routes in route tables in the 10.0.0.0/8 IP address range,
excluding the local routes that were automatically added when the VPC was created. Similarly, if you've
enabled a VPC for ClassicLink, you may not be able to add any more specific routes to your route tables
within the 10.0.0.0/8 IP address range.
1376
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
Important
If your VPC CIDR block is a publicly routable IP address range, consider the security implications
before you link an EC2-Classic instance to your VPC. For example, if your linked EC2-Classic
instance receives an incoming Denial of Service (DoS) request flood attack from a source IP
address that falls within the VPC’s IP address range, the response traffic is sent into your VPC.
We strongly recommend that you create your VPC using a private IP address range as specified
in RFC 1918.
For more information about route tables and routing in your VPC, see Route tables in the Amazon VPC
User Guide.
If you enable a local VPC to communicate with a linked EC2-Classic instance in a peer VPC, a static route
is automatically added to your route tables with a destination of 10.0.0.0/8 and a target of local.
For more information and examples, see Configurations With ClassicLink in the Amazon VPC Peering
Guide.
ClassicLink limitations
To use the ClassicLink feature, you need to be aware of the following limitations:
1377
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
tenancy resource to address your isolated resources directly using private IP addresses. If you
need to enable your dedicated VPC for ClassicLink, provide a detailed reason in your request
to Amazon Web Services Support.
• If you link your EC2-Classic instance to a VPC in the 172.16.0.0/16 range, and you have a DNS
server running on the 172.16.0.23/32 IP address within the VPC, then your linked EC2-Classic
instance can't access the VPC DNS server. To work around this issue, run your DNS server on a different
IP address within the VPC.
• ClassicLink doesn't support transitive relationships out of the VPC. Your linked EC2-Classic instance
doesn't have access to any VPN connection, VPC gateway endpoint, NAT gateway, or Internet gateway
associated with the VPC. Similarly, resources on the other side of a VPN connection or an Internet
gateway don't have access to a linked EC2-Classic instance.
Tasks
• Enable a VPC for ClassicLink (p. 1378)
• Link an instance to a VPC (p. 1378)
• Link an instance to a VPC at launch (p. 1379)
• View your ClassicLink-enabled VPCs and linked instances (p. 1379)
• Enable ClassicLink DNS support (p. 1379)
• Disable ClassicLink DNS support (p. 1380)
• Unlink an instance from a VPC (p. 1380)
• Disable ClassicLink for a VPC (p. 1380)
1378
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
If you want the public DNS hostname to resolve to the private IP address, enable ClassicLink DNS
support for the VPC before you link the instance. For more information, see Enable ClassicLink DNS
support (p. 1379).
a. For Network, choose Launch into EC2-Classic. If this option is disabled, then the instance type
is not supported on EC2-Classic.
b. Expand Link to VPC (ClassicLink) and choose a VPC from Link to VPC. The console displays
only VPCs with ClassicLink enabled.
5. Complete the rest of the steps in the wizard to launch your instance. For more information, see
Launch an instance using the old launch instance wizard (p. 548).
1379
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
public IP addresses. For this feature to work, your VPC must be enabled for DNS hostnames and DNS
resolution.
Note
If you enable ClassicLink DNS support for your VPC, your linked EC2-Classic instance can access
any private hosted zone associated with the VPC. For more information, see Working with
Private Hosted Zones in the Amazon Route 53 Developer Guide.
1380
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
Examples
• Full permissions to work with ClassicLink (p. 1381)
• Enable and disable a VPC for ClassicLink (p. 1381)
• Link instances (p. 1382)
• Unlink instances (p. 1383)
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeClassicLinkInstances", "ec2:DescribeVpcClassicLink",
"ec2:EnableVpcClassicLink", "ec2:DisableVpcClassicLink",
"ec2:AttachClassicLinkVpc", "ec2:DetachClassicLinkVpc"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
1381
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
"Action": "ec2:*VpcClassicLink",
"Resource": "arn:aws:ec2:region:account:vpc/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/purpose":"classiclink"
}
}
}
]
}
Link instances
The following policy grants users permissions to link instances to a VPC only if the instance is an
m3.large instance type. The second statement allows users to use the VPC and security group
resources, which are required to link an instance to a VPC.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:AttachClassicLinkVpc",
"Resource": "arn:aws:ec2:region:account:instance/*",
"Condition": {
"StringEquals": {
"ec2:InstanceType":"m3.large"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:AttachClassicLinkVpc",
"Resource": [
"arn:aws:ec2:region:account:vpc/*",
"arn:aws:ec2:region:account:security-group/*"
]
}
]
}
The following policy grants users permissions to link instances to a specific VPC (vpc-1a2b3c4d) only,
and to associate only specific security groups from the VPC to the instance (sg-1122aabb and sg-
aabb2233). Users cannot link an instance to any other VPC, and they cannot specify any other of the
VPC security groups to associate with the instance in the request.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:AttachClassicLinkVpc",
"Resource": [
"arn:aws:ec2:region:account:vpc/vpc-1a2b3c4d",
"arn:aws:ec2:region:account:instance/*",
"arn:aws:ec2:region:account:security-group/sg-1122aabb",
"arn:aws:ec2:region:account:security-group/sg-aabb2233"
]
}
]
}
1382
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
Unlink instances
The following grants users permission to unlink any linked EC2-Classic instance from a VPC, but only if
the instance has the tag "unlink=true". The second statement grants users permissions to use the VPC
resource, which is required to unlink an instance from a VPC.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "ec2:DetachClassicLinkVpc",
"Resource": [
"arn:aws:ec2:region:account:instance/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/unlink":"true"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:DetachClassicLinkVpc",
"Resource": [
"arn:aws:ec2:region:account:vpc/*"
]
}
]
}
You want a security group configuration that allows traffic to flow only between these instances. You
have four security groups: two for your web server (sg-1a1a1a1a and sg-2b2b2b2b), one for your
application server (sg-3c3c3c3c), and one for your database server (sg-4d4d4d4d).
The following diagram displays the architecture of your instances, and their security group configuration.
1383
Amazon Elastic Compute Cloud
User Guide for Windows Instances
ClassicLink
You have one security group in EC2-Classic, and the other in your VPC. You associated the VPC security
group with your web server instance when you linked the instance to your VPC via ClassicLink. The VPC
security group enables you to control the outbound traffic from your web server to your application
server.
The following are the security group rules for the EC2-Classic security group (sg-1a1a1a1a).
Inbound
0.0.0.0/0 HTTPS 443 Allows Internet traffic to reach your web server.
The following are the security group rules for the VPC security group (sg-2b2b2b2b).
Outbound
sg-3c3c3c3c TCP 6001 Allows outbound traffic from your web server
to your application server in your VPC (or to any
other instance associated with sg-3c3c3c3c).
1384
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
The following are the security group rules for the VPC security group that's associated with your
application server.
Inbound
sg-2b2b2b2b TCP 6001 Allows the specified type of traffic from your
web server (or any other instance associated with
sg-2b2b2b2b) to reach your application server.
Outbound
The following are the security group rules for the VPC security group that's associated with your
database server.
Inbound
sg-3c3c3c3c TCP 6004 Allows the specified type of traffic from your
application server (or any other instance
associated with sg-3c3c3c3c) to reach your
database server.
To migrate from EC2-Classic to a VPC, you must migrate or recreate your EC2-Classic resources in a VPC.
Contents
• Migrate your resources to a VPC (p. 1385)
• Use the AWSSupport-MigrateEC2ClassicToVPC runbook (p. 1390)
• Example: Migrate a simple web application (p. 1390)
1385
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
Prerequisites
Before you begin, you must have a VPC. If you don't have a default VPC, you can create a nondefault
VPC. For more information, see the section called “Virtual private clouds” (p. 1323).
Resources
• Security groups (p. 1386)
• Elastic IP addresses (p. 1387)
• AMIs and instances (p. 1387)
• Amazon RDS DB instances (p. 1390)
• Classic Load Balancers (p. 1390)
Security groups
If you want your instances in your VPC to have the same security group rules as your EC2-Classic
instances, you can use the Amazon EC2 console to copy your existing EC2-Classic security group rules to
a new VPC security group. You can copy any security group from EC2-Classic to your VPC that meets the
requirements. Default security groups cannot be deleted and will be removed on your behalf when EC2-
Classic is retired.
You can only copy security group rules to a new security group in the same AWS account in the same
Region. If you are using a different Region or a different AWS account, you must create a new security
group and manually add the rules yourself. For more information, see Amazon EC2 security groups for
Windows instances (p. 1488).
Prerequisites
Before you begin copying your security groups, you should check for rules in which your EC2-Classic
security groups reference another security group in EC2-Classic. You should remove these rules as they
can't be copied into a VPC. For more information, see Delete rules from a security group.
1386
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
Elastic IP addresses
You can migrate an Elastic IP address that is allocated for use in EC2-Classic for use with a VPC. You
cannot migrate an Elastic IP address to another Region or AWS account. You cannot migrate an Elastic IP
address that has been allocated to your account for less than 24 hours.
When you migrate an Elastic IP address, it counts against your Elastic IP address limit for VPCs. You
cannot migrate an Elastic IP address if it results in your exceeding your limit. To migrate an Elastic IP
address, it must not be associated with an instance. For more information about disassociating an Elastic
IP address from an instance, see Disassociate an Elastic IP address (p. 1238).
After you've performed the command to move or restore your Elastic IP address, the process of
migrating the Elastic IP address can take a few minutes. Use the describe-moving-addresses command
to check whether your Elastic IP address is still moving, or has completed moving. After the moved is
complete, you can view the allocation ID for the Elastic IP address on the Elastic IPs page. If the Elastic IP
address is in a moving state for longer than 5 minutes, contact AWS Support.
Open the Amazon EC2 console. Choose Elastic IPs in the navigation pane and the select the check box
for the Elastic IP address. On the Summary page, check whether Scope is EC2-Classic or VPC.
Contents
• Identify EC2-Classic instances (p. 1387)
• Create an AMI (p. 1388)
• (Optional) Share or copy your AMI (p. 1388)
• (Optional) Store your data on Amazon EBS volumes (p. 1388)
• Launch an instance into your VPC (p. 1389)
If you have instances running in both EC2-Classic and a VPC, you can identify your EC2-Classic instances.
Choose Instances in the navigation pane. In the VPC ID column, the value for each EC2-Classic instance
is blank or a - symbol. If the VPC ID column is not present, choose the gear icon and make the column
visible.
AWS CLI
Use the following describe-instances AWS CLI command. The --query parameter displays only instances
where the value for VpcId is null.
1387
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
Create an AMI
After you've identified your EC2-Classic instance, you can create an AMI from it.
The method that you use to create your Linux AMI depends on the root device type of your instance,
and the operating system platform on which your instance runs. To find out the root device type of
your instance, go to the Instances page, select your instance, and on the Storage tab, look at the
information in the Root device type field. If the value is ebs, then your instance is EBS-backed. If the
value is instance-store, then your instance is instance store-backed. You can also use the describe-
instances AWS CLI command to find out the root device type.
The following table provides options for you to create your Linux AMI based on the root device type of
your instance, and the software platform.
Important
Some instance types support both PV and HVM virtualization, while others support only
one or the other. If you plan to use your AMI to launch a different instance type than your
current instance type, verify that the instance type supports the type of virtualization that your
AMI offers. If your AMI supports PV virtualization, and you want to use an instance type that
supports HVM virtualization, you might have to reinstall your software on a base HVM AMI. For
more information about PV and HVM virtualization, see Linux AMI virtualization types.
EBS Create an EBS-backed AMI from your instance. For more information, see
Create an Amazon EBS-backed Linux AMI.
Instance store Create an instance store-backed AMI from your instance using the AMI tools.
For more information, see Create an instance store-backed Linux AMI.
To use your AMI to launch an instance in a VPC in a different Region, you must first copy the AMI to that
Region. For more information, see Copy an AMI (p. 158).
For more information about Amazon EBS volumes, see the following topics:
1388
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
To back up the data on your Amazon EBS volume, you can take periodic snapshots of your volume.
For more information, see Create Amazon EBS snapshots (p. 1574). If you need to, you can create
an Amazon EBS volume from your snapshot. For more information, see Create a volume from a
snapshot (p. 1541).
After you've created an AMI, you can use the Amazon EC2 launch instance wizard to launch an instance
into your VPC. The instance will have the same data and configurations as your existing EC2-Classic
instance.
Note
You can use this opportunity to upgrade to a current generation instance type.
New console
Old console
1389
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
7. Review your instance details, then choose Launch to specify a key pair and launch your instance.
For more information about the parameters that you can configure in each step of the wizard, see
Launch an instance using the old launch instance wizard (p. 548).
The first part of migrating to a VPC is deciding what kind of VPC architecture suits your needs. In this
case, you've decided on the following: one public subnet for your web servers, and one private subnet for
your database server. As your website grows, you can add more web servers and database servers to your
subnets. By default, instances in the private subnet cannot access the internet; however, you can enable
internet access through a Network Address Translation (NAT) device in the public subnet. You might
want to set up a NAT device to support periodic updates and patches from the internet for your database
server. You'll migrate your Elastic IP addresses to a VPC, and create a load balancer in your public subnet
to load balance the traffic between your web servers.
1390
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
To migrate your web application to a VPC, you can follow these steps:
• Create a VPC: For more information, see Create a VPC in the Amazon VPC User Guide.
• Configure your security groups: In your EC2-Classic environment, you have one security group for
your web servers, and another security group for your database server. You can use the Amazon EC2
console to copy the rules from each security group into new security groups for your VPC. For more
information, see Security groups (p. 1386).
Tip
Create the security groups that are referenced by other security groups first.
• Create AMIs and launch new instances: Create an AMI from one of your web servers, and a second
AMI from your database server. Then, launch replacement web servers into your public subnet, and
launch your replacement database server into your private subnet. For more information, see Create
an AMI (p. 1388).
• Configure your NAT device: If you are using a NAT instance, you must create a security group for it
that allows HTTP and HTTPS traffic from your private subnet. For more information, see NAT instances
in the Amazon VPC User Guide. If you are using a NAT gateway, traffic from your private subnet is
automatically allowed.
• Configure your database: When you created an AMI from your database server in EC2-Classic, all
of the configuration information that was stored in that instance was copied to the AMI. You might
have to connect to your new database server and update the configuration details. For example, if you
configured your database to grant full read, write, and modification permissions to your web servers in
EC2-Classic, you need to update the configuration files to grant the same permissions to your new VPC
web servers instead.
• Configure your web servers: Your web servers will have the same configuration settings as your
instances in EC2-Classic. For example, if you configured your web servers to use the database in EC2-
Classic, update your web servers' configuration settings to point to your new database instance.
Note
By default, instances launched into a nondefault subnet are not assigned a public IP address,
unless you specify otherwise at launch. Your new database server might not have a public
1391
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Migrate from EC2-Classic to a VPC
IP address. In this case, you can update your web servers' configuration file to use your new
database server's private DNS name. Instances in the same VPC can communicate with each
other via private IP address.
• Migrate your Elastic IP addresses: Disassociate your Elastic IP addresses from your web servers in
EC2-Classic, and then migrate them to a VPC. After you've migrated them, you can associate them
with your new web servers in your VPC. For more information, see the section called “Elastic IP
addresses” (p. 1387).
• Create a new load balancer: To continue using Elastic Load Balancing to load balance the traffic to
your instances, make sure you understand the various ways to configure your load balancer in VPC. For
more information, see the Elastic Load Balancing User Guide.
• Update your DNS records: After you've set up your load balancer in your public subnet, verify that
your www.garden.example.com domain points to your new load balancer. To do this, update your
DNS records and your alias record set in Route 53. For more information about using Route 53, see
Getting Started with Route 53.
• Shut down your EC2-Classic resources: After you've verified that your web application is working from
within the VPC architecture, you can shut down your EC2-Classic resources to stop incurring charges
for them.
1392
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security is a shared responsibility between AWS and you. The shared responsibility model describes this
as security of the cloud and security in the cloud:
• Security of the cloud – AWS is responsible for protecting the infrastructure that runs AWS services in
the AWS Cloud. AWS also provides you with services that you can use securely. Third-party auditors
regularly test and verify the effectiveness of our security as part of the AWS Compliance Programs.
To learn about the compliance programs that apply to Amazon EC2, see AWS Services in Scope by
Compliance Program.
• Security in the cloud – Your responsibility includes the following areas:
• Controlling network access to your instances, for example, through configuring your VPC and
security groups. For more information, see Controlling network traffic (p. 1394).
• Managing the credentials used to connect to your instances.
• Managing the guest operating system and software deployed to the guest operating system,
including updates and security patches. For more information, see Update management in Amazon
EC2 (p. 1507).
• Configuring the IAM roles that are attached to the instance and the permissions associated with
those roles. For more information, see IAM roles for Amazon EC2 (p. 1462).
This documentation helps you understand how to apply the shared responsibility model when using
Amazon EC2. It shows you how to configure Amazon EC2 to meet your security and compliance
objectives. You also learn how to use other AWS services that help you to monitor and secure your
Amazon EC2 resources.
For security best practices for Amazon EC2 running Windows Server, see Security and Network under
Best practices for Windows on Amazon EC2 (p. 18).
Contents
• Infrastructure security in Amazon EC2 (p. 1394)
• Resilience in Amazon EC2 (p. 1396)
• Data protection in Amazon EC2 (p. 1396)
• Windows virtualization-based security features (p. 1399)
• Identity and access management for Amazon EC2 (p. 1404)
• Amazon EC2 key pairs and Windows instances (p. 1476)
• Amazon EC2 security groups for Windows instances (p. 1488)
• Access Amazon EC2 using an interface VPC endpoint (p. 1505)
• Configuration management in Amazon EC2 (p. 1507)
• Update management in Amazon EC2 (p. 1507)
• Change management in Amazon EC2 (p. 1508)
• Compliance validation for Amazon EC2 (p. 1508)
• Audit and accountability in Amazon EC2 (p. 1509)
• NitroTPM (p. 1509)
1393
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Infrastructure security
You use AWS published API calls to access Amazon EC2 through the network. Clients must support the
following:
• Transport Layer Security (TLS). We require TLS 1.2 and recommend TLS 1.3.
• Cipher suites with perfect forward secrecy (PFS) such as DHE (Ephemeral Diffie-Hellman) or ECDHE
(Elliptic Curve Ephemeral Diffie-Hellman). Most modern systems such as Java 7 and later support these
modes.
Additionally, requests must be signed by using an access key ID and a secret access key that is associated
with an IAM principal. Or you can use the AWS Security Token Service (AWS STS) to generate temporary
security credentials to sign requests.
For more information, see Infrastructure Protection in the Security Pillar – AWS Well-Architected
Framework.
Network isolation
A virtual private cloud (VPC) is a virtual network in your own logically isolated area in the AWS Cloud.
Use separate VPCs to isolate infrastructure by workload or organizational entity.
A subnet is a range of IP addresses in a VPC. When you launch an instance, you launch it into a subnet
in your VPC. Use subnets to isolate the tiers of your application (for example, web, application, and
database) within a single VPC. Use private subnets for your instances if they should not be accessed
directly from the internet.
To call the Amazon EC2 API from your VPC using private IP addresses, use AWS PrivateLink. For more
information, see Access Amazon EC2 using an interface VPC endpoint (p. 1505).
When you stop or terminate an instance, the memory allocated to it is scrubbed (set to zero) by the
hypervisor before it is allocated to a new instance, and every block of storage is reset. This ensures that
your data is not unintentionally exposed to another instance.
Network MAC addresses are dynamically assigned to instances by the AWS network infrastructure. IP
addresses are either dynamically assigned to instances by the AWS network infrastructure, or assigned
by an EC2 administrator through authenticated API requests. The AWS network allows instances to send
traffic only from the MAC and IP addresses assigned to them. Otherwise, the traffic is dropped.
By default, an instance cannot receive traffic that is not specifically addressed to it. If you need to run
network address translation (NAT), routing, or firewall services on your instance, you can disable source/
destination checking for the network interface.
1394
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Controlling network traffic
• Restrict access to your instances using security groups (p. 1488). Configure Amazon EC2 instance
security groups to permit the minimum required network traffic for the Amazon EC2instance and
to allow access only from defined, expected, and approved locations. For example, if an Amazon
EC2 instance is an IIS web server, configure its security groups to permit only inbound HTTP/HTTPS,
Windows management traffic, and minimal outbound connections.
• Leverage security groups as the primary mechanism for controlling network access to Amazon EC2
instances. When necessary, use network ACLs sparingly to provide stateless, coarse-grain network
control. Security groups are more versatile than network ACLs due to their ability to perform stateful
packet filtering and create rules that reference other security groups. However, network ACLs can be
effective as a secondary control for denying a specific subset of traffic or providing high-level subnet
guard rails. Also, because network ACLs apply to an entire subnet, they can be used as defense-in-
depth in case an instance is ever launched unintentionally without a correct security group.
• Centrally manage Windows Firewall settings with Group Policy Objects (GPO) to further enhance
network controls. Customers often use the Windows Firewall for further visibility into network traffic
and to complement security group filters, creating advanced rules to block specific applications from
accessing the network or to filter traffic from a subset IP addresses. For example, the Windows Firewall
can limit access to the EC2 metadata service IP address to specific users or applications. Alternatively,
a public-facing service might use security groups to restrict traffic to specific ports and the Windows
Firewall to maintain a list of explicitly blocked IP addresses.
• When managing Windows instances, limit access to a few well-defined centralized management
servers or bastion hosts to reduce the environment’s attack surface. Also, use secure administration
protocols like RDP encapsulation over SSL/TLS. The Remote Desktop Gateway Quick Start provides
best practices for deploying remote desktop gateway, including configuring RDP to use SSL/TLS.
• Use Active Directory or AWS Directory Service to tightly and centrally control and monitor interactive
user and group access to Windows instances, and avoid local user permissions. Also avoid using
Domain Administrators and instead create more granular, application-specific role-based accounts.
Just Enough Administration (JEA) allows changes to Windows instances to be managed without
interactive or administrator access. In addition, JEA enables organizations to lock down administrative
access to the subset of Windows PowerShell commands required for instance administration. For
additional information, see the section on "Managing OS-level Access to Amazon EC2" in the AWS
Security Best Practices whitepaper.
• Systems Administrators should use Windows accounts with limited access to perform daily activities,
and only elevate access when necessary to perform specific configuration changes. Additionally, only
access Windows instances directly when absolutely necessary. Instead, leverage central configuration
management systems such as EC2 Run Command, Systems Center Configuration Manager (SCCM),
Windows PowerShell DSC, or Amazon EC2 Systems Manager (SSM) to push changes to Windows
servers.
• Configure Amazon VPC subnet route tables with the minimal required network routes. For example,
place only Amazon EC2 instances that requite direct Internet access into subnets with routes to an
Internet Gateway, and place only Amazon EC2 instances that need direct access to internal networks
into subnets with routes to a virtual private gateway.
• Consider using additional security groups or ENIs to control and audit Amazon EC2 instance
management traffic separately from regular application traffic. This approach allows customers
to implement special IAM policies for change control, making it easier to audit changes to security
group rules or automated rule-verification scripts. Multiple ENIs also provide additional options for
controlling network traffic including the ability to create host-based routing policies or leverage
different VPC subnet routing rules based on an ENI’s assigned subnet.
• Use AWS Virtual Private Network or AWS Direct Connect to establish private connections from your
remote networks to your VPCs. For more information, see Network-to-Amazon VPC Connectivity
Options.
• Use VPC Flow Logs to monitor the traffic that reaches your instances.
• Use AWS Security Hub to check for unintended network accessibility from your instances.
• Use AWS Systems Manager Session Manager to access your instances remotely instead of opening
inbound RDP ports.
1395
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Resilience
• Use AWS Systems Manager Run Command to automate common administrative tasks instead of
opening inbound RDP ports.
• Many of the Windows OS roles and Microsoft business applications also provide enhanced
functionality such as IP Address Range restrictions within IIS, TCP/IP filtering policies in Microsoft SQL
Server, and connection filter policies in Microsoft Exchange. Network restriction functionality within
the application layer can provide additional layers of defense for critical business application servers.
In addition to restricting network access to each Amazon EC2 instance, Amazon VPC supports
implementing additional network security controls like in-line gateways, proxy servers, and various
network monitoring options.
If you need to replicate your data or applications over greater geographic distances, use AWS Local
Zones. An AWS Local Zone is an extension of an AWS Region in geographic proximity to your users. Local
Zones have their own connections to the internet and support AWS Direct Connect. Like all AWS Regions,
AWS Local Zones are completely isolated from other AWS Zones.
If you need to replicate your data or applications in an AWS Local Zone, AWS recommends that you use
one of the following zones as the failover zone:
For more information about AWS Regions and Availability Zones, see AWS Global Infrastructure.
In addition to the AWS global infrastructure, Amazon EC2 offers the following features to support your
data resiliency:
1396
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon EBS data security
this infrastructure. This content includes the security configuration and management tasks for the
AWS services that you use. For more information about data privacy, see the Data Privacy FAQ. For
information about data protection in Europe, see the AWS Shared Responsibility Model and GDPR blog
post on the AWS Security Blog.
For data protection purposes, we recommend that you protect AWS account credentials and set up
individual users with AWS IAM Identity Center (successor to AWS Single Sign-On) or AWS Identity and
Access Management (IAM). That way, each user is given only the permissions necessary to fulfill their job
duties. We also recommend that you secure your data in the following ways:
We strongly recommend that you never put confidential or sensitive information, such as your
customers' email addresses, into tags or free-form text fields such as a Name field. This includes when
you work with Amazon EC2 or other AWS services using the console, API, AWS CLI, or AWS SDKs.
Any data that you enter into tags or free-form text fields used for names may be used for billing or
diagnostic logs. If you provide a URL to an external server, we strongly recommend that you do not
include credentials information in the URL to validate your request to that server.
Topics
• Amazon EBS data security (p. 1397)
• Encryption at rest (p. 1397)
• Encryption in transit (p. 1398)
If you have procedures that require that all data be erased using a specific method, either after or before
use (or both), such as those detailed in DoD 5220.22-M (National Industrial Security Program Operating
Manual) or NIST 800-88 (Guidelines for Media Sanitization), you have the ability to do so on Amazon
EBS. That block-level activity will be reflected down to the underlying storage media within the Amazon
EBS service.
Encryption at rest
EBS volumes
Amazon EBS encryption is an encryption solution for your EBS volumes and snapshots. It uses AWS KMS
keys. For more information, see Amazon EBS encryption (p. 1732).
You can also use Microsoft EFS and NTFS permissions for folder- and file-level encryption.
1397
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Encryption in transit
The data on NVMe instance store volumes is encrypted using an XTS-AES-256 cipher, implemented on a
hardware module on the instance. The keys used to encrypt data that's written to locally-attached NVMe
storage devices are per-customer, and per volume. The keys are generated by, and only reside within, the
hardware module, which is inaccessible to AWS personnel. The encryption keys are destroyed when the
instance is stopped or terminated and cannot be recovered. You cannot disable this encryption and you
cannot provide your own encryption key.
The data on HDD instance store volumes on H1, D3, and D3en instances is encrypted using XTS-AES-256
and one-time keys.
When you stop, hibernate, or terminate an instance, every block of storage in the instance store volume
is reset. Therefore, your data cannot be accessed through the instance store of another instance.
Memory
• Instances with AWS Graviton processors. AWS Graviton2, AWS Graviton3, and AWS Graviton3E support
always-on memory encryption. The encryption keys are securely generated within the host system, do
not leave the host system, and are destroyed when the host is rebooted or powered down. For more
information, see AWS Graviton Processors.
• Instances with Intel Xeon Scalable processors (Ice Lake), such as M6i instances. These processors
support always-on memory encryption using Intel Total Memory Encryption (TME).
• Instances with 3rd generation AMD EPYC processors (Milan), such as M6a instances. These processors
support always-on memory encryption using AMD Transparent Single Key Memory Encryption (TSME).
Encryption in transit
Encryption at the physical layer
All data flowing across AWS Regions over the AWS global network is automatically encrypted at the
physical layer before it leaves AWS secured facilities. All traffic between AZs is encrypted. Additional
layers of encryption, including those listed in this section, may provide additional protections.
All cross-Region traffic that uses Amazon VPC and Transit Gateway peering is automatically bulk-
encrypted when it exits a Region. An additional layer of encryption is automatically provided at the
physical layer for all cross-Region traffic, as previously noted in this section.
AWS provides secure and private connectivity between EC2 instances of all types. In addition, some
instance types use the offload capabilities of the underlying Nitro System hardware to automatically
encrypt in-transit traffic between instances, using AEAD algorithms with 256-bit encryption. There is
no impact on network performance. To support this additional in-transit traffic encryption between
instances, the following requirements must be met:
1398
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows VBS
An additional layer of encryption is automatically provided at the physical layer for all traffic before it
leaves AWS secured facilities, as previously noted in this section.
To view the instance types that encrypt in-transit traffic between instances using the AWS CLI
An Outpost creates special network connections called service links to its AWS home Region and,
optionally, private connectivity to a VPC subnet that you specify. All traffic over those connection is fully
encrypted. For more information, see Connectivity through service links and Encryption in transit in the
AWS Outposts User Guide.
RDP provides a secure communications channel for remote access to your Windows instances, whether
directly or through EC2 Instance Connect. Remote access to your instances using AWS Systems Manager
Session Manager or the Run Command is encrypted using TLS 1.2, and requests to create a connection
are signed using SigV4 and authenticated and authorized by AWS Identity and Access Management.
It is your responsibility to use an encryption protocol, such as Transport Layer Security (TLS), to encrypt
sensitive data in transit between clients and your Amazon EC2 instances.
Make sure to allow only encrypted connections between EC2 instances and the AWS API endpoints or
other sensitive remote network services. You can enforce this through an outbound security group or
Windows Firewall rules.
Topics
• Credential Guard (p. 1399)
Credential Guard
The AWS Nitro System supports Credential Guard for Amazon Elastic Compute Cloud (Amazon EC2)
Windows instances. Credential Guard is a Windows virtualization-based security (VBS) feature that
enables the creation of isolated environments to protect security assets, such as Windows user
credentials and code integrity enforcement, beyond Windows kernel protections. When you run EC2
Windows instances, Credential Guard uses the AWS Nitro System to protect Windows login credentials
from being extracted from the OS memory.
1399
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Credential Guard
Topics
• Prerequisites (p. 1400)
• Launching a supported instance (p. 1400)
• Turning on Credential Guard (p. 1401)
• Verifying Credential Guard is running (p. 1402)
• Turning off Credential Guard (p. 1403)
Prerequisites
Your Windows instance must meet the following prerequisites to utilize Credential Guard:
The AMI must be preconfigured to enable NitroTPM and UEFI Secure Boot. For more information on
supported AMIs, see Prerequisites for launching a Windows instance with NitroTPM enabled.
Instance types
The following instance types support Credential Guard across all sizes: C5, C5d, C5n, C6i, C6id,
C6in, M5, M5d, M5dn, M5n, M5zn, M6i, M6id, M6idn, M6in, R5, R5b, R5d, R5dn, R5n, R6i, R6id,
R6idn, R6in.
Note
Though NitroTPM has some required instance types in common, the instance type must be
one of the above to support Credential Guard.
Follow the steps to Launch an instance using the new launch instance wizard while specifying a
supported instance type and preconfigured Windows AMI.
AWS CLI
Use the run-instances command to launch an instance using a supported instance type and
preconfigured Windows AMI.
1400
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Credential Guard
1. Connect to your instance as a user account with administrator privileges using the Remote Desktop
Protocol (RDP). For more information, see Connect to your Windows instance using RDP.
2. Open the Start menu and search for cmd to start a command prompt.
3. Run the following command to open the Local Group Policy Editor: gpedit.msc
4. In the Local Group Policy Editor, choose Computer Configuration, Administrative Templates,
System, Device Guard.
5. Select Turn On Virtualization Based Security, then select Edit policy setting.
6. Choose Enabled within the Turn On Virtualization Based Security menu.
7. For Select Platform Security Level, choose Secure Boot and DMA Protection.
8. For Credential Guard Configuration, choose Enabled without lock.
Note
The remaining policy settings are not required to enable Credential Guard and can be left as
Not Configured.
The following image displays the VBS settings configured as described previously:
1401
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Credential Guard
1. Connect to your instance using the Remote Desktop Protocol (RDP). For more information, see
Connect to your Windows instance using RDP.
2. Within the RDP session to your instance, open the Start menu and search for cmd to start a
command prompt.
3. Open System Information by running the following command: msinfo32.exe
4. The Microsoft System Information tool lists the details for VBS configuration. Next to Virtualization-
based security Services, confirm that Credential Guard appears as Running.
1402
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Credential Guard
1. Connect to your instance as a user account with administrator privileges using the Remote Desktop
Protocol (RDP). For more information, see Connect to your Windows instance using RDP.
2. Open the Start menu and search for cmd to start a command prompt.
3. Run the following command to open the Local Group Policy Editor: gpedit.msc
4. In the Local Group Policy Editor, choose Computer Configuration, Administrative Templates,
System, Device Guard.
5. Select Turn On Virtualization Based Security, then select Edit policy setting.
6. Choose Disabled within the Turn On Virtualization Based Security menu.
7. The following image displays the VBS settings configured as described previously:
1403
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Identity and access management
For best practices for securing your AWS resources using IAM, see Security best practices in IAM.
Contents
• Network access to your instance (p. 1405)
• Amazon EC2 permission attributes (p. 1405)
• IAM and Amazon EC2 (p. 1405)
• IAM policies for Amazon EC2 (p. 1406)
• AWS managed policies for Amazon Elastic Compute Cloud (p. 1461)
1404
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network access to your instance
For more information, see Authorize inbound traffic for your Windows instances (p. 1473).
Each AMI has a LaunchPermission attribute that controls which AWS accounts can access the AMI. For
more information, see Make an AMI public (p. 124).
Each Amazon EBS snapshot has a createVolumePermission attribute that controls which AWS
accounts can use the snapshot. For more information, see Share an Amazon EBS snapshot (p. 1621).
By using IAM with Amazon EC2, you can control whether users in your organization can perform a task
using specific Amazon EC2 API actions and whether they can use specific AWS resources.
1405
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
An IAM role is an IAM identity that you can create in your account that has specific permissions. An IAM
role is similar to an IAM user in that it is an AWS identity with permissions policies that determine what
the identity can and cannot do in AWS. However, instead of being uniquely associated with one person,
a role is intended to be assumable by anyone who needs it. Also, a role does not have standard long-
term credentials such as a password or access keys associated with it. Instead, when you assume a role, it
provides you with temporary security credentials for your role session. For more information on how to
create IAM roles and grant permissions with them, see IAM roles for Amazon EC2.
Related topics
For more information about IAM, see the following:
When you attach a policy to a user, group of users, or role it allows or denies the users permission to
perform the specified tasks on the specified resources. For more general information about IAM policies,
see Policies and permissions in IAM in the IAM User Guide. For more information about managing and
creating custom IAM policies, see Managing IAM policies.
Getting Started
An IAM policy must grant or deny permissions to use one or more Amazon EC2 actions. It must also
specify the resources that can be used with the action, which can be all resources, or in some cases,
specific resources. The policy can also include conditions that you apply to the resource.
Amazon EC2 partially supports resource-level permissions. This means that for some EC2 API actions,
you cannot specify which resource a user is allowed to work with for that action. Instead, you have to
allow users to work with all resources for that action.
Task Topic
Define actions in your policy Actions for Amazon EC2 (p. 1408)
Define specific resources in your policy Amazon Resource Names (ARNs) for Amazon
EC2 (p. 1409)
Apply conditions to the use of the resources Condition keys for Amazon EC2 (p. 1410)
Work with the available resource-level Actions, resources, and condition keys for Amazon
permissions for Amazon EC2 EC2
1406
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Task Topic
Example policies for a CLI or SDK Example policies for working with the AWS CLI or
an AWS SDK (p. 1415)
Example policies for the Amazon EC2 console Example policies for working in the Amazon EC2
console (p. 1452)
• PowerUserAccess
• ReadOnlyAccess
• AmazonEC2FullAccess
• AmazonEC2ReadOnlyAccess
For more information on the AWS managed policies available to work with Amazon EC2, see AWS
managed policies for Amazon Elastic Compute Cloud.
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
Policy structure
The following topics explain the structure of an IAM policy.
Contents
• Policy syntax (p. 1408)
• Actions for Amazon EC2 (p. 1408)
• Supported resource-level permissions for Amazon EC2 API actions (p. 1409)
• Amazon Resource Names (ARNs) for Amazon EC2 (p. 1409)
• Condition keys for Amazon EC2 (p. 1410)
• Check that users have the required permissions (p. 1412)
1407
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Policy syntax
An IAM policy is a JSON document that consists of one or more statements. Each statement is structured
as follows.
{
"Statement":[{
"Effect":"effect",
"Action":"action",
"Resource":"arn",
"Condition":{
"condition":{
"key":"value"
}
}
}
]
}
• Effect: The effect can be Allow or Deny. By default, users don't have permission to use resources
and API actions, so all requests are denied. An explicit allow overrides the default. An explicit deny
overrides any allows.
• Action: The action is the specific API action for which you are granting or denying permission. To learn
about specifying action, see Actions for Amazon EC2 (p. 1408).
• Resource: The resource that's affected by the action. Some Amazon EC2 API actions allow you to
include specific resources in your policy that can be created or modified by the action. You specify
a resource using an Amazon Resource Name (ARN) or using the wildcard (*) to indicate that the
statement applies to all resources. For more information, see Supported resource-level permissions for
Amazon EC2 API actions (p. 1409).
• Condition: Conditions are optional. They can be used to control when your policy is in effect. For
more information about specifying conditions for Amazon EC2, see Condition keys for Amazon
EC2 (p. 1410).
For more information about policy requirements, see the IAM JSON policy reference in the IAM User
Guide. For example IAM policy statements for Amazon EC2, see Example policies for working with the
AWS CLI or an AWS SDK (p. 1415).
To specify multiple actions in a single statement, separate them with commas as follows:
You can also specify multiple actions using wildcards. For example, you can specify all actions whose
name begins with the word "Describe" as follows:
"Action": "ec2:Describe*"
1408
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Note
Currently, the Amazon EC2 Describe* API actions do not support resource-level permissions.
For more information about resource-level permissions for Amazon EC2, see IAM policies for
Amazon EC2 (p. 1406).
To specify all Amazon EC2 API actions, use the * wildcard as follows:
"Action": "ec2:*"
For a list of Amazon EC2 actions, see Actions defined by Amazon EC2 in the Service Authorization
Reference.
To specify a resource in an IAM policy statement, use its Amazon Resource Name (ARN). For more
information about specifying the ARN value, see Amazon Resource Names (ARNs) for Amazon
EC2 (p. 1409). If an API action does not support individual ARNs, you must use a wildcard (*) to specify
that all resources can be affected by the action.
To see tables that identify which Amazon EC2 API actions support resource-level permissions, and the
ARNs and condition keys that you can use in a policy, see Actions, resources, and condition keys for
Amazon EC2.
Keep in mind that you can apply tag-based resource-level permissions in the IAM policies you use for
Amazon EC2 API actions. This gives you better control over which resources a user can create, modify, or
use. For more information, see Grant permission to tag resources during creation (p. 1412).
arn:aws:[service]:[region]:[account-id]:resourceType/resourcePath
service
A path that identifies the resource. You can use the * wildcard in your paths.
1409
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
For example, you can indicate a specific instance (i-1234567890abcdef0) in your statement using its
ARN as follows.
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
You can specify all instances that belong to a specific account by using the * wildcard as follows.
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*"
You can also specify all Amazon EC2 resources that belong to a specific account by using the * wildcard
as follows.
"Resource": "arn:aws:ec2:us-east-1:123456789012:*"
To specify all resources, or if a specific API action does not support ARNs, use the * wildcard in the
Resource element as follows.
"Resource": "*"
Many Amazon EC2 API actions involve multiple resources. For example, AttachVolume attaches an
Amazon EBS volume to an instance, so a user must have permissions to use the volume and the instance.
To specify multiple resources in a single statement, separate their ARNs with commas, as follows.
For a list of ARNs for Amazon EC2 resources, see Resource types defined by Amazon EC2.
For a list of service-specific condition keys for Amazon EC2, see Condition keys for Amazon EC2. Amazon
EC2 also implements the AWS global condition keys. For more information, see Information available in
all requests in the IAM User Guide.
To use a condition key in your IAM policy, use the Condition statement. For example, the following
policy grants users permission to add and remove inbound and outbound rules for any security group. It
uses the ec2:Vpc condition key to specify that these actions can only be performed on security groups
in a specific VPC.
{
"Version": "2012-10-17",
"Statement":[{
"Effect":"Allow",
"Action": [
"ec2:AuthorizeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RevokeSecurityGroupEgress"],
"Resource": "arn:aws:ec2:region:account:security-group/*",
"Condition": {
"StringEquals": {
"ec2:Vpc": "arn:aws:ec2:region:account:vpc/vpc-11223344556677889"
}
1410
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
}
}
]
}
If you specify multiple conditions, or multiple keys in a single condition, we evaluate them using a
logical AND operation. If you specify a single condition with multiple values for one key, we evaluate the
condition using a logical OR operation. For permissions to be granted, all conditions must be met.
You can also use placeholders when you specify conditions. For more information, see IAM policy
elements: Variables and tags in the IAM User Guide.
Important
Many condition keys are specific to a resource, and some API actions use multiple resources.
If you write a policy with a condition key, use the Resource element of the statement to
specify the resource to which the condition key applies. If not, the policy may prevent users
from performing the action at all, because the condition check fails for the resources to which
the condition key does not apply. If you do not want to specify a resource, or if you've written
the Action element of your policy to include multiple API actions, then you must use the
...IfExists condition type to ensure that the condition key is ignored for resources that do
not use it. For more information, see ...IfExists Conditions in the IAM User Guide.
All Amazon EC2 actions support the aws:RequestedRegion and ec2:Region condition keys. For more
information, see Example: Restrict access to a specific Region (p. 1416).
The ec2:SourceInstanceARN condition key can be used for conditions that specify the ARN of the
instance from which a request is made. This is an AWS global condition key and is not service-specific.
For policy examples, see Amazon EC2: Attach or detach volumes to an EC2 instance and Example: Allow
a specific instance to view resources in other AWS services (p. 1448). The ec2:SourceInstanceARN key
cannot be used as a variable to populate the ARN for the Resource element in a statement.
For example policy statements for Amazon EC2, see Example policies for working with the AWS CLI or an
AWS SDK (p. 1415).
The ec2:Attribute condition key can be used for conditions that filter access by an attribute of a
resource. The condition key supports only properties that are of a primitive data type, such as a string
or integer, or complex objects that have only a Value property, such as the Description object of the
ModifyImageAttribute API action.
For example, the following policy uses the ec2:Attribute/Description condition key to filter access
by the complex Description object of the ModifyImageAttribute API action. The condition key allows
only requests that modify an image's description to either Production or Development.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:ModifyImageAttribute",
"Resource": "arn:aws:ec2:us-east-1::image/ami-*",
"Condition": {
"StringEquals": {
"ec2:Attribute/Description": [
"Production",
"Development"
]
1411
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
}
}
}
]
}
The following example policy uses the ec2:Attribute condition key to filter access by the primitive
Attribute property of the ModifyImageAttribute API action. The condition key denies all requests that
attempt to modify an image's description.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "ec2:ModifyImageAttribute",
"Resource": "arn:aws:ec2:us-east-1::image/ami-*",
"Condition": {
"StringEquals": {
"ec2:Attribute": "Description"
}
}
}
]
}
First, create a user for testing purposes, and then attach the IAM policy that you created to the test user.
Then, make a request as the test user.
If the Amazon EC2 action that you are testing creates or modifies a resource, you should make the
request using the DryRun parameter (or run the AWS CLI command with the --dry-run option). In
this case, the call completes the authorization check, but does not complete the operation. For example,
you can check whether the user can terminate a particular instance without actually terminating it. If
the test user has the required permissions, the request returns DryRunOperation; otherwise, it returns
UnauthorizedOperation.
If the policy doesn't grant the user the permissions that you expected, or is overly permissive, you can
adjust the policy as needed and retest until you get the desired results.
Important
It can take several minutes for policy changes to propagate before they take effect. Therefore,
we recommend that you allow five minutes to pass before you test your policy updates.
If an authorization check fails, the request returns an encoded message with diagnostic information. You
can decode the message using the DecodeAuthorizationMessage action. For more information, see
DecodeAuthorizationMessage in the AWS Security Token Service API Reference, and decode-authorization-
message in the AWS CLI Command Reference.
1412
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
To enable users to tag resources on creation, they must have permissions to use the action that creates
the resource, such as ec2:RunInstances or ec2:CreateVolume. If tags are specified in the resource-
creating action, Amazon performs additional authorization on the ec2:CreateTags action to verify
if users have permissions to create tags. Therefore, users must also have explicit permissions to use the
ec2:CreateTags action.
In the IAM policy definition for the ec2:CreateTags action, use the Condition element with the
ec2:CreateAction condition key to give tagging permissions to the action that creates the resource.
The following example demonstrates a policy that allows users to launch instances and apply any tags to
instances and volumes during launch. Users are not permitted to tag any existing resources (they cannot
call the ec2:CreateTags action directly).
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
}
Similarly, the following policy allows users to create volumes and apply any tags to the volumes
during volume creation. Users are not permitted to tag any existing resources (they cannot call the
ec2:CreateTags action directly).
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateVolume"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "CreateVolume"
}
}
}
1413
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
]
}
The ec2:CreateTags action is only evaluated if tags are applied during the resource-creating action.
Therefore, a user that has permissions to create a resource (assuming there are no tagging conditions)
does not require permissions to use the ec2:CreateTags action if no tags are specified in the request.
However, if the user attempts to create a resource with tags, the request fails if the user does not have
permissions to use the ec2:CreateTags action.
The ec2:CreateTags action is also evaluated if tags are provided in a launch template. For an example
policy, see Tags in a launch template (p. 1436).
The following condition keys can be used with the examples in the preceding section:
• aws:RequestTag: To indicate that a particular tag key or tag key and value must be present in a
request. Other tags can also be specified in the request.
• Use with the StringEquals condition operator to enforce a specific tag key and value combination,
for example, to enforce the tag cost-center=cc123:
• Use with the StringLike condition operator to enforce a specific tag key in the request; for
example, to enforce the tag key purpose:
• aws:TagKeys: To enforce the tag keys that are used in the request.
• Use with the ForAllValues modifier to enforce specific tag keys if they are provided in the request
(if tags are specified in the request, only specific tag keys are allowed; no other tags are allowed). For
example, the tag keys environment or cost-center are allowed:
• Use with the ForAnyValue modifier to enforce the presence of at least one of the specified tag
keys in the request. For example, at least one of the tag keys environment or webserver must be
present in the request:
These condition keys can be applied to resource-creating actions that support tagging, as well as the
ec2:CreateTags and ec2:DeleteTags actions. To learn whether an Amazon EC2 API action supports
tagging, see Actions, resources, and condition keys for Amazon EC2.
To force users to specify tags when they create a resource, you must use the aws:RequestTag condition
key or the aws:TagKeys condition key with the ForAnyValue modifier on the resource-creating action.
The ec2:CreateTags action is not evaluated if a user does not specify tags for the resource-creating
action.
For conditions, the condition key is not case-sensitive and the condition value is case-sensitive. Therefore,
to enforce the case-sensitivity of a tag key, use the aws:TagKeys condition key, where the tag key is
specified as a value in the condition.
1414
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
For example IAM policies, see Example policies for working with the AWS CLI or an AWS SDK (p. 1415).
For more information about multi-value conditions, see Creating a Condition That Tests Multiple Key
Values in the IAM User Guide.
For example, you can create a policy that allows users to terminate an instance, but denies the action
if the instance has the tag environment=production. To do this, you use the aws:ResourceTag
condition key to allow or deny access to the resource based on the tags that are attached to the resource.
To learn whether an Amazon EC2 API action supports controlling access using the aws:ResourceTag
condition key, see Actions, resources, and condition keys for Amazon EC2. Note that the Describe
actions do not support resource-level permissions, so you must specify them in a separate statement
without conditions.
For example IAM policies, see Example policies for working with the AWS CLI or an AWS SDK (p. 1415).
If you allow or deny users access to resources based on tags, you must consider explicitly denying users
the ability to add those tags to or remove them from the same resources. Otherwise, it's possible for a
user to circumvent your restrictions and gain access to a resource by modifying its tags.
Example policies for working with the AWS CLI or an AWS SDK
You must grant users the permissions they require for Amazon EC2 using IAM policies. The following
examples show policy statements that you could use to control the permissions that users have to
Amazon EC2. These policies are designed for requests that are made with the AWS CLI or an AWS SDK.
For more information, see Creating IAM policies in the IAM User Guide. For example policies for working
in the Amazon EC2 console, see Example policies for working in the Amazon EC2 console (p. 1452). For
examples of IAM policies specific to Amazon VPC, see Identity and Access Management for Amazon VPC.
In the following examples, replace each user input placeholder with your own information.
Examples
• Example: Read-only access (p. 1416)
• Example: Restrict access to a specific Region (p. 1416)
• Work with instances (p. 1417)
• Work with volumes (p. 1418)
• Work with snapshots (p. 1420)
• Launch instances (RunInstances) (p. 1428)
• Work with Spot Instances (p. 1439)
• Example: Work with Reserved Instances (p. 1444)
• Example: Tag resources (p. 1445)
• Example: Work with IAM roles (p. 1446)
• Example: Work with route tables (p. 1447)
• Example: Allow a specific instance to view resources in other AWS services (p. 1448)
• Example: Work with launch templates (p. 1448)
• Work with instance metadata (p. 1449)
1415
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Users don't have permission to perform any actions on the resources (unless another statement grants
them permission to do so) because they're denied permission to use API actions by default.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "*"
}
]
}
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": "eu-central-1"
}
}
}
]
}
Alternatively, you can use the condition key ec2:Region, which is specific to Amazon EC2 and is
supported by all Amazon EC2 API actions.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"ec2:Region": "eu-central-1"
}
}
}
]
1416
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
The following policy grants users permissions to use the API actions specified in the Action element.
The Resource element uses a * wildcard to indicate that users can specify all resources with these API
actions. The * wildcard is also necessary in cases where the API action does not support resource-level
permissions. For more information about which ARNs you can use with which Amazon EC2 API actions,
see Actions, resources, and condition keys for Amazon EC2.
The users don't have permission to use any other API actions (unless another statement grants them
permission to do so) because users are denied permission to use API actions by default.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeImages",
"ec2:DescribeKeyPairs",
"ec2:DescribeSecurityGroups",
"ec2:DescribeAvailabilityZones",
"ec2:RunInstances",
"ec2:TerminateInstances",
"ec2:StopInstances",
"ec2:StartInstances"
],
"Resource": "*"
}
]
}
Example: Describe all instances, and stop, start, and terminate only particular instances
The following policy allows users to describe all instances, to start and stop only instances
i-1234567890abcdef0 and i-0598c7d356eba48d7, and to terminate only instances in the US East (N.
Virginia) Region (us-east-1) with the resource tag "purpose=test".
The first statement uses a * wildcard for the Resource element to indicate that users can
specify all resources with the action; in this case, they can list all instances. The * wildcard is also
necessary in cases where the API action does not support resource-level permissions (in this case,
ec2:DescribeInstances). For more information about which ARNs you can use with which Amazon
EC2 API actions, see Actions, resources, and condition keys for Amazon EC2.
The second statement uses resource-level permissions for the StopInstances and StartInstances
actions. The specific instances are indicated by their ARNs in the Resource element.
The third statement allows users to terminate all instances in the US East (N. Virginia) Region
(us-east-1) that belong to the specified AWS account, but only where the instance has the tag
"purpose=test". The Condition element qualifies when the policy statement is in effect.
1417
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:StopInstances",
"ec2:StartInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1:account-id:instance/i-1234567890abcdef0",
"arn:aws:ec2:us-east-1:account-id:instance/i-0598c7d356eba48d7"
]
},
{
"Effect": "Allow",
"Action": "ec2:TerminateInstances",
"Resource": "arn:aws:ec2:us-east-1:account-id:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/purpose": "test"
}
}
}
]
}
When an API action requires a caller to specify multiple resources, you must create a policy statement
that allows users to access all required resources. If you need to use a Condition element with one or
more of these resources, you must create multiple statements as shown in this example.
The following policy allows users to attach volumes with the tag "volume_user=iam-user-name" to
instances with the tag "department=dev", and to detach those volumes from those instances. If you
attach this policy to an IAM group, the aws:username policy variable gives each user in the group
permission to attach or detach volumes from the instances with a tag named volume_user that has
their username as a value.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:DetachVolume"
1418
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
],
"Resource": "arn:aws:ec2:us-east-1:account-id:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/department": "dev"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:DetachVolume"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/volume_user": "${aws:username}"
}
}
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateVolume"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition":{
"NumericLessThan": {
"ec2:VolumeSize" : "20"
},
"Bool":{
"ec2:Encrypted" : "true"
}
}
}
]
}
For resource-creating actions that apply tags, users must also have permissions to use the CreateTags
action. The second statement uses the ec2:CreateAction condition key to allow users to create tags
only in the context of CreateVolume. Users cannot tag existing volumes or any other resources. For
more information, see Grant permission to tag resources during creation (p. 1412).
{
"Version": "2012-10-17",
1419
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Statement": [
{
"Sid": "AllowCreateTaggedVolumes",
"Effect": "Allow",
"Action": "ec2:CreateVolume",
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/costcenter": "115",
"aws:RequestTag/stack": "prod"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "CreateVolume"
}
}
}
]
}
The following policy allows users to create a volume without having to specify tags. The CreateTags
action is only evaluated if tags are specified in the CreateVolume request. If users do specify tags, the
tag must be purpose=test. No other tags are allowed in the request.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:CreateVolume",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/purpose": "test",
"ec2:CreateAction" : "CreateVolume"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": "purpose"
}
}
}
]
}
1420
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Examples
• Example: Create a snapshot (p. 1421)
• Example: Create snapshots (p. 1421)
• Example: Create a snapshot with tags (p. 1422)
• Example: Create multi-volume snapshots with tags (p. 1422)
• Example: Copying snapshots (p. 1427)
• Example: Modify permission settings for snapshots (p. 1427)
The following policy allows customers to use the CreateSnapshot API action. The customer can create
snapshots only if the volume is encrypted and only if the volume size is less than 20 GiB.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*"
},
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition":{
"NumericLessThan":{
"ec2:VolumeSize":"20"
},
"Bool":{
"ec2:Encrypted":"true"
}
}
}
]
}
The following policy allows customers to use the CreateSnapshots API action. The customer can create
snapshots only if all of the volumes on the instance are type GP2.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":[
"arn:aws:ec2:us-east-1::snapshot/*",
"arn:aws:ec2:*:*:instance/*"
]
},
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1:*:volume/*",
"Condition":{
1421
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"StringLikeIfExists":{
"ec2:VolumeType":"gp2"
}
}
}
]
}
The following policy includes the aws:RequestTag condition key that requires the customer to apply
the tags costcenter=115 and stack=prod to any new snapshot. If users don't pass these specific tags,
or if they don't specify tags at all, the request fails.
For resource-creating actions that apply tags, customers must also have permissions to use the
CreateTags action. The third statement uses the ec2:CreateAction condition key to allow
customers to create tags only in the context of CreateSnapshot. Customers cannot tag existing
volumes or any other resources. For more information, see Grant permission to tag resources during
creation (p. 1412).
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1:account-id:volume/*"
},
{
"Sid":"AllowCreateTaggedSnapshots",
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/costcenter":"115",
"aws:RequestTag/stack":"prod"
}
}
},
{
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"ec2:CreateAction":"CreateSnapshot"
}
}
}
]
}
The following policy includes the aws:RequestTag condition key that requires the customer to apply
the tags costcenter=115 and stack=prod when creating a multi-volume snapshot set. If users don't
pass these specific tags, or if they don't specify tags at all, the request fails.
1422
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":[
"arn:aws:ec2:us-east-1::snapshot/*",
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:volume/*"
]
},
{
"Sid":"AllowCreateTaggedSnapshots",
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/costcenter":"115",
"aws:RequestTag/stack":"prod"
}
}
},
{
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"ec2:CreateAction":"CreateSnapshots"
}
}
}
]
}
The following policy allows customers to create a snapshot without having to specify tags.
The CreateTags action is evaluated only if tags are specified in the CreateSnapshot or
CreateSnapshots request. Tags can be omitted in the request. If a tag is specified, the tag must be
purpose=test. No other tags are allowed in the request.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"*"
},
{
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/purpose":"test",
"ec2:CreateAction":"CreateSnapshot"
},
"ForAllValues:StringEquals":{
"aws:TagKeys":"purpose"
}
}
}
1423
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
]
}
The following policy allows customers to create multi-volume snapshot sets without having to specify
tags. The CreateTags action is evaluated only if tags are specified in the CreateSnapshot or
CreateSnapshots request. Tags can be omitted in the request. If a tag is specified, the tag must be
purpose=test. No other tags are allowed in the request.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"*"
},
{
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/purpose":"test",
"ec2:CreateAction":"CreateSnapshots"
},
"ForAllValues:StringEquals":{
"aws:TagKeys":"purpose"
}
}
}
]
}
The following policy allows snapshots to be created only if the source volume is tagged with
User:username for the customer, and the snapshot itself is tagged with Environment:Dev and
User:username. The customer can add additional tags to the snapshot.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition":{
"StringEquals":{
"aws:ResourceTag/User":"${aws:username}"
}
}
},
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/Environment":"Dev",
"aws:RequestTag/User":"${aws:username}"
}
}
},
{
1424
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*"
}
]
}
The following policy for CreateSnapshots allows snapshots to be created only if the source
volume is tagged with User:username for the customer, and the snapshot itself is tagged with
Environment:Dev and User:username.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1:*:instance/*",
},
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition":{
"StringEquals":{
"aws:ResourceTag/User":"${aws:username}"
}
}
},
{
"Effect":"Allow",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:RequestTag/Environment":"Dev",
"aws:RequestTag/User":"${aws:username}"
}
}
},
{
"Effect":"Allow",
"Action":"ec2:CreateTags",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*"
}
]
}
The following policy allows deletion of a snapshot only if the snapshot is tagged with User:username for
the customer.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":"ec2:DeleteSnapshot",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:ResourceTag/User":"${aws:username}"
}
}
1425
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
}
]
}
The following policy allows a customer to create a snapshot but denies the action if the snapshot being
created has a tag key value=stack.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":[
"ec2:CreateSnapshot",
"ec2:CreateTags"
],
"Resource":"*"
},
{
"Effect":"Deny",
"Action":"ec2:CreateSnapshot",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"ForAnyValue:StringEquals":{
"aws:TagKeys":"stack"
}
}
}
]
}
The following policy allows a customer to create snapshots but denies the action if the snapshots being
created have a tag key value=stack.
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":[
"ec2:CreateSnapshots",
"ec2:CreateTags"
],
"Resource":"*"
},
{
"Effect":"Deny",
"Action":"ec2:CreateSnapshots",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"ForAnyValue:StringEquals":{
"aws:TagKeys":"stack"
}
}
}
]
}
The following policy allows you to combine multiple actions into a single policy. You can only create a
snapshot (in the context of CreateSnapshots) when the snapshot is created in Region us-east-1. You
can only create snapshots (in the context of CreateSnapshots) when the snapshots are being created
in the Region us-east-1 and when the instance type is t2*.
1426
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
{
"Version":"2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":[
"ec2:CreateSnapshots",
"ec2:CreateSnapshot",
"ec2:CreateTags"
],
"Resource": [
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:snapshot/*",
"arn:aws:ec2:*:*:volume/*"
],
"Condition":{
"StringEqualsIgnoreCase": {
"ec2:Region": "us-east-1"
},
"StringLikeIfExists": {
"ec2:InstanceType": ["t2.*"]
}
}
}
]
}
Resource-level permissions specified for the CopySnapshot action apply to the new snapshot only. They
cannot be specified for the source snapshot.
The following example policy allows principals to copy snapshots only if the new snapshot is created
with tag key of purpose and a tag value of production (purpose=production).
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCopySnapshotWithTags",
"Effect": "Allow",
"Action": "ec2:CopySnapshot",
"Resource": "arn:aws:ec2:*:account-id:snapshot/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/purpose": "production"
}
}
}
]
}
The following policy allows modification of a snapshot only if the snapshot is tagged with
User:username, where username is the customer's AWS account user name. The request fails if this
condition is not met.
{
"Version":"2012-10-17",
"Statement": [
1427
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
{
"Effect":"Allow",
"Action":"ec2:ModifySnapshotAttribute",
"Resource":"arn:aws:ec2:us-east-1::snapshot/*",
"Condition":{
"StringEquals":{
"aws:ResourceTag/user-name":"${aws:username}"
}
}
}
]
}
For more information about the resource-level permissions that are required to launch an instance, see
Actions, resources, and condition keys for Amazon EC2.
By default, users don't have permissions to describe, start, stop, or terminate the resulting instances. One
way to grant the users permission to manage the resulting instances is to create a specific tag for each
instance, and then create a statement that enables them to manage instances with that tag. For more
information, see Work with instances (p. 1417).
Resources
• AMIs (p. 1428)
• Instance types (p. 1429)
• Subnets (p. 1430)
• EBS volumes (p. 1431)
• Tags (p. 1432)
• Tags in a launch template (p. 1436)
• Elastic GPUs (p. 1437)
• Launch templates (p. 1437)
AMIs
The following policy allows users to launch instances using only the specified AMIs, ami-9e1670f7 and
ami-45cf5c3c. The users can't launch an instance using other AMIs (unless another statement grants
the users permission to do so).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-9e1670f7",
"arn:aws:ec2:region::image/ami-45cf5c3c",
"arn:aws:ec2:region:account-id:instance/*",
1428
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*"
]
}
]
}
Alternatively, the following policy allows users to launch instances from all AMIs owned by Amazon,
or certain trusted and verified partners. The Condition element of the first statement tests whether
ec2:Owner is amazon. The users can't launch an instance using other AMIs (unless another statement
grants the users permission to do so).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-*"
],
"Condition": {
"StringEquals": {
"ec2:Owner": "amazon"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region:account-id:instance/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*"
]
}
]
}
Instance types
The following policy allows users to launch instances using only the t2.micro or t2.small instance
type, which you might do to control costs. The users can't launch larger instances because the
Condition element of the first statement tests whether ec2:InstanceType is either t2.micro or
t2.small.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region:account-id:instance/*"
],
"Condition": {
1429
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"StringEquals": {
"ec2:InstanceType": ["t2.micro", "t2.small"]
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*"
]
}
]
}
Alternatively, you can create a policy that denies users permissions to launch any instances except
t2.micro and t2.small instance types.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region:account-id:instance/*"
],
"Condition": {
"StringNotEquals": {
"ec2:InstanceType": ["t2.micro", "t2.small"]
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:instance/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*"
]
}
]
}
Subnets
The following policy allows users to launch instances using only the specified subnet,
subnet-12345678. The group can't launch instances into any another subnet (unless another statement
grants the users permission to do so).
{
"Version": "2012-10-17",
1430
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region:account-id:subnet/subnet-12345678",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:instance/*",
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region::image/ami-*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*"
]
}
]
}
Alternatively, you could create a policy that denies users permissions to launch an instance into any other
subnet. The statement does this by denying permission to create a network interface, except where
subnet subnet-12345678 is specified. This denial overrides any other policies that are created to allow
launching instances into other subnets.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region:account-id:network-interface/*"
],
"Condition": {
"ArnNotEquals": {
"ec2:Subnet": "arn:aws:ec2:region:account-id:subnet/subnet-12345678"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:instance/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:key-pair/*",
"arn:aws:ec2:region:account-id:security-group/*"
]
}
]
}
EBS volumes
The following policy allows users to launch instances only if the EBS volumes for the instance are
encrypted. The user must launch an instance from an AMI that was created with encrypted snapshots, to
ensure that the root volume is encrypted. Any additional volume that the user attaches to the instance
during launch must also be encrypted.
{
"Version": "2012-10-17",
1431
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:*:*:volume/*"
],
"Condition": {
"Bool": {
"ec2:Encrypted": "true"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:*::image/ami-*",
"arn:aws:ec2:*:*:network-interface/*",
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:subnet/*",
"arn:aws:ec2:*:*:key-pair/*",
"arn:aws:ec2:*:*:security-group/*"
]
}
]
}
Tags
The following policy allows users to launch instances and tag the instances during creation. For resource-
creating actions that apply tags, users must have permissions to use the CreateTags action. The second
statement uses the ec2:CreateAction condition key to allow users to create tags only in the context
of RunInstances, and only for instances. Users cannot tag existing resources, and users cannot tag
volumes using the RunInstances request.
For more information, see Grant permission to tag resources during creation (p. 1412).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:instance/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
1432
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
The following policy includes the aws:RequestTag condition key that requires users to tag any
instances and volumes that are created by RunInstances with the tags environment=production
and purpose=webserver. If users don't pass these specific tags, or if they don't specify tags at all, the
request fails.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:region::image/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:security-group/*",
"arn:aws:ec2:region:account-id:key-pair/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:instance/*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "production" ,
"aws:RequestTag/purpose": "webserver"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
}
Tag instances and volumes on creation with at least one specific tag
The following policy uses the ForAnyValue modifier on the aws:TagKeys condition to indicate that at
least one tag must be specified in the request, and it must contain the key environment or webserver.
The tag must be applied to both instances and volumes. Any tag values can be specified in the request.
1433
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:region::image/*",
"arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*",
"arn:aws:ec2:region:account-id:security-group/*",
"arn:aws:ec2:region:account-id:key-pair/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:region:account-id:volume/*",
"arn:aws:ec2:region:account-id:instance/*"
],
"Condition": {
"ForAnyValue:StringEquals": {
"aws:TagKeys": ["environment","webserver"]
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
}
If instances are tagged on creation, they must be tagged with a specific tag
In the following policy, users do not have to specify tags in the request, but if they do, the tag must be
purpose=test. No other tags are allowed. Users can apply the tags to any taggable resource in the
RunInstances request.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
1434
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:*/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/purpose": "test",
"ec2:CreateAction" : "RunInstances"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": "purpose"
}
}
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
},
{
"Sid": "VisualEditor0",
"Effect": "Deny",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
Only allow specific tags for spot-instances-request. Surprise inconsistency number 2 comes into play
here. Under normal circumstances, specifying no tags will result in Unauthenticated. In the case of spot-
instances-request, this policy will not be evaluated if there are no spot-instances-request tags, so a non-
tag Spot on Run request will succeed.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
1435
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
]
},
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:*:spot-instances-request/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "production"
}
}
}
]
}
In the following example, users can launch instances, but only if they use a specific launch template
(lt-09477bcd97b0d310e). The ec2:IsLaunchTemplateResource condition key prevents users from
overriding any of the resources specified in the launch template. The second part of the statement allows
users to tag instances on creation—this part of the statement is necessary if tags are specified for the
instance in the launch template.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*",
"Condition": {
"ArnLike": {
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/
lt-09477bcd97b0d310e"
},
"Bool": {
"ec2:IsLaunchTemplateResource": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:instance/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction" : "RunInstances"
}
}
}
]
}
1436
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Elastic GPUs
In the following policy, users can launch an instance and specify an elastic GPU to attach to the instance.
Users can launch instances in any Region, but they can only attach an elastic GPU during a launch in the
us-east-2 Region.
The ec2:ElasticGpuType condition key uses the ForAnyValue modifier to indicate that only the
elastic GPU types eg1.medium and eg1.large are allowed in the request.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:*:account-id:elastic-gpu/*"
],
"Condition": {
"StringEquals": {
"ec2:Region": "us-east-2"
},
"ForAnyValue:StringLike": {
"ec2:ElasticGpuType": [
"eg1.medium",
"eg1.large"
]
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:*::image/ami-*",
"arn:aws:ec2:*:account-id:network-interface/*",
"arn:aws:ec2:*:account-id:instance/*",
"arn:aws:ec2:*:account-id:subnet/*",
"arn:aws:ec2:*:account-id:volume/*",
"arn:aws:ec2:*:account-id:key-pair/*",
"arn:aws:ec2:*:account-id:security-group/*"
]
}
]
}
Launch templates
In the following example, users can launch instances, but only if they use a specific launch template
(lt-09477bcd97b0d310e). Users can override any parameters in the launch template by specifying the
parameters in the RunInstances action.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*",
"Condition": {
"ArnLike": {
1437
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/
lt-09477bcd97b0d310e"
}
}
}
]
}
In this example, users can launch instances only if they use a launch template. The policy uses the
ec2:IsLaunchTemplateResource condition key to prevent users from overriding any pre-existing
ARNs in the launch template.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*",
"Condition": {
"ArnLike": {
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/*"
},
"Bool": {
"ec2:IsLaunchTemplateResource": "true"
}
}
}
]
}
The following example policy allows user to launch instances, but only if they use a launch template.
Users cannot override the subnet and network interface parameters in the request; these parameters
can only be specified in the launch template. The first part of the statement uses the NotResource
element to allow all other resources except subnets and network interfaces. The second part of the
statement allows the subnet and network interface resources, but only if they are sourced from the
launch template.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"NotResource": ["arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*" ],
"Condition": {
"ArnLike": {
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/*"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": ["arn:aws:ec2:region:account-id:subnet/*",
"arn:aws:ec2:region:account-id:network-interface/*" ],
"Condition": {
"ArnLike": {
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/*"
},
"Bool": {
1438
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"ec2:IsLaunchTemplateResource": "true"
}
}
}
]
}
The following example allows users to launch instances only if they use a launch template, and only
if the launch template has the tag Purpose=Webservers. Users cannot override any of the launch
template parameters in the RunInstances action.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"NotResource": "arn:aws:ec2:region:account-id:launch-template/*",
"Condition": {
"ArnLike": {
"ec2:LaunchTemplate": "arn:aws:ec2:region:account-id:launch-template/*"
},
"Bool": {
"ec2:IsLaunchTemplateResource": "true"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:region:account-id:launch-template/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Purpose": "Webservers"
}
}
}
]
}
• If you don't tag a Spot Instance request on create, Amazon EC2 does not evaluate the spot-
instances-request resource in the RunInstances statement.
• If you tag a Spot Instance request on create, Amazon EC2 evaluates the spot-instances-request
resource in the RunInstances statement.
Therefore, for the spot-instances-request resource, the following rules apply to the IAM policy:
• If you use RunInstances to create a Spot Instance request and you don't intend to tag the Spot Instance
request on create, you don’t need to explicitly allow the spot-instances-request resource; the call
will succeed.
• If you use RunInstances to create a Spot Instance request and intend to tag the Spot Instance request
on create, you must include the spot-instances-request resource in the RunInstances allow
statement, otherwise the call will fail.
1439
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
• If you use RunInstances to create a Spot Instance request and intend to tag the Spot Instance request
on create, you must specify the spot-instances-request resource or * wildcard in the CreateTags
allow statement, otherwise the call will fail.
You can request Spot Instances using RunInstances or RequestSpotInstances. The following example IAM
policies apply only when requesting Spot Instances using RunInstances.
The following policy allows users to request Spot Instances by using the RunInstances action. The spot-
instances-request resource, which is created by RunInstances, requests Spot Instances.
Note
To use RunInstances to create Spot Instance requests, you can omit spot-instances-
request from the Resource list if you do not intend to tag the Spot Instance requests on
create. This is because Amazon EC2 does not evaluate the spot-instances-request resource
in the RunInstances statement if the Spot Instance request is not tagged on create.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
}
]
}
Warning
NOT SUPPORTED – Example: Deny users permission to request Spot Instances using
RunInstances
The following policy is not supported for the spot-instances-request resource.
The following policy is meant to give users the permission to launch On-Demand Instances, but
deny users the permission to request Spot Instances. The spot-instances-request resource,
which is created by RunInstances, is the resource that requests Spot Instances. The second
statement is meant to deny the RunInstances action for the spot-instances-request
resource. However, this condition is not supported because Amazon EC2 does not evaluate
the spot-instances-request resource in the RunInstances statement if the Spot Instance
request is not tagged on create.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
1440
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*"
]
},
{
"Sid": "DenySpotInstancesRequests - NOT SUPPORTED - DO NOT USE!",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:*:spot-instances-request/*"
}
]
}
The following policy allows users to tag all resources that are created during instance launch. The first
statement allows RunInstances to create the listed resources. The spot-instances-request resource,
which is created by RunInstances, is the resource that requests Spot Instances. The second statement
provides a * wildcard to allow all resources to be tagged when they are created at instance launch.
Note
If you tag a Spot Instance request on create, Amazon EC2 evaluates the spot-instances-
request resource in the RunInstances statement. Therefore, you must explicitly allow the
spot-instances-request resource for the RunInstances action, otherwise the call will fail.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
},
{
"Sid": "TagResources",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
1441
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
The following policy denies users the permission to tag the resources that are created during instance
launch.
The first statement allows RunInstances to create the listed resources. The spot-instances-request
resource, which is created by RunInstances, is the resource that requests Spot Instances. The second
statement provides a * wildcard to deny all resources being tagged when they are created at instance
launch. If spot-instances-request or any other resource is tagged on create, the RunInstances call
will fail.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
},
{
"Sid": "DenyTagResources",
"Effect": "Deny",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
Warning
NOT SUPPORTED – Example: Allow creating a Spot Instance request only if it is assigned a
specific tag
The following policy is not supported for the spot-instances-request resource.
The following policy is meant to grant RunInstances the permission to create a Spot Instance
request only if the request is tagged with a specific tag.
The first statement allows RunInstances to create the listed resources.
The second statement is meant to grant users the permission to create a Spot Instance request
only if the request has the tag environment=production. If this condition is applied to other
resources created by RunInstances, specifying no tags results in an Unauthenticated error.
However, if no tags are specified for the Spot Instance request, Amazon EC2 does not evaluate
the spot-instances-request resource in the RunInstances statement, which results in non-
tagged Spot Instance requests being created by RunInstances.
Note that specifying another tag other than environment=production results in an
Unauthenticated error, because if a user tags a Spot Instance request, Amazon EC2 evaluates
the spot-instances-request resource in the RunInstances statement.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
1442
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*"
]
},
{
"Sid": "RequestSpotInstancesOnlyIfTagIs_environment=production - NOT
SUPPORTED - DO NOT USE!",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:*:spot-instances-request/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "production"
}
}
},
{
"Sid": "TagResources",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
The following policy denies RunInstances the permission to create a Spot Instance request if the request
is tagged with environment=production.
The second statement denies users the permission to create a Spot Instance request if the request has
the tag environment=production. Specifying environment=production as a tag results in an
Unauthenticated error. Specifying other tags or specifying no tags will result in the creation of a Spot
Instance request.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRun",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*",
"arn:aws:ec2:us-east-1:*:key-pair/*",
"arn:aws:ec2:us-east-1:*:volume/*",
"arn:aws:ec2:us-east-1:*:instance/*",
1443
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"arn:aws:ec2:us-east-1:*:spot-instances-request/*"
]
},
{
"Sid": "DenySpotInstancesRequests",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:*:spot-instances-request/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "production"
}
}
},
{
"Sid": "TagResources",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
It is not possible to set resource-level permissions for individual Reserved Instances. This policy means
that users have access to all the Reserved Instances in the account.
The Resource element uses a * wildcard to indicate that users can specify all resources with the action;
in this case, they can list and modify all Reserved Instances in the account. They can also purchase
Reserved Instances using the account credentials. The * wildcard is also necessary in cases where the API
action does not support resource-level permissions.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeReservedInstances",
"ec2:ModifyReservedInstances",
"ec2:PurchaseReservedInstancesOffering",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeReservedInstancesOfferings"
],
"Resource": "*"
}
]
}
To allow users to view and modify the Reserved Instances in your account, but not purchase new
Reserved Instances.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeReservedInstances",
1444
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"ec2:ModifyReservedInstances",
"ec2:DescribeAvailabilityZones"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:instance/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "production"
}
}
}
]
}
The following policy allows users to tag any taggable resource that already has a tag with a
key of owner and a value of the username. In addition, users must specify a tag with a key of
anycompany:environment-type and a value of either test or prod in the request. Users can specify
additional tags in the request.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:region:account-id:*/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/anycompany:environment-type": ["test","prod"],
"aws:ResourceTag/owner": "${aws:username}"
}
}
}
]
}
You can create an IAM policy that allows users to delete specific tags for a resource. For example, the
following policy allows users to delete tags for a volume if the tag keys specified in the request are
environment or cost-center. Any value can be specified for the tag but the tag key must match
either of the specified keys.
1445
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
Note
If you delete a resource, all tags associated with the resource are also deleted. Users do not need
permissions to use the ec2:DeleteTags action to delete a resource that has tags; they only
need permissions to perform the deleting action.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DeleteTags",
"Resource": "arn:aws:ec2:us-east-1:account-id:volume/*",
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": ["environment","cost-center"]
}
}
}
]
}
This policy allows users to delete only the environment=prod tag on any resource, and only if the
resource is already tagged with a key of owner and a value of the username. Users can't delete any other
tags for a resource.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DeleteTags"
],
"Resource": "arn:aws:ec2:region:account-id:*/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/environment": "prod",
"aws:ResourceTag/owner": "${aws:username}"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": ["environment"]
}
}
}
]
}
Users must have permission to use the iam:PassRole action in order to pass the role to the instance.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
1446
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Action": [
"ec2:AssociateIamInstanceProfile",
"ec2:ReplaceIamInstanceProfileAssociation",
"ec2:DisassociateIamInstanceProfile"
],
"Resource": "arn:aws:ec2:us-east-1:account-id:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/department":"test"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:DescribeIamInstanceProfileAssociations",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::account-id:role/DevTeam*"
}
]
}
The following policy allows users to attach or replace an IAM role for any instance. Users can only attach
or replace IAM roles with names that begin with TestRole-. For the iam:PassRole action, ensure that
you specify the name of the IAM role and not the instance profile (if the names are different). For more
information, see Instance profiles (p. 1463).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AssociateIamInstanceProfile",
"ec2:ReplaceIamInstanceProfileAssociation"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "ec2:DescribeIamInstanceProfileAssociations",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::account-id:role/TestRole-*"
}
]
}
{
"Version": "2012-10-17",
1447
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DeleteRoute",
"ec2:CreateRoute",
"ec2:ReplaceRoute"
],
"Resource": [
"arn:aws:ec2:region:account-id:route-table/*"
],
"Condition": {
"StringEquals": {
"ec2:Vpc": "arn:aws:ec2:region:account-id:vpc/vpc-ec43eb89"
}
}
}
]
}
The ec2:SourceInstanceARN key is an AWS global condition key, therefore it can be used for other
service actions, not just Amazon EC2.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeVolumes",
"s3:ListAllMyBuckets",
"dynamodb:ListTables",
"rds:DescribeDBInstances"
],
"Resource": [
"*"
],
"Condition": {
"ArnEquals": {
"ec2:SourceInstanceARN": "arn:aws:ec2:region:account-id:instance/
i-093452212644b0dd6"
}
}
}
]
}
1448
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:CreateLaunchTemplateVersion",
"ec2:ModifyLaunchTemplate"
],
"Effect": "Allow",
"Resource": "arn:aws:ec2:region:account-id:launch-template/lt-09477bcd97b0d3abc"
}
]
}
The following policy allows users to delete any launch template and launch template version, provided
that the launch template has the tag Purpose=Testing.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:DeleteLaunchTemplate",
"ec2:DeleteLaunchTemplateVersions"
],
"Effect": "Allow",
"Resource": "arn:aws:ec2:region:account-id:launch-template/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Purpose": "Testing"
}
}
}
]
}
1449
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
permissions are not checked when a new version of the launch template is created. For
permissions to be checked, you must configure the Auto Scaling group to use a specific version
of the launch template.
To enforce the use of IMDSv2 on instances launched by Auto Scaling groups, the
following additional steps are required:
1. Disable the use of launch configurations for all accounts in your organization by using
either service control policies (SCPs) or IAM permissions boundaries for new principals
that are created. For existing IAM principals with Auto Scaling group permissions,
update their associated policies with this condition key. To disable the use of launch
configurations, create or modify the relevant SCP, permissions boundary, or IAM policy with
the "autoscaling:LaunchConfigurationName" condition key with the value specified as
null.
2. For new launch templates, configure the instance metadata options in the launch template.
For existing launch templates, create a new version of the launch template and configure the
instance metadata options in the new version.
3. In the policy that gives any principal the permission to use a launch
template, restrict association of $latest and $default by specifying
"autoscaling:LaunchTemplateVersionSpecified": "true". By restricting the
use to a specific version of a launch template, you can ensure that new instances will be
launched using the version in which the instance metadata options are configured. For more
information, see LaunchTemplateSpecification in the Amazon EC2 Auto Scaling API Reference,
specifically the Version parameter.
4. For an Auto Scaling group that uses a launch configuration, replace the launch configuration
with a launch template. For more information, see Replacing a Launch Configuration with a
Launch Template in the Amazon EC2 Auto Scaling User Guide.
5. For an Auto Scaling group that uses a launch template, make sure that it uses a new launch
template with the instance metadata options configured, or uses a new version of the current
launch template with the instance metadata options configured. For more information, see
update-auto-scaling-group in the AWS CLI Command Reference.
Examples
• Require the use of IMDSv2 (p. 1450)
• Deny opt-out of IMDSv2 (p. 1451)
• Specify maximum hop limit (p. 1451)
• Limit who can modify the instance metadata options (p. 1451)
• Require role credentials to be retrieved from IMDSv2 (p. 1452)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RequireImdsV2",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
1450
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"StringNotEquals": {
"ec2:MetadataHttpTokens": "required"
}
}
}
]
}
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyIMDSv1ConfurationModification",
"Effect": "Deny",
"Action": "ec2:ModifyInstanceMetadataOptions",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"StringEquals": {
"ec2:Attribute": "HttpTokens"
},
"StringNotEquals": {
"ec2:Attribute/HttpTokens": "required"
}
}
}]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "MaxImdsHopLimit",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"NumericGreaterThan": {
"ec2:MetadataHttpPutResponseHopLimit": "3"
}
}
}
]
}
1451
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowOnlyImdsAdminsToModifySettings",
"Effect": "Deny",
"Action": "ec2:ModifyInstanceMetadataOptions",
"Resource": "*",
"Condition": {
"StringNotLike": {
"aws:PrincipalARN": "arn:aws:iam::*:role/ec2-imds-admins"
}
}
}
]
}
The following policy specifies that if this policy is applied to a role, and the role is assumed by
the EC2 service and the resulting credentials are used to sign a request, then the request must
be signed by EC2 role credentials retrieved from IMDSv2. Otherwise, all of its API calls will get an
UnauthorizedOperation error. This statement/policy can be applied generally because, if the request
is not signed by EC2 role credentials, it has no effect.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RequireAllEc2RolesToUseV2",
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"NumericLessThan": {
"ec2:RoleDelivery": "2.0"
}
}
}
]
}
The console uses additional API actions for its features, so these policies may not work as expected. For
example, a user that has permission to use only the DescribeVolumes API action will encounter errors
when trying to view volumes in the console. This section demonstrates policies that enable users to work
with specific parts of the console. For additional information about creating policies for the Amazon EC2
console, see the following AWS Security Blog post: Granting Users Permission to Work in the Amazon
EC2 Console.
Tip
To help you work out which API actions are required to perform tasks in the console, you can
use a service such as AWS CloudTrail. For more information, see the AWS CloudTrail User Guide.
1452
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
If your policy does not grant permission to create or modify a specific resource, the console
displays an encoded message with diagnostic information. You can decode the message using
the DecodeAuthorizationMessage API action for AWS STS, or the decode-authorization-message
command in the AWS CLI.
Examples
• Example: Read-only access (p. 1453)
• Example: Use the EC2 launch instance wizard (p. 1454)
• Example: Work with volumes (p. 1457)
• Example: Work with security groups (p. 1458)
• Example: Work with Elastic IP addresses (p. 1460)
• Example: Work with Reserved Instances (p. 1460)
Alternatively, you can provide read-only access to a subset of resources. To do this, replace the *
wildcard in the ec2:Describe API action with specific ec2:Describe actions for each resource. The
following policy allows users to view all instances, AMIs, and snapshots in the Amazon EC2 console.
The ec2:DescribeTags action allows users to view public AMIs. The console requires the tagging
information to display public AMIs; however, you can remove this action to allow users to view only
private AMIs.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeImages",
"ec2:DescribeTags",
"ec2:DescribeSnapshots"
],
"Resource": "*"
}
]
}
Note
The Amazon EC2 ec2:Describe* API actions do not support resource-level permissions, so
you cannot control which individual resources users can view in the console. Therefore, the *
wildcard is necessary in the Resource element of the above statement. For more information
about which ARNs you can use with which Amazon EC2 API actions, see Actions, resources, and
condition keys for Amazon EC2.
The following policy allows users to view instances in the Amazon EC2 console, as well as CloudWatch
alarms and metrics in the Monitoring tab of the Instances page. The Amazon EC2 console uses the
CloudWatch API to display the alarms and metrics, so you must grant users permission to use the
cloudwatch:DescribeAlarms and cloudwatch:GetMetricStatistics actions.
1453
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"cloudwatch:DescribeAlarms",
"cloudwatch:GetMetricStatistics"
],
"Resource": "*"
}
]
}
To complete a launch successfully, users must be given permission to use the ec2:RunInstances API
action, and at least the following API actions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeImages",
"ec2:DescribeInstanceTypes",
"ec2:DescribeKeyPairs",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:CreateSecurityGroup",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateKeyPair"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
1454
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Resource": "*"
}
]
}
You can add API actions to your policy to provide more options for users, for example:
Currently, the Amazon EC2 Describe* API actions do not support resource-level permissions, so you
cannot restrict which individual resources users can view in the launch instance wizard. However, you can
apply resource-level permissions on the ec2:RunInstances API action to restrict which resources users
can use to launch an instance. The launch fails if users select options that they are not authorized to use.
The following policy allows users to launch t2.micro instances using AMIs owned by Amazon, and only
into a specific subnet (subnet-1a2b3c4d). Users can only launch in the sa-east-1 Region. If users
select a different Region, or select a different instance type, AMI, or subnet in the launch instance wizard,
the launch fails.
The first statement grants users permission to view the options in the launch instance wizard or to create
new ones, as explained in the example above. The second statement grants users permission to use the
network interface, volume, key pair, security group, and subnet resources for the ec2:RunInstances
action, which are required to launch an instance into a VPC. For more information about using the
ec2:RunInstances action, see Launch instances (RunInstances) (p. 1428). The third and fourth
statements grant users permission to use the instance and AMI resources respectively, but only if the
instance is a t2.micro instance, and only if the AMI is owned by Amazon, or certain trusted and verified
partners.
{
"Version": "2012-10-17",
"Statement": [{
1455
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeImages",
"ec2:DescribeInstanceTypes",
"ec2:DescribeKeyPairs",
"ec2:CreateKeyPair",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:CreateSecurityGroup",
"ec2:AuthorizeSecurityGroupIngress"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action":"ec2:RunInstances",
"Resource": [
"arn:aws:ec2:sa-east-1:111122223333:network-interface/*",
"arn:aws:ec2:sa-east-1:111122223333:volume/*",
"arn:aws:ec2:sa-east-1:111122223333:key-pair/*",
"arn:aws:ec2:sa-east-1:111122223333:security-group/*",
"arn:aws:ec2:sa-east-1:111122223333:subnet/subnet-1a2b3c4d"
]
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:sa-east-1:111122223333:instance/*"
],
"Condition": {
"StringEquals": {
"ec2:InstanceType": "t2.micro"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:sa-east-1::image/ami-*"
],
"Condition": {
"StringEquals": {
"ec2:Owner": "amazon"
}
}
}
]
}
The following policy grants access to use Systems Manager parameters with a specific name.
The first statement grants users the permission to view Systems Manager parameters when selecting
an AMI in the launch instance wizard. The second statement grants users the permission to only use
parameters that are named prod-*.
{
"Version": "2012-10-17",
"Statement": [{
1456
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Effect": "Allow",
"Action": [
"ssm:DescribeParameters"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ssm:GetParameters"
],
"Resource": "arn:aws:ssm:us-east-2:123456123:parameter/prod-*"
}
]
}
Users can attach any volume to instances that have the tag "purpose=test", and also detach volumes
from those instances. To attach a volume using the Amazon EC2 console, it is helpful for users to have
permission to use the ec2:DescribeInstances action, as this allows them to select an instance from a
pre-populated list in the Attach Volume dialog box. However, this also allows users to view all instances
on the Instances page in the console, so you can omit this action.
In the first statement, the ec2:DescribeAvailabilityZones action is necessary to ensure that a user
can select an Availability Zone when creating a volume.
Users cannot tag the volumes that they create (either during or after volume creation).
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeVolumes",
"ec2:DescribeAvailabilityZones",
"ec2:CreateVolume",
"ec2:DescribeInstances"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:DetachVolume"
],
"Resource": "arn:aws:ec2:region:111122223333:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/purpose": "test"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:DetachVolume"
],
1457
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Resource": "arn:aws:ec2:region:111122223333:volume/*"
}
]
}
The following policy grants users permission to view security groups in the Amazon EC2 console, to add
and remove inbound and outbound rules, and to list and modify rule descriptions for existing security
groups that have the tag Department=Test.
In the first statement, the ec2:DescribeTags action allows users to view tags in the console, which
makes it easier for users to identify the security groups that they are allowed to modify.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeSecurityGroups",
"ec2:DescribeSecurityGroupRules",
"ec2:DescribeTags"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:RevokeSecurityGroupEgress",
"ec2:ModifySecurityGroupRules",
"ec2:UpdateSecurityGroupRuleDescriptionsIngress",
"ec2:UpdateSecurityGroupRuleDescriptionsEgress"
],
"Resource": [
"arn:aws:ec2:region:111122223333:security-group/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/Department": "Test"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:ModifySecurityGroupRules"
],
"Resource": [
"arn:aws:ec2:region:111122223333:security-group-rule/*"
]
}
]}
You can create a policy that allows users to work with the Create Security Group dialog box in the
Amazon EC2 console. To use this dialog box, users must be granted permission to use at the least the
following API actions:
1458
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
With these permissions, users can create a new security group successfully, but they cannot add any rules
to it. To work with rules in the Create Security Group dialog box, you can add the following API actions
to your policy:
The following policy grants users permission to use the Create Security Group dialog box, and to create
inbound and outbound rules for security groups that are associated with a specific VPC (vpc-1a2b3c4d).
Users can create security groups for EC2-Classic or another VPC, but they cannot add any rules to them.
Similarly, users cannot add any rules to any existing security group that's not associated with VPC
vpc-1a2b3c4d. Users are also granted permission to view all security groups in the console. This makes
it easier for users to identify the security groups to which they can add inbound rules. This policy also
grants users permission to delete security groups that are associated with VPC vpc-1a2b3c4d.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeSecurityGroups",
"ec2:CreateSecurityGroup",
"ec2:DescribeVpcs"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:DeleteSecurityGroup",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress"
],
"Resource": "arn:aws:ec2:region:111122223333:security-group/*",
1459
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM policies
"Condition":{
"ArnEquals": {
"ec2:Vpc": "arn:aws:ec2:region:111122223333:vpc/vpc-1a2b3c4d"
}
}
}
]
}
To allow users to work with Elastic IP addresses, you can add the following actions to your policy.
The following policy allows users to view, allocate, and associate Elastic IP addresses with instances.
Users cannot associate Elastic IP addresses with network interfaces, disassociate Elastic IP addresses, or
release them.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeAddresses",
"ec2:AllocateAddress",
"ec2:DescribeInstances",
"ec2:AssociateAddress"
],
"Resource": "*"
}
]
}
This policy allows users to view all the Reserved Instances, as well as On-Demand Instances, in the
account. It's not possible to set resource-level permissions for individual Reserved Instances.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
1460
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS managed policies
"ec2:DescribeReservedInstances",
"ec2:ModifyReservedInstances",
"ec2:PurchaseReservedInstancesOffering",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypes",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeReservedInstancesOfferings"
],
"Resource": "*"
}
]
}
The ec2:DescribeAvailabilityZones action is necessary to ensure that the Amazon EC2 console
can display information about the Availability Zones in which you can purchase Reserved Instances. The
ec2:DescribeInstances action is not required, but ensures that the user can view the instances in the
account and purchase reservations to match the correct specifications.
You can adjust the API actions to limit user access, for example removing ec2:DescribeInstances
and ec2:DescribeAvailabilityZones means the user has read-only access.
AWS services maintain and update AWS managed policies. You can't change the permissions in AWS
managed policies. Services occasionally add additional permissions to an AWS managed policy to
support new features. This type of update affects all identities (users, groups, and roles) where the policy
is attached. Services are most likely to update an AWS managed policy when a new feature is launched
or when new operations become available. Services do not remove permissions from an AWS managed
policy, so policy updates won't break your existing permissions.
Additionally, AWS supports managed policies for job functions that span multiple services. For example,
the ReadOnlyAccess AWS managed policy provides read-only access to all AWS services and resources.
When a service launches a new feature, AWS adds read-only permissions for new operations and
resources. For a list and descriptions of job function policies, see AWS managed policies for job functions
in the IAM User Guide.
To view the permissions for this policy, see AmazonEC2FullAccess in the AWS Managed Policy Reference.
To view the permissions for this policy, see AmazonEC2ReadOnlyAccess in the AWS Managed Policy
Reference.
1461
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
EC2FastLaunchServiceRolePolicy (p.Amazon
1462) EC2 added the Windows November 26, 2021
– New policy faster launching feature to
enable Windows AMIs to launch
instances faster by creating a set
of pre-provisioned snapshots.
Amazon EC2 started tracking Amazon EC2 started tracking March 1, 2021
changes changes to its AWS managed
policies
1462
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
For example, you can securely distribute your AWS credentials to the instances, enabling the applications
on those instances to use your credentials to sign requests, while protecting your credentials from other
users. However, it's challenging to securely distribute credentials to each instance, especially those that
AWS creates on your behalf, such as Spot Instances or instances in Auto Scaling groups. You must also be
able to update the credentials on each instance when you rotate your AWS credentials.
Note
For your Amazon EC2 workloads, we recommend that you retrieve session credentials using
the method described below. These credentials should enable your workload to make AWS API
requests, without needing to use sts:AssumeRole to assume the same role that is already
associated with the instance. Unless you need to pass session tags for attribute-based access
control (ABAC) or pass a session policy to further restrict permissions of the role, such role
assumption calls are unnecessary as they create a new set of the same temporary role session
credentials.
If your workload uses a role to assume itself, you must create a trust policy that explicitly allows
that role to assume itself. If you do not create the trust policy, you get the AccessDenied error.
For more information, see Modifying a role trust policy in the IAM User Guide.
We designed IAM roles so that your applications can securely make API requests from your instances,
without requiring you to manage the security credentials that the applications use. Instead of creating
and distributing your AWS credentials, you can delegate permission to make API requests using IAM roles
as follows:
For example, you can use IAM roles to grant permissions to applications running on your instances that
need to use a bucket in Amazon S3. You can specify permissions for IAM roles by creating a policy in
JSON format. These are similar to the policies that you create for users. If you change a role, the change
is propagated to all instances.
You can only attach one IAM role to an instance, but you can attach the same role to many instances. For
more information about creating and using IAM roles, see Roles in the IAM User Guide.
You can apply resource-level permissions to your IAM policies to control the users' ability to attach,
replace, or detach IAM roles for an instance. For more information, see Supported resource-level
permissions for Amazon EC2 API actions (p. 1409) and the following example: Example: Work with IAM
roles (p. 1446).
Contents
• Instance profiles (p. 1463)
• Retrieve security credentials from instance metadata (p. 1464)
• Grant a user permission to pass an IAM role to an instance (p. 1465)
• Work with IAM roles (p. 1465)
Instance profiles
Amazon EC2 uses an instance profile as a container for an IAM role. When you create an IAM role using
the IAM console, the console creates an instance profile automatically and gives it the same name as the
role to which it corresponds. If you use the Amazon EC2 console to launch an instance with an IAM role
or to attach an IAM role to an instance, you choose the role based on a list of instance profile names.
1463
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
If you use the AWS CLI, API, or an AWS SDK to create a role, you create the role and instance profile as
separate actions, with potentially different names. If you then use the AWS CLI, API, or an AWS SDK to
launch an instance with an IAM role or to attach an IAM role to an instance, specify the instance profile
name.
An instance profile can contain only one IAM role. This limit cannot be increased.
For more information, see Instance Profiles in the IAM User Guide.
The following command retrieves the security credentials for an IAM role named s3access.
IMDSv2
IMDSv1
{
"Code" : "Success",
"LastUpdated" : "2012-04-26T16:39:16Z",
"Type" : "AWS-HMAC",
"AccessKeyId" : "ASIAIOSFODNN7EXAMPLE",
"SecretAccessKey" : "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"Token" : "token",
"Expiration" : "2017-05-17T15:09:54Z"
}
For applications, AWS CLI, and Tools for Windows PowerShell commands that run on the instance, you
do not have to explicitly get the temporary security credentials—the AWS SDKs, AWS CLI, and Tools for
Windows PowerShell automatically get the credentials from the EC2 instance metadata service and use
them. To make a call outside of the instance using temporary security credentials (for example, to test
IAM policies), you must provide the access key, secret key, and the session token. For more information,
see Using Temporary Security Credentials to Request Access to AWS Resources in the IAM User Guide.
1464
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
For more information about instance metadata, see Instance metadata and user data (p. 817). For
information about the instance metadata IP address, see Retrieve instance metadata (p. 831).
• iam:PassRole
• ec2:AssociateIamInstanceProfile
• ec2:ReplaceIamInstanceProfileAssociation
For example, the following IAM policy grants users permission to launch instances with an IAM role, or to
attach or replace an IAM role for an existing instance using the AWS CLI.
Note
If you want the policy to grant users access to all of your roles, specify the resource as * in the
policy. However, please consider the principle of least privilege as a best-practice .
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:RunInstances",
"ec2:AssociateIamInstanceProfile",
"ec2:ReplaceIamInstanceProfileAssociation"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::123456789012:role/DevTeam*"
}
]
}
To grant users permission to launch instances with an IAM role, or to attach or replace an IAM role
for an existing instance using the Amazon EC2 console, you must grant them permission to use
iam:ListInstanceProfiles, iam:PassRole, ec2:AssociateIamInstanceProfile, and
ec2:ReplaceIamInstanceProfileAssociation in addition to any other permissions they might
need. For example policies, see Example policies for working in the Amazon EC2 console (p. 1452).
Contents
• Create an IAM role (p. 1466)
• Launch an instance with an IAM role (p. 1468)
• Attach an IAM role to an instance (p. 1470)
• Replace an IAM role (p. 1471)
1465
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
Console
Command line
The followingexample creates an IAM role with a policy that allows the role to use an Amazon S3
bucket.
1. Create the following trust policy and save it in a text file named ec2-role-trust-
policy.json.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
2. Create the s3access role and specify the trust policy that you created using the create-role
command.
Example response
{
"Role": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
1466
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
}
}
]
},
"RoleId": "AROAIIZKPBKS2LEXAMPLE",
"CreateDate": "2013-12-12T23:46:37.247Z",
"RoleName": "s3access",
"Path": "/",
"Arn": "arn:aws:iam::123456789012:role/s3access"
}
}
3. Create an access policy and save it in a text file named ec2-role-access-policy.json. For
example, this policy grants administrative permissions for Amazon S3 to applications running on
the instance.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:*"],
"Resource": ["*"]
}
]
}
4. Attach the access policy to the role using the put-role-policy command.
Example response
{
"InstanceProfile": {
"InstanceProfileId": "AIPAJTLBPJLEGREXAMPLE",
"Roles": [],
"CreateDate": "2013-12-12T23:53:34.093Z",
"InstanceProfileName": "s3access-profile",
"Path": "/",
"Arn": "arn:aws:iam::123456789012:instance-profile/s3access-profile"
}
}
1467
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
--role-name s3access
Alternatively, you can use the following AWS Tools for Windows PowerShell commands:
• New-IAMRole
• Register-IAMRolePolicy
• New-IAMInstanceProfile
New console
IMDSv2
IMDSv1
1468
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
Old console
IMDSv2
IMDSv1
Command line
You can use the AWS CLI to associate a role with an instance during launch. You must specify the
instance profile in the command.
1. Use the run-instances command to launch an instance using the instance profile. The following
example shows how to launch an instance with the instance profile.
1469
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/role_name
Console
Command line
1. If required, describe your instances to get the ID of the instance to which to attach the role.
2. Use the associate-iam-instance-profile command to attach the IAM role to the instance by
specifying the instance profile. You can use the Amazon Resource Name (ARN) of the instance
profile, or you can use its name.
Example response
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-1234567890abcdef0",
"State": "associating",
"AssociationId": "iip-assoc-0dbd8529a48294120",
"IamInstanceProfile": {
"Id": "AIPAJLNLDX3AMYZNWYYAY",
"Arn": "arn:aws:iam::123456789012:instance-profile/TestRole-1"
}
}
}
1470
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
• Get-EC2Instance
• Register-EC2IamInstanceProfile
Console
Command line
1. If required, describe your IAM instance profile associations to get the association ID for the IAM
instance profile to replace.
Example response
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-087711ddaf98f9489",
"State": "associating",
"AssociationId": "iip-assoc-09654be48e33b91e0",
"IamInstanceProfile": {
"Id": "AIPAJCJEDKX7QYHWYK7GS",
"Arn": "arn:aws:iam::123456789012:instance-profile/TestRole-2"
}
}
}
• Get-EC2IamInstanceProfileAssociation
• Set-EC2IamInstanceProfileAssociation
1471
Amazon Elastic Compute Cloud
User Guide for Windows Instances
IAM roles
Console
Command line
Example response
{
"IamInstanceProfileAssociations": [
{
"InstanceId": "i-088ce778fbfeb4361",
"State": "associated",
"AssociationId": "iip-assoc-0044d817db6c0a4ba",
"IamInstanceProfile": {
"Id": "AIPAJEDNCAA64SSD265D6",
"Arn": "arn:aws:iam::123456789012:instance-profile/TestRole-2"
}
}
]
}
2. Use the disassociate-iam-instance-profile command to detach the IAM instance profile using its
association ID.
Example response
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-087711ddaf98f9489",
"State": "disassociating",
"AssociationId": "iip-assoc-0044d817db6c0a4ba",
"IamInstanceProfile": {
"Id": "AIPAJEDNCAA64SSD265D6",
"Arn": "arn:aws:iam::123456789012:instance-profile/TestRole-2"
}
}
1472
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network access
• Get-EC2IamInstanceProfileAssociation
• Unregister-EC2IamInstanceProfile
Your default security groups and newly created security groups include default rules that do not
enable you to access your instance from the internet. For more information, see Default security
groups (p. 1493) and Custom security groups (p. 1494). To enable network access to your instance, you
must allow inbound traffic to your instance. To open a port for inbound traffic, add a rule to a security
group that you associated with your instance when you launched it.
To connect to your instance, you must set up a rule to authorize RDP traffic from your computer's public
IPv4 address. To allow RDP traffic from additional IP address ranges, add another rule for each range you
need to authorize.
If you've enabled your VPC for IPv6 and launched your instance with an IPv6 address, you can connect to
your instance using its IPv6 address instead of a public IPv4 address. Your local computer must have an
IPv6 address and must be configured to use IPv6.
If you need to enable network access to a Linux instance, see Authorizing inbound traffic for your Linux
instances in the Amazon EC2 User Guide for Linux Instances.
1473
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network access
Windows Firewall may also block incoming traffic. If you're having trouble setting up access to your
instance, you may have to disable Windows Firewall. For more information, see Remote Desktop can't
connect to the remote computer (p. 1927).
To add a rule to a security group for inbound RDP traffic over IPv4 (console)
Alternatively, for Source, choose Custom and enter the public IPv4 address of your computer
or network in CIDR notation. For example, if your IPv4 address is 203.0.113.25, enter
203.0.113.25/32 to list this single IPv4 address in CIDR notation. If your company allocates
addresses from a range, enter the entire range, such as 203.0.113.0/24.
For information about finding your IP address, see Before you start (p. 1473).
d. Choose Save rules.
If you launched an instance with an IPv6 address and want to connect to your instance using its IPv6
address, you must add rules that allow inbound IPv6 traffic over RDP.
To add a rule to a security group for inbound RDP traffic over IPv6 (console)
1474
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Network access
Note
Be sure to run the following commands on your local system, not on the instance itself. For
more information about these command line interfaces, see Access Amazon EC2 (p. 3).
1. Find the security group that is associated with your instance using one of the following commands:
Both commands return a security group ID, which you use in the next step.
2. Add the rule to the security group using one of the following commands:
1475
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Key pairs
After you launch an instance, you can change its security groups. For more information, see the section
called “Change an instance's security group” (p. 1501).
Anyone who possesses your private key can connect to your instances, so it's important that you store
your private key in a secure place.
When you launch an instance, you can specify a key pair (p. 543). If you plan to connect to the instance
using RDP, you must specify a key pair. You can choose an existing key pair or create a new one.
Depending on how you manage your security, you can specify the same key pair for all your instances
or you can specify different key pairs. With Windows instances, you use the private key to obtain the
administrator password and then log in using RDP. For more information about connecting to your
instance, see Connect to your Windows instance (p. 610). For more information about key pairs and
Linux instances, see Amazon EC2 key pairs and Linux instances in the Amazon EC2 User Guide for Linux
Instances.
Because Amazon EC2 doesn't keep a copy of your private key, there is no way to recover a private key if
you lose it. However, there can still be a way to connect to instances for which you've lost the private key.
For more information, see I've lost my private key. How can I connect to my Windows instance? (p. 1934)
You can use Amazon EC2 to create your key pairs. You can also use a third-party tool to create your key
pairs, and then import the public keys to Amazon EC2.
Amazon EC2 supports 2048-bit SSH-2 RSA keys for Windows instances. ED25519 keys are not supported
for Windows instances.
Contents
• Create key pairs (p. 1476)
• Tag a public key (p. 1481)
• Describe public keys (p. 1482)
• Delete your public key on Amazon EC2 (p. 1486)
• Verify keys (p. 1487)
For steps to connect to your Windows instance using RDP after you have created a key pair, see Connect
to your Windows instance.
Contents
1476
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create key pairs
You can use Amazon EC2 to create a key pair using one of the following methods.
Console
AWS CLI
• Use the create-key-pair command as follows to generate the key pair and to save the private key
to a .pem file.
For --key-name, specify a name for the public key. The name can be up to 255 ASCII
characters.
For --key-type, specify either rsa or ed25519. If you do not include the --key-type
parameter, an rsa key is created by default. Note that ED25519 keys are not supported for
Windows instances.
For --key-format, specify either pem or ppk. If you do not include the --key-format
parameter, a pem file is created by default.
1477
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create key pairs
--output text > my-key-pair.pem saves the private key material in a file with the
specified extension. The extension can be either .pem or .ppk. The private key can have a name
that's different from the public key name, but for ease of use, use the same name.
PowerShell
Use the New-EC2KeyPair AWS Tools for Windows PowerShell command as follows to generate the
key and save it to a .pem or .ppk file.
For -KeyName, specify a name for the public key. The name can be up to 255 ASCII characters.
For -KeyType, specify either rsa or ed25519. If you do not include the -KeyType parameter, an
rsa key is created by default. Note that ED25519 keys are not supported for Windows instances.
For -KeyFormat, specify either pem or ppk. If you do not include the -KeyFormat parameter, a pem
file is created by default.
/ec2/keypair/key_pair_id
For more information, see AWS Systems Manager Parameter Store in the AWS Systems Manager User
Guide.
Resources:
NewKeyPair:
Type: 'AWS::EC2::KeyPair'
1478
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create key pairs
Properties:
KeyName: new-key-pair
2. Use the describe-key-pairs command as follows to get the ID of the key pair.
key-05abb699beEXAMPLE
3. Use the get-parameter command as follows to get the parameter for your key and save the key
material in a .pem file.
To enable AWS CloudFormation to manage Parameter Store parameters on your behalf, the IAM role
assumed by AWS CloudFormation or your user must have the following permissions:
• ssm:PutParameter – Grants permission to create a parameter for the private key material.
• ssm:DeleteParameter – Grants permission to delete the parameter that stored the private
key material. This permission is required whether the key pair was imported or created by AWS
CloudFormation.
When AWS CloudFormation deletes a key pair that was created or imported by a stack, it performs a
permissions check to determine whether you have permission to delete parameters, even though AWS
CloudFormation creates a parameter only when it creates a key pair, not when it imports a key pair.
AWS CloudFormation tests for the required permission using a fabricated parameter name that does
not match any parameter in your account. Therefore, you might see a fabricated parameter name in the
AccessDeniedException error message.
Create a key pair using a third-party tool and import the public
key to Amazon EC2
Instead of using Amazon EC2 to create your key pair, you can create an RSA key pair by using a third-
party tool, and then import the public key to Amazon EC2.
• Supported types: RSA. Amazon EC2 does not accept DSA keys.
Note
ED25519 keys are not supported for Windows instances.
• Supported formats:
• OpenSSH public key format
• SSH private key file format must be PEM or PPK
• (RSA only) Base64 encoded DER format
• (RSA only) SSH public key file format as specified in RFC 4716
• Supported lengths: 1024, 2048, and 4096.
1479
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create key pairs
1. Generate a key pair with a third-party tool of your choice. For example, you can use ssh-keygen (a
tool provided with the standard OpenSSH installation). Alternatively, Java, Ruby, Python, and many
other programming languages provide standard libraries that you can use to create an RSA key pair.
Important
The private key must be in the PEM or PPK format. For example, use ssh-keygen -m PEM
to generate the OpenSSH key in the PEM format.
2. Save the public key to a local file. For example, C:\keys\my-key-pair.pub. The file name
extension for this file is not important.
3. Save the private key to a local file that has the .pem or .ppk extension. For example, C:\keys\my-
key-pair.pem or C:\keys\my-key-pair.ppk. The file name extension for this file is important
because only .pem files can be selected when connecting to your Windows instance from the EC2
console.
Important
Save the private key file in a safe place. You'll need to provide the name of your public key
when you launch an instance, and the corresponding private key each time you connect to
the instance.
After you have created the key pair, use one of the following methods to import your public key to
Amazon EC2.
Console
AWS CLI
1480
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Tag a public key
You can view, add, and delete tags using one of the following methods.
Console
• To add a tag, choose Add tag, and then enter the tag key and value. You can add up to 50
tags per key. For more information, see Tag restrictions (p. 1898).
• To delete a tag, choose Remove next to the tag to delete.
5. Choose Save.
AWS CLI
Use the describe-tags AWS CLI command. In the following example, you describe the tags for all of
your public keys.
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "key-0123456789EXAMPLE",
"ResourceType": "key-pair",
"Value": "Production"
},
{
"Key": "Environment",
"ResourceId": "key-9876543210EXAMPLE",
"ResourceType": "key-pair",
"Value": "Production"
}]
}
1481
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Describe public keys
{
"KeyPairs": [
{
"KeyName": "MyKeyPair",
"KeyFingerprint":
"1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f",
"KeyPairId": "key-0123456789EXAMPLE",
"Tags": [
{
"Key": "Environment",
"Value": "Production"
}]
}]
}
Use the create-tags AWS CLI command. In the following example, the public key is tagged with
Key=Cost-Center and Value=CC-123.
Use the delete-tags AWS CLI command. For examples, see Examples in the AWS CLI Command
Reference.
PowerShell
Topics
1482
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Describe public keys
You can use the Amazon EC2 console or AWS CLI to view information about your public keys.
Console
4. To view a public key's tags, select the check box next to the key, and then choose Actions,
Manage tags.
AWS CLI
Example output
{
"KeyPairs": [
{
"KeyPairId": "key-0123456789example",
"KeyFingerprint":
"1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f",
"KeyName": "key-pair-name",
"KeyType": "rsa",
"Tags": [],
"CreateTime": "2022-04-28T11:37:26.000Z"
}
]
}
1483
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Describe public keys
Alternatively, instead of --key-names, you can specify the --key-pair-ids parameter to identify
the public key.
To view the public key material in the output, you must specify the --include-public-key
parameter.
Example output – In the output, the PublicKey field contains the public key material.
{
"KeyPairs": [
{
"KeyPairId": "key-0123456789example",
"KeyFingerprint":
"1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f",
"KeyName": "key-pair-name",
"KeyType": "rsa",
"Tags": [],
"PublicKey": "ssh-ed25519
AAAAC3NzaC1lZDI1NTE5AAAAIIj7azlDjVHAsSxgcpCRZ3oWnTm0nAFM64y9jd22ioI/ my-key-pair",
"CreateTime": "2022-04-28T11:37:26.000Z"
}
]
}
Use one of the following methods to retrieve the public key material.
On your local Windows computer, you can use PuTTYgen to get the public key for your key pair.
Start PuTTYgen and choose Load. Select the .ppk or .pem private key file. PuTTYgen displays the
public key under Public key for pasting into OpenSSH authorized_keys file. You can also view
the public key by choosing Save public key, specifying a name for the file, saving the file, and then
opening the file.
From the instance metadata
You can use Instance Metadata Service Version 2 or Instance Metadata Service Version 1 to retrieve
the public key from the instance metadata.
Note
If you change the key pair that you use to connect to the instance, Amazon EC2 does not
update the instance metadata to show the new public key. The instance metadata continues
to show the public key for the key pair that you specified when you launched the instance.
1484
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Describe public keys
IMDSv2
IMDSv1
Example output
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClKsfkNkuSevGj3eYhCe53pcjqP3maAhDFcvBS7O6V
hz2ItxCih+PnDSUaw+WNQn/mZphTk/a/gU8jEzoOWbkM4yxyb/wB96xbiFveSFJuOp/d6RJhJOI0iBXr
lsLnBItntckiJ7FbtxJMXLvvwJryDUilBMTjYtwB+QhYXUMOzce5Pjz5/i8SeJtjnV3iAoG/cQk+0FzZ
qaeJAAHco+CY/5WrUBkrHmFJr6HcXkvJdWPkYQS3xqC0+FmUZofz221CBt5IMucxXPkX4rWi+z7wB3Rb
BQoQzd8v7yeb7OzlPnWOyN0qFU0XA246RA8QFYiCNYwI3f05p6KLxEXAMPLE key-pair-name
For more information about instance metadata, see Retrieve instance metadata (p. 831).
From describe-key-pairs
To retrieve the public key material from the describe-key-pairsAWS CLI command
Use the describe-key-pairs command and specify the --key-names parameter to identify the
public key. To include the public key material in the output, specify the --include-public-key
parameter.
Example output – In the output, the PublicKey field contains the public key material.
{
"KeyPairs": [
{
"KeyPairId": "key-0123456789example",
"KeyFingerprint":
"1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f",
"KeyName": "key-pair-name",
"KeyType": "rsa",
"Tags": [],
"PublicKey": "ssh-ed25519
AAAAC3NzaC1lZDI1NTE5AAAAIIj7azlDjVHAsSxgcpCRZ3oWnTm0nAFM64y9jd22ioI/ my-key-pair",
"CreateTime": "2022-04-28T11:37:26.000Z"
}
]
}
Alternatively, instead of --key-names, you can specify the --key-pair-ids parameter to identify
the public key.
1485
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Delete a public key
Note
The value of the Key pair assigned at launch field does not change even if you change the
public key on the instance, or add public keys.
When you delete a public key using the following methods, you're only deleting the public key that
you stored in Amazon EC2 when you created (p. 1477) or imported (p. 1479) the key pair. Deleting a
public key doesn't remove the public key from any instances to which you've added it, either when you
launched the instance or later. It also doesn't delete the private key on your local computer. You can
continue to connect to instances that you launched using a public key that you've deleted from Amazon
EC2 as long as you still have the private key (.pem) file.
Important
If you're using an Auto Scaling group (for example, in an Elastic Beanstalk environment),
ensure that the public key you're deleting is not specified in an associated launch template or
launch configuration. If Amazon EC2 Auto Scaling detects an unhealthy instance, it launches a
replacement instance. However, the instance launch fails if the public key cannot be found. For
more information, see Launch templates in the Amazon EC2 Auto Scaling User Guide.
You can delete a public key on Amazon EC2 using the following methods.
Console
AWS CLI
1486
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Verify keys
Verify keys
Verify your key pair's fingerprint
On the Key Pairs page in the Amazon EC2 console, the Fingerprint column displays the fingerprints
generated from your key pairs.
You can use the fingerprint that's displayed on the Key Pairs page to verify that the private key you
have on your local machine matches the public key stored in Amazon EC2. From the computer where
you downloaded the private key file, generate a fingerprint from the private key file. The output should
match the fingerprint that's displayed in the console. When Amazon EC2 calculates a fingerprint, Amazon
EC2 might append padding to the fingerprint with = characters. Other tools, such as ssh-keygen, might
omit this padding.
The following table lists the hash functions that are used to calculate the fingerprints for RSA key pairs
that are created by Amazon EC2 and imported to Amazon EC2.
¹ If you import a public RSA key to Amazon EC2, the fingerprint is calculated using an MD5 hash
function. This is true regardless of how you created the key pair, for example, by using a third-party tool
or by generating a new public key from an existing private key created using Amazon EC2.
If you're using a Windows local machine, you can run the following commands using the Windows
Subsystem for Linux (WSL). Install the WSL and a Linux distribution using the instructions in the
Windows 10 Installation Guide. The example in the instructions installs the Ubuntu distribution of Linux,
but you can install any distribution. You are prompted to restart your computer for the changes to take
effect.
1487
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security groups
Use the OpenSSL tools to generate a fingerprint as shown in the following examples.
openssl pkcs8 -in path_to_private_key -inform PEM -outform DER -topk8 -nocrypt | openssl
sha1 -c
You can follow this procedure regardless of how you created the key pair, for example, by using a
third-party tool or by generating a new public key from an existing private key created using Amazon
EC2
Use the OpenSSL tools to generate the fingerprint as shown in the following example.
• If you created an OpenSSH key pair using OpenSSH 7.8 or later and imported the public key to
Amazon EC2
When you launch an instance in a VPC, you must specify a security group that's created for that VPC.
After you launch an instance, you can change its security groups. Security groups are associated with
network interfaces. Changing an instance's security groups changes the security groups associated
with the primary network interface (eth0). For more information, see Change an instance's security
group (p. 1501). You can also change the security groups associated with any other network interface.
For more information, see Modify network interface attributes (p. 1269).
Security is a shared responsibility between AWS and you. For more information, see Security in Amazon
EC2 (p. 1393). AWS provides security groups as one of the tools for securing your instances, and you
need to configure them to meet your security needs. If you have requirements that aren't fully met by
security groups, you can maintain your own firewall on any of your instances in addition to using security
groups.
To allow traffic to a Linux instance, see Amazon EC2 security groups for Linux instances in the Amazon
EC2 User Guide for Linux Instances.
1488
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules
Contents
• Security group rules (p. 1489)
• Security group connection tracking (p. 1491)
• Untracked connections (p. 1491)
• Automatically tracked connections (p. 1492)
• Throttling (p. 1492)
• Example (p. 1492)
• Default and custom security groups (p. 1493)
• Default security groups (p. 1493)
• Custom security groups (p. 1494)
• Work with security groups (p. 1494)
• Create a security group (p. 1495)
• Copy a security group (p. 1495)
• View your security groups (p. 1496)
• Add rules to a security group (p. 1496)
• Update security group rules (p. 1498)
• Delete rules from a security group (p. 1499)
• Delete a security group (p. 1500)
• Assign a security group to an instance (p. 1500)
• Change an instance's security group (p. 1501)
• Security group rules for different use cases (p. 1501)
• Web server rules (p. 1502)
• Database server rules (p. 1502)
• Rules to connect to instances from your computer (p. 1503)
• Rules to connect to instances from an instance with the same security group (p. 1503)
• Rules for ping/ICMP (p. 1504)
• DNS server rules (p. 1504)
• Amazon EFS rules (p. 1505)
• Elastic Load Balancing rules (p. 1505)
• VPC peering rules (p. 1505)
• By default, security groups contain outbound rules that allow all outbound traffic. You can delete
these rules. Note that Amazon EC2 blocks traffic on port 25 by default. For more information, see
Restriction on email sent using port 25 (p. 1911).
• Security group rules are always permissive; you can't create rules that deny access.
• Security group rules enable you to filter traffic based on protocols and port numbers.
• Security groups are stateful—if you send a request from your instance, the response traffic for that
request is allowed to flow in regardless of inbound security group rules. For VPC security groups, this
also means that responses to allowed inbound traffic are allowed to flow out, regardless of outbound
rules. For more information, see Security group connection tracking (p. 1491).
1489
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules
• You can add and remove rules at any time. Your changes are automatically applied to the instances
that are associated with the security group.
The effect of some rule changes can depend on how the traffic is tracked. For more information, see
Security group connection tracking (p. 1491).
• When you associate multiple security groups with an instance, the rules from each security group
are effectively aggregated to create one set of rules. Amazon EC2 uses this set of rules to determine
whether to allow access.
You can assign multiple security groups to an instance. Therefore, an instance can have hundreds of
rules that apply. This might cause problems when you access the instance. We recommend that you
condense your rules as much as possible.
Note
Security groups cannot block DNS requests to or from the Route 53 Resolver, sometimes
referred to as the 'VPC+2 IP address' (see What is Amazon Route 53 Resolver? in the Amazon
Route 53 Developer Guide), or the ‘AmazonProvidedDNS’ (see Work with DHCP option sets in the
Amazon Virtual Private Cloud User Guide). If you wish to filter DNS requests through the Route
53 Resolver, you can enable Route 53 Resolver DNS Firewall (see Route 53 Resolver DNS Firewall
in the Amazon Route 53 Developer Guide).
• Name: The name for the security group (for example, "my-security-group").
A name can be up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/
()#,@[]+=;{}!$*. When the name contains trailing spaces, we trim the spaces when we save the name.
For example, if you enter "Test Security Group " for the name, we store it as "Test Security Group".
• Protocol: The protocol to allow. The most common protocols are 6 (TCP), 17 (UDP), and 1 (ICMP).
• Port range: For TCP, UDP, or a custom protocol, the range of ports to allow. You can specify a single
port number (for example, 22), or range of port numbers (for example, 7000-8000).
• ICMP type and code: For ICMP, the ICMP type and code. For example, use type 8 for ICMP Echo
Request or type 128 for ICMPv6 Echo Request.
• Source or destination: The source (inbound rules) or destination (outbound rules) for the traffic to
allow. Specify one of the following:
• A single IPv4 address. You must use the /32 prefix length. For example, 203.0.113.1/32.
• A single IPv6 address. You must use the /128 prefix length. For example,
2001:db8:1234:1a00::123/128.
• A range of IPv4 addresses, in CIDR block notation. For example, 203.0.113.0/24.
• A range of IPv6 addresses, in CIDR block notation. For example, 2001:db8:1234:1a00::/64.
• The ID of a prefix list. For example, pl-1234abc1234abc123. For more information, see Prefix lists
in the Amazon VPC User Guide.
• The ID of a security group (referred to here as the specified security group). For example, the
current security group, a security group from the same VPC, or a security group for a peered VPC.
This allows traffic based on the private IP addresses of the resources associated with the specified
security group. This does not add rules from the specified security group to the current security
group.
• (Optional) Description: You can add a description for the rule, which can help you identify it later. A
description can be up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/
()#,@[]+=;{}!$*.
When you create a security group rule, AWS assigns a unique ID to the rule. You can use the ID of a rule
when you use the API or CLI to modify or delete the rule.
1490
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connection tracking
When you specify a security group as the source or destination for a rule, the rule affects all instances
that are associated with the security group. Incoming traffic is allowed based on the private IP addresses
of the instances that are associated with the source security group (and not the public IP or Elastic IP
addresses). For more information about IP addresses, see Amazon EC2 instance IP addressing (p. 1189).
If your security group rule references a deleted security group in the same VPC or in a peer VPC, or if it
references a security group in a peer VPC for which the VPC peering connection has been deleted, the
rule is marked as stale. For more information, see Working with Stale Security Group Rules in the Amazon
VPC Peering Guide.
If there is more than one rule for a specific port, Amazon EC2 applies the most permissive rule. For
example, if you have a rule that allows access to TCP port 3389 (RDP) from IP address 203.0.113.1, and
another rule that allows access to TCP port 3389 from everyone, everyone has access to TCP port 3389.
When you add, update, or remove rules, the changes are automatically applied to all instances associated
with the security group.
As an example, suppose that you initiate a command such as netcat or similar to your instances from
your home computer, and your inbound security group rules allow ICMP traffic. Information about
the connection (including the port information) is tracked. Response traffic from the instance for the
command is not tracked as a new request, but rather as an established connection, and is allowed to flow
out of the instance, even if your outbound security group rules restrict outbound ICMP traffic.
For protocols other than TCP, UDP, or ICMP, only the IP address and protocol number is tracked. If your
instance sends traffic to another host, and the host sends the same type of traffic to your instance within
600 seconds, the security group for your instance accepts it regardless of inbound security group rules.
The security group accepts it because it’s regarded as response traffic for the original traffic.
When you change a security group rule, its tracked connections are not immediately interrupted. The
security group continues to allow packets until existing connections time out. To ensure that traffic is
immediately interrupted, or that all traffic is subject to firewall rules regardless of the tracking state, you
can use a network ACL for your subnet. Network ACLs are stateless and therefore do not automatically
allow response traffic. Adding a network ACL that blocks traffic in either direction breaks existing
connections. For more information, see Network ACLs in the Amazon VPC User Guide.
Note
Security groups have no effect on DNS traffic to or from the Route 53 Resolver, sometimes
referred to as the 'VPC+2 IP address' (see What is Amazon Route 53 Resolver? in the Amazon
Route 53 Developer Guide), or the ‘AmazonProvidedDNS’ (see Work with DHCP option sets in the
Amazon Virtual Private Cloud User Guide). If you wish to filter DNS requests through the Route
53 Resolver, you can enable Route 53 Resolver DNS Firewall (see Route 53 Resolver DNS Firewall
in the Amazon Route 53 Developer Guide).
Untracked connections
Not all flows of traffic are tracked. If a security group rule permits TCP or UDP flows for all traffic
(0.0.0.0/0 or ::/0) and there is a corresponding rule in the other direction that permits all response traffic
(0.0.0.0/0 or ::/0) for all ports (0-65535), then that flow of traffic is not tracked, unless it is part of an
automatically tracked connection (p. 1492). The response traffic for an untracked flow is allowed based
on the inbound or outbound rule that permits the response traffic, not based on tracking information.
An untracked flow of traffic is immediately interrupted if the rule that enables the flow is removed or
modified. For example, if you have an open (0.0.0.0/0) outbound rule, and you remove a rule that allows
1491
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Connection tracking
all (0.0.0.0/0) inbound SSH (TCP port 22) traffic to the instance (or modify it such that the connection
would no longer be permitted), your existing SSH connections to the instance are immediately dropped.
The connection was not previously being tracked, so the change will break the connection. On the other
hand, if you have a narrower inbound rule that initially allows an SSH connection (meaning that the
connection was tracked), but change that rule to no longer allow new connections from the address of
the current SSH client, the existing SSH connection is not interrupted because it is tracked.
Throttling
Amazon EC2 defines the maximum number of connections that can be tracked per instance. After the
maximum is reached, any packets that are sent or received are dropped because a new connection
cannot be established. When this happens, applications that send and receive packets cannot
communicate properly. Use the conntrack_allowance_available network performance metric to
determine the number of tracked connections still available for that instance type.
To determine whether packets were dropped because the network traffic for your instance exceeded
the maximum number of connections that can be tracked, use the conntrack_allowance_exceeded
network performance metric. For more information, see Monitor network performance for your EC2
instance (p. 1300).
With Elastic Load Balancing, if you exceed the maximum number of connections that can be tracked per
instance, we recommend that you scale either the number of instances registered with the load balancer
or the size of the instances registered with the load balancer.
Example
In the following example, the security group has inbound rules that allow TCP and ICMP traffic, and
outbound rules that allow all outbound traffic.
Inbound
1492
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Default and custom security groups
Outbound
With a direct network connection to the instance or network interface, the tracking behavior is as
follows:
• Inbound and outbound TCP traffic on port 22 (SSH) is tracked, because the inbound rule allows traffic
from 203.0.113.1/32 only, and not all IP addresses (0.0.0.0/0).
• Inbound and outbound TCP traffic on port 80 (HTTP) is not tracked, because the inbound and
outbound rules allow traffic from all IP addresses.
• ICMP traffic is always tracked.
If you remove the outbound rule for IPv4 traffic, all inbound and outbound IPv4 traffic is tracked,
including traffic on port 80 (HTTP). The same applies for IPv6 traffic if you remove the outbound rule for
IPv6 traffic.
Topics
• Default security groups (p. 1493)
• Custom security groups (p. 1494)
A default security group is named "default", and it has an ID assigned by AWS. The following are the
default rules for a default security group.
Inbound
The security group ID (its All All Allows inbound traffic from network
own resource ID) interfaces and instances that are assigned
to the same security group.
1493
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
Outbound
::/0 All All Allows all outbound IPv6 traffic. This rule
is added only if your VPC has an associated
IPv6 CIDR block.
You can add or remove inbound and outbound rules for any default security group.
You can't delete a default security group. If you try to delete a default security group, you see the
following error: Client.CannotDelete: the specified group: "sg-51530134" name:
"default" cannot be deleted by a user.
When you create a security group, you must provide it with a name and a description. Security group
names and descriptions can be up to 255 characters in length, and are limited to the following
characters:
A security group name cannot start with the following: sg-. A security group name must be unique for
the VPC.
The following are the default rules for a security group that you create:
After you've created a security group, you can change its inbound rules to reflect the type of inbound
traffic that you want to reach the associated instances. You can also change its outbound rules.
For more information about the rules you can add to a security group, see Security group rules for
different use cases (p. 1501).
After you launch an instance, you can change its security groups. For more information, see Change an
instance's security group (p. 1501).
You can create, view, update, and delete security groups and security group rules using the Amazon EC2
console and the command line tools.
Tasks
• Create a security group (p. 1495)
1494
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
By default, new security groups start with only an outbound rule that allows all traffic to leave the
instances. You must add rules to enable any inbound traffic or to restrict the outbound traffic.
A security group can be used only in the VPC for which it is created.
Console
a. Enter a descriptive name and brief description for the security group. They can't be edited
after the security group is created. The name and description can be up to 255 characters
long. The valid characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*.
b. For VPC, choose the VPC.
5. You can add security group rules now, or you can add them later. For more information, see Add
rules to a security group (p. 1496).
6. You can add tags now, or you can add them later. To add a tag, choose Add new tag and enter
the tag key and value.
7. Choose Create security group.
Command line
1495
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
the original security group is in a VPC, the copy is created in the same VPC unless you specify a different
one.
The copy receives a new unique security group ID and you must give it a name. You can also add a
description.
You can't copy a security group from one Region to another Region.
You can create a copy of a security group using the Amazon EC2 console.
Console
Command line
You can use Amazon EC2 Global View to view your security groups across all Regions for which your
AWS account is enabled. For more information, see List and filter resources across Regions using
Amazon EC2 Global View (p. 1892).
1496
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
Console
• For custom TCP or UDP, you must enter the port range to allow.
• For custom ICMP, you must choose the ICMP type from Protocol, and, if applicable, the
code from Port range. For example, to allow ping commands, choose Echo Request from
Protocol.
• For any other type, the protocol and port range are configured for you.
b. For Source, do one of the following to allow traffic.
• Choose Custom and then enter an IP address in CIDR notation, a CIDR block, another
security group, or a prefix list.
• Choose Anywhere to allow all traffic for the specified protocol to reach your instance.
This option automatically adds the 0.0.0.0/0 IPv4 CIDR block as the source. If your
security group is in a VPC that's enabled for IPv6, this option automatically adds a rule for
the ::/0 IPv6 CIDR block.
Warning
If you choose Anywhere, you enable all IPv4 and IPv6 addresses to access your
instance the specified protocol. If you are adding rules for ports 22 (SSH) or 3389
(RDP), you should authorize only a specific IP address or range of addresses to
access your instance.
• Choose My IP to allow inbound traffic from only your local computer's public IPv4
address.
c. For Description, optionally specify a brief description for the rule.
5. Choose Preview changes, Save rules.
• For custom TCP or UDP, you must enter the port range to allow.
• For custom ICMP, you must choose the ICMP type from Protocol, and, if applicable, the
code from Port range.
• For any other type, the protocol and port range are configured automatically.
b. For Destination, do one of the following.
• Choose Custom and then enter an IP address in CIDR notation, a CIDR block, another
security group, or a prefix list for which to allow outbound traffic.
• Choose Anywhere to allow outbound traffic to all IP addresses. This option automatically
adds the 0.0.0.0/0 IPv4 CIDR block as the destination.
1497
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
If your security group is in a VPC that's enabled for IPv6, this option automatically adds a
rule for the ::/0 IPv6 CIDR block.
• Choose My IP to allow outbound traffic only to your local computer's public IPv4 address.
c. (Optional) For Description, specify a brief description for the rule.
5. Choose Preview changes, Confirm.
Command line
Console
When you modify the protocol, port range, or source or destination of an existing security group rule
using the console, the console deletes the existing rule and adds a new one for you.
1498
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
5. The Manage tags page displays any tags that are assigned to the rule. To add a tag, choose Add
tag and enter the tag key and value. To delete a tag, choose Remove next to the tag that you
want to delete.
6. Choose Save changes.
Command line
You cannot modify the protocol, port range, or source or destination of an existing rule using the
Amazon EC2 API or a command line tools. Instead, you must delete the existing rule and add a new
rule. You can, however, update the description of an existing rule.
To update a rule
You can delete rules from a security group using one of the following methods.
Console
1499
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with security groups
Command line
Console
Command line
• To assign a security group to an instance when you launch the instance, see Network settings (p. 543)
of Launch an instance using defined parameters (p. 541) (new console) or Step 6: Configure Security
Group (p. 553) (old console).
• To specify a security group in a launch template, see Network settings (p. 558) of Create a new launch
template using parameters you define (p. 556).
1500
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules for different use cases
Requirements
Console
To remove an already associated security group, choose Remove for that security group.
5. Choose Save.
Command line
The following are examples of the kinds of rules that you can add to security groups for specific kinds of
access.
Examples
• Web server rules (p. 1502)
• Database server rules (p. 1502)
• Rules to connect to instances from your computer (p. 1503)
• Rules to connect to instances from an instance with the same security group (p. 1503)
• Rules for ping/ICMP (p. 1504)
• DNS server rules (p. 1504)
• Amazon EFS rules (p. 1505)
1501
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules for different use cases
• A specific IP address or range of IP addresses (in CIDR block notation) in your local network
• A security group ID for a group of instances that access the database
1502
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules for different use cases
You can optionally restrict outbound traffic from your database servers. For example, you might want
to allow access to the internet for software updates, but restrict all other kinds of traffic. You must first
remove the default outbound rule that allows all outbound traffic.
1503
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Security group rules for different use cases
other instance, as the source. If you reference the security group of the other instance as the
source, this does not allow traffic to flow between the instances.
The following table describes the inbound rule for a security group that enables associated instances to
communicate with each other. The rule allows all types of traffic.
To use the ping6 command to ping the IPv6 address for your instance, you must add the following
inbound ICMPv6 rule.
TCP 6 53
UDP 17 53
1504
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AWS PrivateLink
TCP 6 2049 (NFS) The ID of the security group Allows inbound NFS
access from resources
(including the mount
target) associated with this
security group
To mount an Amazon EFS file system on your Amazon EC2 instance, you must connect to your instance.
Therefore, the security group associated with your instance must have rules that allow inbound SSH from
your local computer or local network.
For more information, see Access AWS services through AWS PrivateLink in the AWS PrivateLink Guide.
1505
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Create an interface VPC endpoint
Contents
• Create an interface VPC endpoint (p. 1506)
• Create an endpoint policy (p. 1506)
For more information, see Access an AWS service using an interface VPC endpoint in the AWS PrivateLink
Guide.
Important
When a non-default policy is applied to an interface VPC endpoint for Amazon EC2, certain
failed API requests, such as those failing from RequestLimitExceeded, might not be logged
to AWS CloudTrail or Amazon CloudWatch.
For more information, see Control access to services using endpoint policies in the AWS PrivateLink
Guide.
The following example shows a VPC endpoint policy that denies permission to create unencrypted
volumes or to launch instances with unencrypted volumes. The example policy also grants permission to
perform all other Amazon EC2 actions.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*",
"Principal": "*"
},
{
"Action": [
"ec2:CreateVolume"
],
"Effect": "Deny",
"Resource": "*",
"Principal": "*",
"Condition": {
1506
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configuration management
"Bool": {
"ec2:Encrypted": "false"
}
}
},
{
"Action": [
"ec2:RunInstances"
],
"Effect": "Deny",
"Resource": "*",
"Principal": "*",
"Condition": {
"Bool": {
"ec2:Encrypted": "false"
}
}
}]
}
Each Amazon EC2 instance should adhere to organizational security standards. Do not install any
Windows roles and features that are not required, and do install software to protect against malicious
code (antivirus, antimalware, exploit mitigation), monitor host-integrity, and perform intrusion detection.
Configure security software to monitor and maintain OS security settings, protect the integrity of critical
OS files, and alert on deviations from the security baseline. Consider implementing recommended
security configuration benchmarks published by Microsoft, the Center for Internet Security (CIS), or
the National Institute of Standards and Technology (NIST). Consider using other Microsoft tools for
particular application servers, such as the Best Practice Analyzer for SQL Server.
AWS customers can also run Amazon Inspector assessments to improve the security and compliance of
applications deployed on Amazon EC2 instances. Amazon Inspector automatically assesses applications
for vulnerabilities or deviations from best practices and includes a knowledge base of hundreds of rules
mapped to common security compliance standards (for example, PCI DSS) and vulnerability definitions.
Examples of built-in rules include checking if remote root login is enabled, or if vulnerable software
versions are installed. These rules are regularly updated by AWS security researchers.
For EC2 instances in an Auto Scaling group, you can use the AWS-PatchAsgInstance runbook to help
avoid instances that are undergoing patching from being replaced. Alternatively, you can use any
automatic update services or recommended processes for installing updates that are provided by the
application vendor.
1507
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change management
You should configure Windows Update on your Amazon EC2 instances running Windows Server. By
default, you will not receive Windows updates on AMIs provided by AWS. For more information, see Best
practices for Windows on Amazon EC2 (p. 18).
For a list of the latest Amazon EC2 AMIs running Windows Server, see Details About AWS Windows AMI
Versions.
AWS provides several tools to help manage changes to AWS resources, including AWS CloudTrail,
AWS Config, AWS CloudFormation, and AWS Elastic Beanstalk, AWS OpsWorks, and management
packs for Systems Center Operations Manager and System Center Virtual Machine Manager. Note
that Microsoft releases Windows patches every Tuesday (sometimes even daily) and AWS updates
all Windows AMIs managed by AWS within five days after Microsoft releases a patch. Therefore it is
important to continually patch all baseline AMIs, update AWS CloudFormation templates and Auto
Scaling group configurations with the latest AMI IDs, and implement tools to automate running instance
patch management.
Microsoft provides several options for managing Windows OS and application changes. SCCM, for
example, provides full lifecycle coverage of environment modifications. Select tools that address
business requirements and control how changes will affect application SLAs, capacity, security, and
disaster recovery procedures. Avoid manual changes and instead leverage automated configuration
management software or command line tools such as the EC2 Run Command or Windows PowerShell to
implement scripted, repeatable change processes. To assist with this requirement, use bastion hosts with
enhanced logging for all interactions with your Windows instances to ensure that all events and tasks are
automatically recorded.
You can download third-party audit reports using AWS Artifact. For more information, see Downloading
Reports in AWS Artifact.
Your compliance responsibility when using AWS services is determined by the sensitivity of your data,
your company's compliance objectives, and applicable laws and regulations. AWS provides the following
resources to help with compliance:
• Security and Compliance Quick Start Guides – These deployment guides discuss architectural
considerations and provide steps for deploying baseline environments on AWS that are security and
compliance focused.
• Architecting for HIPAA Security and Compliance on Amazon Web Services – This whitepaper describes
how companies can use AWS to create HIPAA-eligible applications.
Note
Not all AWS services are HIPAA eligible. For more information, see the HIPAA Eligible Services
Reference.
1508
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Audit and accountability
• AWS Compliance Resources – This collection of workbooks and guides might apply to your industry
and location.
• Evaluating Resources with Rules in the AWS Config Developer Guide – The AWS Config service assesses
how well your resource configurations comply with internal practices, industry guidelines, and
regulations.
• AWS Security Hub – This AWS service provides a comprehensive view of your security state within
AWS. Security Hub uses security controls to evaluate your AWS resources and to check your compliance
against security industry standards and best practices. For a list of supported services and controls, see
Security Hub controls reference.
• AWS Audit Manager – This AWS service helps you continuously audit your AWS usage to simplify how
you manage risk and compliance with regulations and industry standards.
Amazon EC2 provides Amazon Machine Images (AMI) for Microsoft Windows Server to help you meet
the compliance standards of the Security Technical Implementation Guide (STIG). These AMIs are pre-
configured with a number of STIG standards to help you get started with your deployments while
meeting STIG compliance standards. For more information, see STIG Hardened Amazon EC2 Windows
Server AMIs (p. 56).
In addition to Microsoft systems management tools, customers can use Amazon CloudWatch to monitor
instance CPU utilization, disk performance, network I/O, and perform host and instance status checks.
The EC2Config and EC2Launch services provide access to additional, advanced features for Windows
instances. For example, they can export Windows system, security, application, and Internet Information
Services (IIS) logs to CloudWatch Logs which can then be integrated with Amazon CloudWatch metrics
and alarms. Customers can also create scripts that export Windows performance counters to Amazon
CloudWatch custom metrics.
NitroTPM
Nitro Trusted Platform Module (NitroTPM) is a virtual device that is provided by the AWS Nitro System
and conforms to the TPM 2.0 specification. It securely stores artifacts (such as passwords, certificates, or
encryption keys) that are used to authenticate the instance. NitroTPM can generate keys and use them
for cryptographic functions (such as hashing, signing, encryption, and decryption).
NitroTPM provides measured boot, a process where the bootloader and operating system create
cryptographic hashes of every boot binary and combine them with the previous values in NitroTPM
internal Platform Configuration Registers (PCRs). With measured boot, you can obtain signed PCR values
from NitroTPM and use them to prove to remote entities the integrity of the instance's boot software.
This is known as remote attestation.
1509
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Considerations
With NitroTPM, keys and secrets can be tagged with a specific PCR value so that they can never be
accessed if the value of the PCR, and thus the instance integrity, changes. This special form of conditional
access is referred to as sealing and unsealing. Operating system technologies, like BitLocker, can use
NitroTPM to seal a drive decryption key so that the drive can only be decrypted when the operating
system has booted correctly and is in a known good state.
To use NitroTPM, you must select an Amazon Machine Image (p. 21) (AMI) that has been configured for
NitroTPM support, and then use the AMI to launch a Nitro-based instance (p. 210). You can select one of
Amazon’s prebuilt AMIs or create one yourself.
Costs
There is no additional cost for using NitroTPM. You pay only for the underlying resources that you use.
Topics
• Considerations (p. 1510)
• Prerequisites for launching Windows instances (p. 1510)
• Verify whether an AMI is enabled for NitroTPM (p. 1511)
• Enable or stop using NitroTPM on an instance (p. 1512)
Considerations
The following considerations apply when using NitroTPM:
• BitLocker volumes that are encrypted with NitroTPM-based keys can only be used on the original
instance.
• The NitroTPM state is not included in Amazon EBS snapshots (p. 1569).
• The NitroTPM state is not included in VM Import/Export images.
• NitroTPM support is enabled by specifying a value of v2.0 for the tpm-support parameter when
creating an AMI. After you launch an instance with the AMI, you can't modify the attributes on the
instance. Instances with NitroTPM do not support the ModifyInstanceAttribute API.
• You can only create an AMI with NitroTPM configured by using the RegisterImage API by using the
AWS CLI and not with the Amazon EC2 console.
• NitroTPM is not supported on Outposts.
• NitroTPM is not supported in Local Zones or Wavelength Zones.
AMI
The following Windows AMIs are preconfigured to enable NitroTPM and UEFI Secure Boot with
Microsoft keys:
• TPM-Windows_Server-2022-English-Core-Base
• TPM-Windows_Server-2022-English-Full-Base
• TPM-Windows_Server-2022-English-Full-SQL_2022_Enterprise
1510
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Verify whether an AMI is enabled for NitroTPM
• TPM-Windows_Server-2022-English-Full-SQL_2022_Standard
• TPM-Windows_Server-2019-English-Core-Base
• TPM-Windows_Server-2019-English-Full-Base
• TPM-Windows_Server-2019-English-Full-SQL_2019_Enterprise
• TPM-Windows_Server-2019-English-Full-SQL_2019_Standard
• TPM-Windows_Server-2016-English-Core-Base
• TPM-Windows_Server-2016-English-Full-Base
Currently, we do not support importing Windows with NitroTPM by using the import-image
command.
Operating system
The AMI must include an operating system with a TPM 2.0 Command Response Buffer (CRB) driver.
Most current operating systems, such as TPM-Windows_Server-2022-English-Full-Base, contain a
TPM 2.0 CRB driver.
Instance type
Supported virtualized instance types: C5, C5a, C5ad, C5d, C5n, C6i, D3, D3en, G4dn, G5, Hpc6a,
I3en, I4i, Inf1, M5, M5a, M5ad, M5d, M5dn, M5n, M5zn, M6a, M6i, R5, R5a, R5ad, R5b, R5d, R5dn,
R5n, R6i, T3, T3a, U-3tb1, U-6tb1, U-9tb1, U-12tb1, X2idn, X2iedn, X2iezn, and z1d.
Not supported: Graviton (all generations), Xen, Mac, and bare metal instances
UEFI boot mode
NitroTPM requires that an instance runs in UEFI boot mode, which requires that the AMI must be
configured for UEFI boot mode. For more information, see UEFI Secure Boot (p. 31).
If NitroTPM is enabled for the AMI, "TpmSupport": "v2.0" appears in the output.
{
"Images": [
{
...
"BootMode": "uefi",
...
"TpmSupport": "v2.0"
}
]
}
1511
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Enable or stop using NitroTPM on an instance
Use the describe-image-attribute command and specify the attribute parameter with the
tpmSupport value.
Note
You must be the AMI owner to call describe-image-attribute.
If NitroTPM is enabled for the AMI, the value for TpmSupport is "v2.0". Note that describe-image-
attribute only returns the attributes that are specified in the request.
{
"ImageId": "ami-0123456789example",
"TpmSupport": {
"Value": "v2.0"
}
}
Topics
• Launch an instance with NitroTPM enabled (p. 1512)
• Stop using NitroTPM on an instance (p. 1512)
• Verify whether NitroTPM is accessible inside the instance (p. 1512)
For more information about disabling the device driver, see the documentation for your operating
system.
Use the describe-instances AWS CLI command and specify the instance ID. Currently, the Amazon EC2
console does not display the TpmSupport field.
1512
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Enable or stop using NitroTPM on an instance
If NitroTPM support is enabled on the instance, "TpmSupport": "v2.0" appears in the output.
"Instances": {
"InstanceId":"0123456789example",
"InstanceType":"c5.large",
...
"BootMode": "uefi",
"TpmSupport": "v2.0"
...
}
1513
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Storage
Amazon EC2 provides you with flexible, cost effective, and easy-to-use data storage options for your
instances. Each option has a unique combination of performance and durability. These storage options
can be used independently or in combination to suit your requirements.
After reading this section, you should have a good understanding about how you can use the data
storage options supported by Amazon EC2 to meet your specific requirements. These storage options
include the following:
The following figure shows the relationship between these storage options and your instance.
1514
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon EBS
Amazon EBS
Amazon EBS provides durable, block-level storage volumes that you can attach to a running instance.
You can use Amazon EBS as a primary storage device for data that requires frequent and granular
updates. For example, Amazon EBS is the recommended storage option when you run a database on an
instance.
An EBS volume behaves like a raw, unformatted, external block device that you can attach to a single
instance. The volume persists independently from the running life of an instance. After an EBS volume
is attached to an instance, you can use it like any other physical hard drive. As illustrated in the previous
figure, multiple volumes can be attached to an instance. You can also detach an EBS volume from one
instance and attach it to another instance. You can dynamically change the configuration of a volume
attached to an instance. EBS volumes can also be created as encrypted volumes using the Amazon EBS
encryption feature. For more information, see Amazon EBS encryption (p. 1732).
To keep a backup copy of your data, you can create a snapshot of an EBS volume, which is stored in
Amazon S3. You can create an EBS volume from a snapshot, and attach it to another instance. For more
information, see Amazon Elastic Block Store (p. 1515).
Many instances can access storage from disks that are physically attached to the host computer. This
disk storage is referred to as instance store. Instance store provides temporary block-level storage for
instances. The data on an instance store volume persists only during the life of the associated instance;
if you stop, hibernate, or terminate an instance, any data on instance store volumes is lost. For more
information, see Amazon EC2 instance store (p. 1805).
Amazon S3
Amazon S3 provides access to reliable and inexpensive data storage infrastructure. It is designed to
make web-scale computing easier by enabling you to store and retrieve any amount of data, at any time,
from within Amazon EC2 or anywhere on the web. For example, you can use Amazon S3 to store backup
copies of your data and applications. Amazon EC2 uses Amazon S3 to store EBS snapshots and instance
store-backed AMIs. For more information, see Use Amazon S3 with Amazon EC2 (p. 1823).
Adding storage
Every time you launch an instance from an AMI, a root storage device is created for that instance. The
root storage device contains all the information necessary to boot the instance. You can specify storage
volumes in addition to the root device volume when you create an AMI or launch an instance using block
device mapping. For more information, see Block device mappings (p. 1834).
You can also attach EBS volumes to a running instance. For more information, see Attach an Amazon EBS
volume to an instance (p. 1542).
Storage pricing
For information about storage pricing, open AWS Pricing, scroll down to Services Pricing, choose
Storage, and then choose the storage option to open that storage option's pricing page. For information
about estimating the cost of storage, see the AWS Pricing Calculator.
1515
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Features of Amazon EBS
volumes that persist independently from the life of the instance. You can create a file system on top
of these volumes, or use them in any way you would use a block device (such as a hard drive). You can
dynamically change the configuration of a volume attached to an instance.
We recommend Amazon EBS for data that must be quickly accessible and requires long-term persistence.
EBS volumes are particularly well-suited for use as the primary storage for file systems, databases, or for
any applications that require fine granular updates and access to raw, unformatted, block-level storage.
Amazon EBS is well suited to both database-style applications that rely on random reads and writes, and
to throughput-intensive applications that perform long, continuous reads and writes.
With Amazon EBS, you pay only for what you use. For more information about Amazon EBS pricing, see
the Projecting Costs section of the Amazon Elastic Block Store page.
Contents
• Features of Amazon EBS (p. 1516)
• Amazon EBS volumes (p. 1517)
• Amazon EBS snapshots (p. 1569)
• Amazon Data Lifecycle Manager (p. 1670)
• Amazon EBS data services (p. 1720)
• Amazon EBS and NVMe on Windows instances (p. 1750)
• Amazon EBS–optimized instances (p. 1752)
• Amazon EBS volume performance on Windows instances (p. 1774)
• Amazon CloudWatch metrics for Amazon EBS (p. 1788)
• EventBridge for Amazon EBS (p. 1794)
• Amazon EBS quotas (p. 1805)
The following is a summary of performance and use cases for each volume type.
• General Purpose SSD volumes (gp2 and gp3) balance price and performance for a wide variety of
transactional workloads. These volumes are ideal for use cases such as boot volumes, medium-size
single instance databases, and development and test environments.
• Provisioned IOPS SSD volumes (io1 and io2) are designed to meet the needs of I/O-intensive
workloads that are sensitive to storage performance and consistency. They provide a consistent
IOPS rate that you specify when you create the volume. This enables you to predictably scale to tens
of thousands of IOPS per instance. Additionally, io2 volumes provide the highest levels of volume
durability.
• Throughput Optimized HDD volumes (st1) provide low-cost magnetic storage that defines
performance in terms of throughput rather than IOPS. These volumes are ideal for large, sequential
workloads such as Amazon EMR, ETL, data warehouses, and log processing.
• Cold HDD volumes (sc1) provide low-cost magnetic storage that defines performance in terms of
throughput rather than IOPS. These volumes are ideal for large, sequential, cold-data workloads.
If you require infrequent access to your data and are looking to save costs, these volumes provides
inexpensive block storage.
1516
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• You can create your EBS volumes as encrypted volumes, in order to meet a wide range of data-at-rest
encryption requirements for regulated/audited data and applications. When you create an encrypted
EBS volume and attach it to a supported instance type, data stored at rest on the volume, disk I/O, and
snapshots created from the volume are all encrypted. The encryption occurs on the servers that host
EC2 instances, providing encryption of data-in-transit from EC2 instances to EBS storage. For more
information, see Amazon EBS encryption (p. 1732).
• You can create point-in-time snapshots of EBS volumes, which are persisted to Amazon S3. Snapshots
protect data for long-term durability, and they can be used as the starting point for new EBS volumes.
The same snapshot can be used to create as many volumes as needed. These snapshots can be copied
across AWS Regions. For more information, see Amazon EBS snapshots (p. 1569).
• Performance metrics, such as bandwidth, throughput, latency, and average queue length, are available
through the AWS Management Console. These metrics, provided by Amazon CloudWatch, allow you to
monitor the performance of your volumes to make sure that you are providing enough performance
for your applications without paying for resources you don't need. For more information, see Amazon
EBS volume performance on Windows instances (p. 1774).
You can use EBS volumes as primary storage for data that requires frequent updates, such as the system
drive for an instance or storage for a database application. You can also use them for throughput-
intensive applications that perform continuous disk scans. EBS volumes persist independently from the
running life of an EC2 instance.
You can attach multiple EBS volumes to a single instance. The volume and instance must be in the same
Availability Zone.
Amazon EBS provides the following volume types: General Purpose SSD (gp2 and gp3), Provisioned IOPS
SSD (io1 and io2), Throughput Optimized HDD (st1), Cold HDD (sc1), and Magnetic (standard). They
differ in performance characteristics and price, allowing you to tailor your storage performance and cost
to the needs of your applications. For more information, see Amazon EBS volume types (p. 1520).
Your account has a limit on the number of EBS volumes that you can use, and the total storage available
to you. For more information about these limits, and how to request an increase in your limits, see
Amazon EC2 service quotas (p. 1909).
Contents
• Benefits of using EBS volumes (p. 1518)
• Amazon EBS volume types (p. 1520)
• Constraints on the size and configuration of an EBS volume (p. 1536)
• Create an Amazon EBS volume (p. 1539)
• Attach an Amazon EBS volume to an instance (p. 1542)
• Make an Amazon EBS volume available for use on Windows (p. 1543)
• View information about an Amazon EBS volume (p. 1550)
• Replace a volume using a previous snapshot (p. 1552)
• Replace a root volume (p. 1553)
1517
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Topics
• Data availability (p. 1518)
• Data persistence (p. 1518)
• Data encryption (p. 1519)
• Data security (p. 1519)
• Snapshots (p. 1519)
• Flexibility (p. 1520)
Data availability
When you create an EBS volume, it is automatically replicated within its Availability Zone to prevent data
loss due to failure of any single hardware component. You can attach an EBS volume to any EC2 instance
in the same Availability Zone. After you attach a volume, it appears as a native block device similar to
a hard drive or other physical device. At that point, the instance can interact with the volume just as it
would with a local drive. You can connect to the instance and format the EBS volume with a file system,
such as NTFS, and then install applications.
If you attach multiple volumes to a device that you have named, you can stripe data across the volumes
for increased I/O and throughput performance.
You can get monitoring data for your EBS volumes, including root device volumes for EBS-backed
instances, at no additional charge. For more information about monitoring metrics, see Amazon
CloudWatch metrics for Amazon EBS (p. 1788). For information about tracking the status of your
volumes, see EventBridge for Amazon EBS (p. 1794).
Data persistence
An EBS volume is off-instance storage that can persist independently from the life of an instance. You
continue to pay for the volume usage as long as the data persists.
EBS volumes that are attached to a running instance can automatically detach from the instance with
their data intact when the instance is terminated if you uncheck the Delete on Termination check
box when you configure EBS volumes for your instance on the EC2 console. The volume can then be
reattached to a new instance, enabling quick recovery. If the check box for Delete on Termination
is checked, the volume(s) will delete upon termination of the EC2 instance. If you are using an EBS-
backed instance, you can stop and restart that instance without affecting the data stored in the attached
volume. The volume remains attached throughout the stop-start cycle. This enables you to process
and store the data on your volume indefinitely, only using the processing and storage resources when
required. The data persists on the volume until the volume is deleted explicitly. The physical block
storage used by deleted EBS volumes is overwritten with zeroes before it is allocated to a new volume.
If you are dealing with sensitive data, you should consider encrypting your data manually or storing
the data on a volume protected by Amazon EBS encryption. For more information, see Amazon EBS
encryption (p. 1732).
1518
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
By default, the root EBS volume that is created and attached to an instance at launch is deleted
when that instance is terminated. You can modify this behavior by changing the value of the flag
DeleteOnTermination to false when you launch the instance. This modified value causes the
volume to persist even after the instance is terminated, and enables you to attach the volume to another
instance.
By default, additional EBS volumes that are created and attached to an instance at launch are not
deleted when that instance is terminated. You can modify this behavior by changing the value of the flag
DeleteOnTermination to true when you launch the instance. This modified value causes the volumes
to be deleted when the instance is terminated.
Data encryption
For simplified data encryption, you can create encrypted EBS volumes with the Amazon EBS encryption
feature. All EBS volume types support encryption. You can use encrypted EBS volumes to meet a wide
range of data-at-rest encryption requirements for regulated/audited data and applications. Amazon EBS
encryption uses 256-bit Advanced Encryption Standard algorithms (AES-256) and an Amazon-managed
key infrastructure. The encryption occurs on the server that hosts the EC2 instance, providing encryption
of data-in-transit from the EC2 instance to Amazon EBS storage. For more information, see Amazon EBS
encryption (p. 1732).
Amazon EBS encryption uses AWS Key Management Service (AWS KMS) master keys when creating
encrypted volumes and any snapshots created from your encrypted volumes. The first time you create
an encrypted EBS volume in a region, a default master key is created for you automatically. This key
is used for Amazon EBS encryption unless you select a customer master key (CMK) that you created
separately using AWS KMS. Creating your own CMK gives you more flexibility, including the ability to
create, rotate, disable, define access controls, and audit the encryption keys used to protect your data.
For more information, see the AWS Key Management Service Developer Guide.
Data security
Amazon EBS volumes are presented to you as raw, unformatted block devices. These devices are logical
devices that are created on the EBS infrastructure and the Amazon EBS service ensures that the devices
are logically empty (that is, the raw blocks are zeroed or they contain cryptographically pseudorandom
data) prior to any use or re-use by a customer.
If you have procedures that require that all data be erased using a specific method, either after or before
use (or both), such as those detailed in DoD 5220.22-M (National Industrial Security Program Operating
Manual) or NIST 800-88 (Guidelines for Media Sanitization), you have the ability to do so on Amazon
EBS. That block-level activity will be reflected down to the underlying storage media within the Amazon
EBS service.
Snapshots
Amazon EBS provides the ability to create snapshots (backups) of any EBS volume and write a copy of
the data in the volume to Amazon S3, where it is stored redundantly in multiple Availability Zones. The
volume does not need to be attached to a running instance in order to take a snapshot. As you continue
to write data to a volume, you can periodically create a snapshot of the volume to use as a baseline for
new volumes. These snapshots can be used to create multiple new EBS volumes or move volumes across
Availability Zones. Snapshots of encrypted EBS volumes are automatically encrypted.
When you create a new volume from a snapshot, it's an exact copy of the original volume at the time
the snapshot was taken. EBS volumes that are created from encrypted snapshots are automatically
encrypted. By optionally specifying a different Availability Zone, you can use this functionality to create a
duplicate volume in that zone. The snapshots can be shared with specific AWS accounts or made public.
When you create snapshots, you incur charges in Amazon S3 based on the volume's total size. For a
successive snapshot of the volume, you are only charged for any additional data beyond the volume's
original size.
1519
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Snapshots are incremental backups, meaning that only the blocks on the volume that have changed
after your most recent snapshot are saved. If you have a volume with 100 GiB of data, but only 5 GiB of
data have changed since your last snapshot, only the 5 GiB of modified data is written to Amazon S3.
Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you
need to retain only the most recent snapshot.
To help categorize and manage your volumes and snapshots, you can tag them with metadata of your
choice. For more information, see Tag your Amazon EC2 resources (p. 1894).
To back up your volumes automatically, you can use Amazon Data Lifecycle Manager (p. 1670) or AWS
Backup.
Flexibility
EBS volumes support live configuration changes while in production. You can modify volume type,
volume size, and IOPS capacity without service interruptions. For more information, see Amazon EBS
Elastic Volumes (p. 1720).
Volume types
1520
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Boot Supported
volume
* The throughput limit is between 128 MiB/s and 250 MiB/s, depending on the volume size. For more
information, see gp2 volume performance (p. 1524). Volumes created before December 3, 2018
that have not been modified since creation might not reach full performance unless you modify the
volume (p. 1720).
† To achieve maximum throughput of 1,000 MiB/s, the volume must be provisioned with 64,000 IOPS
and it must be attached to an instance built on the Nitro System (p. 210). io1 volumes created before
December 6, 2017 and that have not been modified since creation, might not reach full performance
unless you modify the volume (p. 1720).
‡ io2 Block Express volumes are supported with C6a, C6in, C7g, Inf2, M6a, M6in, M6idn, M7g, R5b,
R6in, R6idn, R7g, Trn1, Trn1n, X2idn, and X2iedn instances. io2 volumes attached to these instances,
during or after launch, automatically run on Block Express. For more information, see io2 Block Express
volumes (p. 1528).
For more information about the SSD-backed volume types, see the following:
1521
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
For more information about the Hard disk drives (HDD) volumes, see Throughput Optimized HDD and
Cold HDD volumes (p. 1529).
Magnetic
1522
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Magnetic
• General Purpose SSD (gp3) volumes—latest generation General Purpose SSD volume
• General Purpose SSD (gp2) volumes
Topics
• General Purpose SSD (gp3) volumes (p. 1523)
• General Purpose SSD (gp2) volumes (p. 1524)
General Purpose SSD (gp3) volumes are the latest generation of General Purpose SSD volumes, and
the lowest cost SSD volume offered by Amazon EBS. This volume type helps to provide the right
balance of price and performance for most applications. It also helps you to scale volume performance
independently of volume size. This means that you can provision the required performance without
needing to provision additional block storage capacity. Additionally, gp3 volumes offer a 20 percent
lower price per GiB than General Purpose SSD (gp2) volumes.
gp3 volumes provide single-digit millisecond latency and 99.8 percent to 99.9 percent volume durability
with an annual failure rate (AFR) no higher than 0.2 percent, which translates to a maximum of two
volume failures per 1,000 running volumes over a one-year period. AWS designs gp3 volumes to deliver
their provisioned performance 99 percent of the time.
Topics
• gp3 volume performance (p. 1523)
• gp3 volume size (p. 1524)
• Migrate to gp3 from gp2 (p. 1524)
IOPS performance
1523
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
gp3 volumes deliver a consistent baseline IOPS performance of 3,000 IOPS, which is included with the
price of storage. You can provision additional IOPS (up to a maximum of 16,000) for an additional cost
at a ratio of 500 IOPS per GiB of volume size. Maximum IOPS can be provisioned for volumes 32 GiB or
larger (500 IOPS per GiB × 32 GiB = 16,000 IOPS).
Throughput performance
gp3 volumes deliver a consistent baseline throughput performance of 125 MiB/s, which is included with
the price of storage. You can provision additional throughput (up to a maximum of 1,000 MiB/s) for an
additional cost at a ratio of 0.25 MiB/s per provisioned IOPS. Maximum throughput can be provisioned at
4,000 IOPS or higher and 8 GiB or larger (4,000 IOPS × 0.25 MiB/s per IOPS = 1,000 MiB/s).
To find out how much you can save by migrating your gp2 volumes to gp3, use the Amazon EBS gp2 to
gp3 migration cost savings calculator.
General Purpose SSD (gp2) volumes are the default Amazon EBS volume type for Amazon EC2 instances.
They offer cost-effective storage that is ideal for a broad range of transactional workloads. With gp2
volumes, performance scales with volume size.
Tip
gp3 volumes are the latest generation of General Purpose SSD volumes. They offer more
predictable performance scaling and prices that are up to 20 percent lower than gp2 volumes.
For more information, see General Purpose SSD (gp3) volumes (p. 1523).
To find out how much you can save by migrating your gp2 volumes to gp3, use the Amazon EBS
gp2 to gp3 migration cost savings calculator.
gp2 volumes provide single-digit millisecond latency and 99.8 percent to 99.9 percent volume durability
with an annual failure rate (AFR) no higher than 0.2 percent, which translates to a maximum of two
volume failures per 1,000 running volumes over a one-year period. AWS designs gp2 volumes to deliver
their provisioned performance 99 percent of the time.
Topics
• gp2 volume performance (p. 1524)
• gp2 volume size (p. 1526)
Baseline IOPS performance scales linearly between a minimum of 100 and a maximum of 16,000 at a
rate of 3 IOPS per GiB of volume size. IOPS performance is provisioned as follows:
• Volumes 33.33 GiB and smaller are provisioned with the minimum of 100 IOPS.
• Volumes larger than 33.33 GiB are provisioned with 3 IOPS per GiB of volume size up to the maximum
of 16,000 IOPS, which is reached at 5,334 GiB (3 X 5,334).
1524
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• Volumes 5,334 GiB and larger are provisioned with 16,000 IOPS.
gp2 volumes smaller than 1 TiB (and that are provisioned with less than 3,000 IOPS) can burst to 3,000
IOPS when needed for an extended period of time. A volume's ability to burst is governed by I/O credits.
When I/O demand is greater than baseline performance, the volume spends I/O credits to burst to the
required performance level (up to 3,000 IOPS). While bursting, I/O credits are not accumulated and they
are spent at the rate of IOPS that is being used above baseline IOPS (spend rate = burst IOPS - baseline
IOPS). The more I/O credits a volume has accrued, the longer it can sustain its burst performance. You
can calculate Burst duration as follows:
When I/O demand drops to baseline performance level or lower, the volume starts to earn I/O credits
at a rate of 3 I/O credits per GiB of volume size per second. Volumes have an I/O credit accrual limit of
5.4 million I/O credits, which is enough to sustain the maximum burst performance of 3,000 IOPS for at
least 30 minutes.
Note
Each volume receives an initial I/O credit balance of 5.4 million I/O credits, which provides a fast
initial boot cycle for boot volumes and a good bootstrapping experience for other applications.
The following table lists example volume sizes and the associated baseline performance of the volume,
the burst duration (when starting with 5.4 million I/O credits), and the time needed to refill an empty I/
O credits balance.
Volume size (GiB) Baseline performance Burst duration at 3,000 Time to refill empty
(IOPS) IOPS (seconds) credit balance
(seconds)
* The baseline performance of the volume exceeds the maximum burst performance.
You can monitor the I/O credit balance for a volume using the Amazon EBS BurstBalance metric
in Amazon CloudWatch. This metric shows the percentage of I/O credits for gp2 remaining. For more
information, see I/O characteristics and monitoring (p. 1776). You can set an alarm that notifies you
when the BurstBalance value falls to a certain level. For more information, see Creating CloudWatch
Alarms.
Throughput performance
gp2 volumes deliver throughput between 128 MiB/s and 250 MiB/s, depending on the volume size.
Throughput performance is provisioned as follows:
1525
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• Volumes that are 170 GiB and smaller deliver a maximum throughput of 128 MiB/s.
• Volumes larger than 170 GiB but smaller than 334 GiB can burst to a maximum throughput of 250
MiB/s.
• Volumes that are 334 GiB and larger deliver 250 MiB/s.
Throughput for a gp2 volume can be calculated using the following formula, up to the throughput limit
of 250 MiB/s:
Topics
• Provisioned IOPS SSD (io1 and io2) volumes (p. 1526)
• io2 Block Express volumes (p. 1528)
io1 volumes are designed to provide 99.8 percent to 99.9 percent volume durability with an annual
failure rate (AFR) no higher than 0.2 percent, which translates to a maximum of two volume failures per
1,000 running volumes over a one-year period. io2 volumes are designed to provide 99.999 percent
volume durability with an AFR no higher than 0.001 percent, which translates to a single volume failure
per 100,000 running volumes over a one-year period.
Provisioned IOPS SSD io1 and io2 volumes are available for all Amazon EC2 instance types. Provisioned
IOPS SSD io2 volumes attached to C6a, C6in, C7g, Inf2, M6a, M6in, M6idn, M7g, R5b, R6in, R6idn, R7g,
Trn1, Trn1n, X2idn, and X2iedn instances run on EBS Block Express. For more information, see io2 Block
Express volumes (p. 1528).
• io2 volumes are currently available in the following Regions: US East (Ohio), US East (N. Virginia), US
West (N. California), US West (Oregon), Asia Pacific (Hong Kong), Asia Pacific (Mumbai), Asia Pacific
(Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe
(Frankfurt), Europe (Ireland), Europe (London), Europe (Stockholm), and Middle East (Bahrain).
1526
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• Keep the following in mind when launching instances with io2 volumes:
• If you launch an instance with an io2 volume using an instance type that supports Block Express,
the volume automatically runs on Block Express, regardless of the volume's size and IOPS.
• You can't launch an instance type that does not support Block Express (p. 1528) with an io2 volume
that has a size greater than 16 TiB or IOPS greater than 64,000.
• You can't launch an instance with an encrypted io2 volume that has a size greater than 16 TiB or
IOPS greater than 64,000 from an unencrypted AMI or a shared encrypted AMI with Block Express.
In this case, you must first create an encrypted AMI in your account and then use that AMI to launch
the instance.
• Keep the following in mind when creating io2 volumes:
• If you create an io2 volume with a size greater than 16 TiB or IOPS greater than 64,000 in a Region
where Block Express (p. 1528) is supported, the volume automatically runs on Block Express.
• You can't create an io2 volume with a size greater than 16 TiB or IOPS greater than 64,000 in a
Region where Block Express (p. 1528) is not supported.
• If you create an io2 volume with a size of 16 TiB or less and IOPS of 64,000 or less in a Region
where Block Express (p. 1528) is supported, the volume does not run on Block Express.
• You can't create an encrypted io2 volume that has a size greater than 16 TiB or IOPS greater than
64,000 from an unencrypted snapshot or a shared encrypted snapshot. In this case, you must first
create an encrypted snapshot in your account and then use that snapshot to create the volume.
• Keep the following in mind when attaching io2 volumes to instances:
• If you attach an io2 volume to an instance that supports Block Express, the volume automatically
runs on Block Express. It can take up to 48 hours to optimize the volume for Block Express. During
this time, the volume provides io2 latency. After the volume has been optimized, it provides the
sub-millisecond latency supported by Block Express.
• You can't attach an io2 volume with a size greater than 16 TiB or IOPS greater than 64,000 to an
instance type that does not support Block Express (p. 1528).
• If you detach an io2 volume with a size of 16 TiB or less and IOPS of 64,000 or less from an
instance that supports Block Express and attach it to an instance type that does not support Block
Express (p. 1528), the volume no longer runs on Block Express and it provides io2 latency.
• Keep the following in mind when modifying io2 volumes:
• You can't modify an io2 volume and increase its size beyond 16 TiB or its IOPS beyond 64,000 while
it is attached to an instance type that does not support Block Express (p. 1528).
Performance
Provisioned IOPS SSD volumes can range in size from 4 GiB to 16 TiB and you can provision from 100
IOPS up to 64,000 IOPS per volume. You can achieve up to 64,000 IOPS only on Instances built on the
Nitro System (p. 210). On other instance families you can achieve performance up to 32,000 IOPS. The
maximum ratio of provisioned IOPS to requested volume size (in GiB) is 50:1 for io1 volumes, and 500:1
for io2 volumes. For example, a 100 GiB io1 volume can be provisioned with up to 5,000 IOPS, while
a 100 GiB io2 volume can be provisioned with up to 50,000 IOPS. On a supported instance type, the
following volume sizes allow provisioning up to the 64,000 IOPS maximum:
• io1 volume 1,280 GiB in size or greater (50 × 1,280 GiB = 64,000 IOPS)
• io2 volume 128 GiB in size or greater (500 × 128 GiB = 64,000 IOPS)
Provisioned IOPS SSD volumes provisioned with up to 32,000 IOPS support a maximum I/O size of 256
KiB and yield as much as 500 MiB/s of throughput. With the I/O size at the maximum, peak throughput
is reached at 2,000 IOPS. Volumes provisioned with more than 32,000 IOPS (up to the maximum
of 64,000 IOPS) yield a linear increase in throughput at a rate of 16 KiB per provisioned IOPS. For
example, a volume provisioned with 48,000 IOPS can support up to 750 MiB/s of throughput (16 KiB
per provisioned IOPS × 48,000 provisioned IOPS = 750 MiB/s). To achieve the maximum throughput of
1527
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
1,000 MiB/s, a volume must be provisioned with 64,000 IOPS (16 KiB per provisioned IOPS × 64,000
provisioned IOPS = 1,000 MiB/s). The following graph illustrates these performance characteristics:
Your per-I/O latency experience depends on the provisioned IOPS and on your workload profile. For the
best I/O latency experience, ensure that you provision IOPS to meet the I/O profile of your workload.
io2 Block Express volumes is the next generation of Amazon EBS storage server architecture. It has been
built for the purpose of meeting the performance requirements of the most demanding I/O intensive
applications that run on Nitro-based Amazon EC2 instances.
Block Express architecture increases performance and scale. Block Express servers communicate with
Nitro-based instances using the Scalable Reliable Datagram (SRD) networking protocol. This interface
is implemented in the Nitro Card dedicated for Amazon EBS I/O function on the host hardware of the
instance. It minimizes I/O delay and latency variation (network jitter), which provides faster and more
consistent performance for your applications. For more information, see io2 Block Express volumes.
io2 Block Express volumes are suited for workloads that benefit from a single volume that provides sub-
millisecond latency, and supports higher IOPS, higher throughput, and larger capacity than io2 volumes.
io2 Block Express volumes support the same features as io2 volumes, including Multi-Attach and
encryption.
Topics
• Considerations (p. 1528)
• Performance (p. 1529)
• Quotas (p. 1529)
• Pricing and billing (p. 1529)
Considerations
• io2 Block Express volumes are currently supported with C6a, C6in, C7g, Inf2, M6a, M6in, M6idn, M7g,
R5b, R6in, R6idn, R7g, Trn1, Trn1n, X2idn, and X2iedn instances.
• io2 Block Express volumes are currently available in all Regions where supported instances are
available, including US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Mumbai), Asia
Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central),
Europe (Frankfurt), Europe (Ireland), Europe (London), and Europe (Stockholm). Instance availability
might vary by Availability Zone. For more information, see Find an Amazon EC2 instance type.
1528
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Performance
With io2 Block Express volumes, you can provision volumes with:
Quotas
io2 Block Express volumes adhere to the same service quotas as io2 volumes. For more information, see
Amazon EBS quotas.
io2 volumes and io2 Block Express volumes are billed at the same rate. For more information, see
Amazon EBS pricing.
Usage reports do not distinguish between io2 Block Express volumes and io2 volumes. We recommend
that you use tags to help you identify costs associated with io2 Block Express volumes.
• Throughput Optimized HDD — A low-cost HDD designed for frequently accessed, throughput-
intensive workloads.
• Cold HDD — The lowest-cost HDD design for less frequently accessed workloads.
Topics
• Limitations on per-instance throughput (p. 1530)
• Throughput Optimized HDD volumes (p. 1530)
• Cold HDD volumes (p. 1532)
• Performance considerations when using HDD volumes (p. 1534)
1529
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Throughput for st1 and sc1 volumes is always determined by the smaller of the following:
As for all Amazon EBS volumes, we recommend that you select an appropriate EBS-optimized
EC2 instance to avoid network bottlenecks. For more information, see Amazon EBS–optimized
instances (p. 1752).
Throughput Optimized HDD (st1) volumes provide low-cost magnetic storage that defines performance
in terms of throughput rather than IOPS. This volume type is a good fit for large, sequential workloads
such as Amazon EMR, ETL, data warehouses, and log processing. Bootable st1 volumes are not
supported.
Throughput Optimized HDD (st1) volumes, though similar to Cold HDD (sc1) volumes, are designed to
support frequently accessed data.
This volume type is optimized for workloads involving large, sequential I/O, and we recommend that
customers with workloads performing small, random I/O use gp2. For more information, see Inefficiency
of small read/writes on HDD (p. 1536).
Throughput Optimized HDD (st1) volumes attached to EBS-optimized instances are designed to offer
consistent performance, delivering at least 90 percent of the expected throughput performance 99
percent of the time in a given year.
Like gp2, st1 uses a burst bucket model for performance. Volume size determines the baseline
throughput of your volume, which is the rate at which the volume accumulates throughput credits.
Volume size also determines the burst throughput of your volume, which is the rate at which you can
spend credits when they are available. Larger volumes have higher baseline and burst throughput. The
more credits your volume has, the longer it can drive I/O at the burst level.
The following diagram shows the burst bucket behavior for st1.
1530
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Subject to throughput and throughput-credit caps, the available throughput of an st1 volume is
expressed by the following formula:
For a 1-TiB st1 volume, burst throughput is limited to 250 MiB/s, the bucket fills with credits at 40 MiB/
s, and it can hold up to 1 TiB-worth of credits.
Larger volumes scale these limits linearly, with throughput capped at a maximum of 500 MiB/s. After the
bucket is depleted, throughput is limited to the baseline rate of 40 MiB/s per TiB.
On volume sizes ranging from 0.125 TiB to 16 TiB, baseline throughput varies from 5 MiB/s to a cap of
500 MiB/s, which is reached at 12.5 TiB as follows:
40 MiB/s
12.5 TiB × ---------- = 500 MiB/s
1 TiB
Burst throughput varies from 31 MiB/s to a cap of 500 MiB/s, which is reached at 2 TiB as follows:
250 MiB/s
2 TiB × ---------- = 500 MiB/s
1 TiB
The following table states the full range of base and burst throughput values for st1.
Volume size (TiB) ST1 base throughput (MiB/s) ST1 burst throughput (MiB/s)
0.125 5 31
0.5 20 125
1 40 250
2 80 500
3 120 500
4 160 500
5 200 500
6 240 500
7 280 500
8 320 500
9 360 500
10 400 500
11 440 500
12 480 500
13 500 500
1531
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Volume size (TiB) ST1 base throughput (MiB/s) ST1 burst throughput (MiB/s)
14 500 500
15 500 500
16 500 500
Note
When you create a snapshot of a Throughput Optimized HDD (st1) volume, performance may
drop as far as the volume's baseline value while the snapshot is in progress.
For information about using CloudWatch metrics and alarms to monitor your burst bucket balance, see
Monitor the burst bucket balance for volumes (p. 1536).
Cold HDD (sc1) volumes provide low-cost magnetic storage that defines performance in terms of
throughput rather than IOPS. With a lower throughput limit than st1, sc1 is a good fit for large,
sequential cold-data workloads. If you require infrequent access to your data and are looking to save
costs, sc1 provides inexpensive block storage. Bootable sc1 volumes are not supported.
Cold HDD (sc1) volumes, though similar to Throughput Optimized HDD (st1) volumes, are designed to
support infrequently accessed data.
Note
This volume type is optimized for workloads involving large, sequential I/O, and we recommend
that customers with workloads performing small, random I/O use gp2. For more information,
see Inefficiency of small read/writes on HDD (p. 1536).
Cold HDD (sc1) volumes attached to EBS-optimized instances are designed to offer consistent
performance, delivering at least 90 percent of the expected throughput performance 99 percent of the
time in a given year.
Like gp2, sc1 uses a burst bucket model for performance. Volume size determines the baseline
throughput of your volume, which is the rate at which the volume accumulates throughput credits.
Volume size also determines the burst throughput of your volume, which is the rate at which you can
spend credits when they are available. Larger volumes have higher baseline and burst throughput. The
more credits your volume has, the longer it can drive I/O at the burst level.
1532
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Subject to throughput and throughput-credit caps, the available throughput of an sc1 volume is
expressed by the following formula:
For a 1-TiB sc1 volume, burst throughput is limited to 80 MiB/s, the bucket fills with credits at 12 MiB/s,
and it can hold up to 1 TiB-worth of credits.
Larger volumes scale these limits linearly, with throughput capped at a maximum of 250 MiB/s. After the
bucket is depleted, throughput is limited to the baseline rate of 12 MiB/s per TiB.
On volume sizes ranging from 0.125 TiB to 16 TiB, baseline throughput varies from 1.5 MiB/s to a
maximum of 192 MiB/s, which is reached at 16 TiB as follows:
12 MiB/s
16 TiB × ---------- = 192 MiB/s
1 TiB
Burst throughput varies from 10 MiB/s to a cap of 250 MiB/s, which is reached at 3.125 TiB as follows:
80 MiB/s
3.125 TiB × ----------- = 250 MiB/s
1 TiB
The following table states the full range of base and burst throughput values for sc1:
Volume Size (TiB) SC1 Base Throughput (MiB/s) SC1 Burst Throughput (MiB/s)
0.125 1.5 10
0.5 6 40
1 12 80
2 24 160
3 36 240
1533
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Volume Size (TiB) SC1 Base Throughput (MiB/s) SC1 Burst Throughput (MiB/s)
4 48 250
5 60 250
6 72 250
7 84 250
8 96 250
9 108 250
10 120 250
11 132 250
12 144 250
13 156 250
14 168 250
15 180 250
16 192 250
Note
When you create a snapshot of a Cold HDD (sc1) volume, performance may drop as far as the
volume's baseline value while the snapshot is in progress.
For information about using CloudWatch metrics and alarms to monitor your burst bucket balance, see
Monitor the burst bucket balance for volumes (p. 1536).
1534
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
complete because of per-instance and per-volume throughput limits. Volumes attached to smaller
instances are limited to the per-instance throughput rather than the st1 or sc1 throughput limits.
Both st1 and sc1 are designed for performance consistency of 90 percent of burst throughput 99
percent of the time. Non-compliant periods are approximately uniformly distributed, targeting 99
percent of expected total throughput each hour.
Volume size
------------ = Scan time
Throughput
For example, taking the performance consistency guarantees and other optimizations into account, an
st1 customer with a 5-TiB volume can expect to complete a full volume scan in 2.91 to 3.27 hours.
5 TiB 5 TiB
----------- = ------------------ = 10,486 seconds = 2.91 hours
500 MiB/s 0.00047684 TiB/s
2.91 hours
-------------- = 3.27 hours
(0.90)(0.99) <-- From expected performance of 90% of burst 99% of the time
Similarly, an sc1 customer with a 5-TiB volume can expect to complete a full volume scan in 5.83 to 6.54
hours.
5 TiB 5 TiB
----------- = ------------------- = 20972 seconds = 5.83 hours
250 MiB/s 0.000238418 TiB/s
5.83 hours
-------------- = 6.54 hours
(0.90)(0.99)
The following table shows ideal scan times for volumes of various size, assuming full buckets and
sufficient instance throughput.
Volume size (TiB) ST1 scan time with burst SC1 scan time with burst
(hours)* (hours)*
1 1.17 3.64
2 1.17 3.64
3 1.75 3.64
1535
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Volume size (TiB) ST1 scan time with burst SC1 scan time with burst
(hours)* (hours)*
4 2.33 4.66
5 2.91 5.83
6 3.50 6.99
7 4.08 8.16
8 4.66 9.32
9 5.24 10.49
10 5.83 11.65
11 6.41 12.82
12 6.99 13.98
13 7.57 15.15
14 8.16 16.31
15 8.74 17.48
16 9.32 18.64
* These scan times assume an average queue depth (rounded to the nearest whole number) of four or
more when performing 1 MiB of sequential I/O.
Therefore if you have a throughput-oriented workload that needs to complete scans quickly (up to 500
MiB/s), or requires several full volume scans a day, use st1. If you are optimizing for cost, your data is
relatively infrequently accessed, and you don’t need more than 250 MiB/s of scanning performance, then
use sc1.
For example, an I/O request of 1 MiB or less counts as a 1 MiB I/O credit. However, if the I/Os are
sequential, they are merged into 1 MiB I/O blocks and count only as a 1 MiB I/O credit.
1536
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
The following sections describe the most important factors that limit the usable size of an EBS volume
and offer recommendations for configuring your EBS volumes.
Contents
• Storage capacity (p. 1537)
• Service limitations (p. 1537)
• Partitioning schemes (p. 1538)
• Data block sizes (p. 1538)
Storage capacity
The following table summarizes the theoretical and implemented storage capacities for the most
commonly used file systems on Amazon EBS, assuming a 4,096 byte block size.
** https://access.redhat.com/solutions/1532
† io2 Block Express volumes support up to 64 TiB for GPT partitions. For more information, see io2
Block Express volumes (p. 1528).
Service limitations
Amazon EBS abstracts the massively distributed storage of a data center into virtual hard disk drives. To
an operating system installed on an EC2 instance, an attached EBS volume appears to be a physical hard
disk drive containing 512-byte disk sectors. The OS manages the allocation of data blocks (or clusters)
onto those virtual sectors through its storage management utilities. The allocation is in conformity with
a volume partitioning scheme, such as master boot record (MBR) or GUID partition table (GPT), and
within the capabilities of the installed file system (ext4, NTFS, and so on).
EBS is not aware of the data contained in its virtual disk sectors; it only ensures the integrity of the
sectors. This means that AWS actions and OS actions are independent of each other. When you are
selecting a volume size, be aware of the capabilities and limits of both, as in the following cases:
• EBS currently supports a maximum volume size of 64 TiB. This means that you can create an EBS
volume as large as 64 TiB, but whether the OS recognizes all of that capacity depends on its own
design characteristics and on how the volume is partitioned.
• Windows boot volumes may use either the MBR or GPT partitioning scheme. The AMI you launch an
instance from determines the boot mode parameter and subsequently which partition scheme can be
used for the boot volume. MBR supports boot volumes up to 2047 GiB (2 TiB - 1 GiB). If your Windows
1537
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
AMI uses MBR, your boot volume is limited to 2047 GiB, but your non-boot volumes do not have this
limit. For more information, see Make an Amazon EBS volume available for use on Windows (p. 1543)
and Set the boot mode of an AMI.
• Windows non-boot volumes that are 2 TiB (2048 GiB) or larger must use a GPT partition table to
access the entire volume. If an EBS volume over 2 TiB in size is attached to a Windows instance at
launch, it is automatically formatted with a GPT partition table. If you attach an EBS volume over 2 TiB
in size to a Windows instance after launch, you must initialize it with a GPT table manually. For more
information, see Make an Amazon EBS volume available for use on Windows (p. 1543).
Partitioning schemes
Among other impacts, the partitioning scheme determines how many logical data blocks can be uniquely
addressed in a single volume. For more information, see Data block sizes (p. 1538). The common
partitioning schemes in use are Master Boot Record (MBR) and GUID partition table (GPT). The important
differences between these schemes can be summarized as follows.
MBR
MBR uses a 32-bit data structure to store block addresses. This means that each data block is mapped
32
with one of 2 possible integers. The maximum addressable size of a volume is given by the following
formula:
32
2 × Block size
The block size for MBR volumes is conventionally limited to 512 bytes. Therefore:
32
2 × 512 bytes = 2 TiB
Engineering workarounds to increase this 2-TiB limit for MBR volumes have not met with widespread
industry adoption. Consequently, Linux and Windows never detect an MBR volume as being larger than 2
TiB even if AWS shows its size to be larger.
GPT
GPT uses a 64-bit data structure to store block addresses. This means that each data block is mapped
64
with one of 2 possible integers. The maximum addressable size of a volume is given by the following
formula:
64
2 × Block size
The block size for GPT volumes is commonly 4,096 bytes. Therefore:
64
2 × 4,096 bytes
64 12
= 2 × 2 bytes
70 6
= 2 × 2 bytes
= 64 ZiB
Real-world computer systems don't support anything close to this theoretical maximum. Implemented
file-system size is currently limited to 50 TiB for ext4 and 256 TiB for NTFS.
1538
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
the underlying hardware. The OS relies on the storage device to map the blocks to its physical sectors.
EBS advertises 512-byte sectors to the operating system, which reads and writes data to disk using data
blocks that are a multiple of the sector size.
The industry default size for logical data blocks is currently 4,096 bytes (4 KiB). Because certain
workloads benefit from a smaller or larger block size, file systems support non-default block sizes
that can be specified during formatting. Scenarios in which non-default block sizes should be used are
outside the scope of this topic, but the choice of block size has consequences for the storage capacity of
the volume. The following table shows storage capacity as a function of block size:
8 KiB 32 TiB
16 KiB 64 TiB
The EBS-imposed limit on volume size (64 TiB) is currently equal to the maximum size enabled by 16-KiB
data blocks.
If you are creating a volume for a high-performance storage scenario, you should make sure to use
a Provisioned IOPS SSD volume (io1 or io2) and attach it to an instance with enough bandwidth to
support your application, such as an EBS-optimized instance. The same advice holds for Throughput
Optimized HDD (st1) and Cold HDD (sc1) volumes. For more information, see Amazon EBS–optimized
instances (p. 1752).
Note
If you create a volume for use with a Windows instance, and it's larger than 2048 GiB (or is a
volume that's smaller than 2048 GiB but might be increased later), ensure that you configure
the volume to use GPT partition tables. For more information, see Windows support for hard
disks that are larger than 2 TB..
Empty EBS volumes receive their maximum performance the moment that they are available and do not
require initialization (formerly known as pre-warming). However, storage blocks on volumes that were
created from snapshots must be initialized (pulled down from Amazon S3 and written to the volume)
before you can access the block. This preliminary action takes time and can cause a significant increase
in the latency of an I/O operation the first time each block is accessed. Volume performance is achieved
after all blocks have been downloaded and written to the volume. For most applications, amortizing this
cost over the lifetime of the volume is acceptable. To avoid this initial performance hit in a production
environment, you can force immediate initialization of the entire volume or enable fast snapshot restore.
For more information, see Initialize Amazon EBS volumes (p. 1779).
Important
If you create an io2 volume with a size greater than 16 TiB or with IOPS greater than 64,000 in
a Region where EBS Block Express is supported, the volume automatically runs on Block Express.
io2 Block Express volumes can be attached to supported instances only. For more information,
see io2 Block Express volumes.
1539
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• Create and attach EBS volumes when you launch instances by specifying a block device mapping. For
more information, see Launch an instance using the new launch instance wizard (p. 539) and Block
device mappings (p. 1834).
• Create an empty EBS volume and attach it to a running instance. For more information, see Create an
empty volume (p. 1540) below.
• Create an EBS volume from a previously created snapshot and attach it to a running instance. For more
information, see Create a volume from a snapshot (p. 1541) below.
You can create an empty EBS volume using one of the following methods.
Console
If your account is enabled for encryption by default (p. 1735), then encryption is automatically
enabled and you can't disable it. You can choose the KMS key to use to encrypt the volume.
If your account is not enabled for encryption by default, encryption is optional. To encrypt the
volume, for Encryption, choose Encrypt this volume and then select the KMS key to use to
encrypt the volume.
Note
Encrypted volumes can be attached only to instances that support Amazon EBS
encryption. For more information, see Amazon EBS encryption (p. 1732).
11. (Optional) To assign custom tags to the volume, in the Tags section, choose Add tag,
and then enter a tag key and value pair. For more information, see Tag your Amazon EC2
resources (p. 1894).
12. Choose Create volume.
Note
The volume is ready for use when the Volume state is available.
13. To use the volume, attach it to an instance. For more information, see Attach an Amazon EBS
volume to an instance (p. 1542).
1540
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
New EBS volumes that are created from encrypted snapshots are automatically encrypted. You can also
encrypt a volume on-the-fly while restoring it from an unencrypted snapshot. Encrypted volumes can
only be attached to instance types that support EBS encryption. For more information, see Supported
instance types (p. 1734).
You can create a volume from a snapshot using one of the following methods.
Console
If the selected snapshot is unencrypted and your account is not enabled for encryption by
default, encryption is optional. To encrypt the volume, for Encryption, choose Encrypt this
volume and then select the KMS key to use to encrypt the volume.
1541
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Note
Encrypted volumes can be attached only to instances that support Amazon EBS
encryption. For more information, see Amazon EBS encryption (p. 1732).
11. (Optional) To assign custom tags to the volume, in the Tags section, choose Add tag,
and then enter a tag key and value pair. For more information, see Tag your Amazon EC2
resources (p. 1894).
12. Choose Create Volume.
Note
The volume is ready for use when the Volume state is available.
13. To use the volume, attach it to an instance. For more information, see Attach an Amazon EBS
volume to an instance (p. 1542).
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
For information about adding EBS volumes to your instance at launch, see Instance block device
mapping (p. 1840).
Prerequisites
• Determine how many volumes that you can attach to your instance. For more information, see
Instance volume limits (p. 1828).
• If a volume is encrypted, you can attach it only to an instance that supports Amazon EBS encryption.
For more information, see Supported instance types (p. 1734).
• If a volume has an AWS Marketplace product code:
• You can attach a volume only to a stopped instance.
• You must be subscribed to the AWS Marketplace code that is on the volume.
• The instance's configuration, such as its type and operating system, must support that specific AWS
Marketplace code. For example, you cannot take a volume from a Windows instance and attach it to
a Linux instance.
• AWS Marketplace product codes are copied from the volume to the instance.
Important
If you attach an io2 volume to an instance that supports Block Express, the volume always runs
on Block Express. For more information, see io2 Block Express volumes.
You can attach a volume to an instance using one of the following methods.
1542
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Console
AWS CLI
Note
In some situations, you may find that a volume other than the volume attached to /dev/xvda
or /dev/sda has become the root volume of your instance. This can happen when you have
attached the root volume of another instance, or a volume created from the snapshot of a root
volume, to an instance with an existing root volume. For more information, see Boot from the
wrong volume.
On Nitro instances, the Amazon EBS volume is exposed as a block device when the NVM Express (NVMe)
controller scans the PCI bus. The disk does not appear as removable. Unlike Xen-based instances, there is
only one NVMe controller per EBS volume on Nitro instances.
You can take snapshots of your EBS volume for backup purposes or to use as a baseline when you create
another volume. For more information, see Amazon EBS snapshots (p. 1569).
1543
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
If the EBS volume you are preparing for use is greater than 2 TiB, you must use a GPT partitioning
scheme to access the entire volume. For more information, see Constraints on the size and configuration
of an EBS volume (p. 1536).
You can get directions for volumes on a Linux instance from Make a volume available for use on Linux in
the Amazon EC2 User Guide for Linux Instances.
PowerShell
To make all EBS volumes with raw partitions available to use with Windows PowerShell
1. Log in to your Windows instance using Remote Desktop. For more information, see Connect to
your Windows instance (p. 610).
2. On the taskbar, open the Start menu, and choose Windows PowerShell.
3. Use the provided series of Windows PowerShell commands within the opened PowerShell
prompt. The script performs the following actions by default:
To make an EBS volume available to use with the DiskPart command line tool
1. Log in to your Windows instance using Remote Desktop. For more information, see Connect to
your Windows instance (p. 610).
2. Determine the disk number that you want to make available:
1544
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Warning
If you're mounting a volume that already has data on it, do not reformat the volume or
you will delete the existing data.
select disk 1
attributes disk clear readonly
online disk noerr
convert mbr
create partition primary
format quick fs=ntfs label="volume_label"
assign letter="drive_letter"
To make an EBS volume available to use with the Disk Management utility
1. Log in to your Windows instance using Remote Desktop. For more information, see Connect to
your Windows instance (p. 610).
2. Start the Disk Management utility. On the taskbar, open the context (right-click) menu for the
Windows logo, and choose Disk Management.
Note
In Windows Server 2008, choose Start, Administrative Tools, Computer Management,
Disk Management.
3. Bring the volume online. In the lower pane, open the context (right-click) menu for the left
panel for the disk for the EBS volume. Choose Online.
1545
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
4. (Conditional) If the disk is not initialized, you must initialize it before you can use it. If the disk is
already initialized, skip this step.
Warning
If you're mounting a volume that already has data on it (for example, a public data set,
or a volume that you created from a snapshot), do not reformat the volume or you will
delete the existing data.
1. Open the context (right-click) menu for the left panel for the disk, and choose Initialize Disk.
2. In the Initialize Disk dialog box, select a partition style, and choose OK.
1546
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
5. Open the context (right-click) menu for the right panel for the disk, and choose New Simple
Volume.
1547
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
7. If you want to change the default maximum value, specify the Simple volume size in MB, and
then choose Next.
8. Specify a preferred drive letter, if necessary, within the Assign the following drive letter
dropdown, and then choose Next.
1548
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
9. Specify a Volume Label and adjust the default settings as necessary, and then choose Next.
10. Review your settings, and then choose Finish to apply the modifications and close the New
Simple Volume wizard.
1549
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
You can get additional information about your EBS volumes, such as how much disk space is available,
from the operating system on the instance.
Console
To view the EBS volumes that are attached to an instance using the console
1550
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
AWS CLI
You can use one of the following commands to view volume attributes. For more information, see
Access Amazon EC2 (p. 3).
You can use Amazon EC2 Global View to view your volumes across all Regions for which your AWS
account is enabled. For more information, see List and filter resources across Regions using Amazon
EC2 Global View (p. 1892).
Volume state
Volume state describes the availability of an Amazon EBS volume. You can view the volume state in the
State column on the Volumes page in the console, or by using the describe-volumes AWS CLI command.
creating
The underlying hardware related to your EBS volume has failed, and the data associated with the
volume is unrecoverable. For information about how to restore the volume or recover the data on
the volume, see My EBS volume has a status of "error".
1551
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
You can also view the free disk space using the following dir command and examining the last line of
the output:
C:\> dir C:
Volume in drive C has no label.
Volume Serial Number is 68C3-8081
Directory of C:\
You can also view the free disk space using the following fsutil command:
Tip
You can also use the CloudWatch agent to collect disk space usage metrics from an Amazon EC2
instance without connecting to the instance. For more information, see Create the CloudWatch
agent configuration file and Installing the CloudWatch agent in the Amazon CloudWatch
User Guide. If you need to monitor disk space usage for multiple instances, you can install
and configure the CloudWatch agent on those instances using Systems Manager. For more
information, see Installing the CloudWatch agent using Systems Manager.
For information about viewing free disk space on a Linux instance, see View free disk space in the
Amazon EC2 User Guide for Linux Instances.
You can use one of the following procedure to replace an Amazon EBS volume with another volume
created from a previous snapshot of that volume. You must detach the current volume and then attach
the new volume.
Note
Amazon EBS volumes can only be attached to instances in the same Availability Zone.
1552
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Console
To replace a volume
1. Create a volume from the snapshot and write down the ID of the new volume. For more
information, see Create a volume from a snapshot (p. 1541).
2. On the Instances page, select the instance on which to replace the volume and write down the
instance ID.
With the instance still selected, choose the Storage tab. In the Block devices section, find the
volume to replace and write down the device name for the volume, for example /dev/sda1.
For Instance and Device name, enter the instance ID and device name that you wrote down in
Step 2, and then choose Attach volume.
5. Connect to your instance and mount the volume. For more information, see Make an Amazon
EBS volume available for use on Windows (p. 1543).
• Data stored on instance store volumes — Instance store volumes remain attached to the instance after
the root volume has been restored.
• Data stored on data (non-root) Amazon EBS volumes — Non-root Amazon EBS volumes remain
attached to the instance after the root volume has been restored.
• Network configuration — All network interfaces remain attached to the instance and they retain
their IP addresses, identifiers, and attachment IDs. When the instance becomes available, all pending
network traffic is flushed. Additionally, the instance remains on the same physical host, so it retains its
public and private IP addresses and DNS name.
• IAM policies — IAM profiles and policies (such as tag-based policies) that are associated with the
instance are retained and enforced.
Topics
• How does it work? (p. 1553)
• Replace a root volume (p. 1556)
• View root volume replacement tasks (p. 1557)
• To the initial launch state — the volume is restored to its initial state at instance launch. For more
information, see Restore a root volume to its launch state (p. 1554).
• From a snapshot from the same lineage as the current root volume — this allows you to fix issues,
such as root volume corruption or guest operating system network configuration errors. For more
information, see Replace a root volume using a snapshot (p. 1554).
1553
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• From an AMI that has the same key attributes as the instance — this allows you to perform operating
system and application patching or upgrades. For more information, see Replace a root volume using
an AMI (p. 1555).
The original root volume is detached from the instance, and the new root volume is attached to the
instance in its place. The instance's block device mapping is updated to reflect the ID of the replacement
root volume. You can choose whether or not to keep the original root volume after the root volume
replacement process has completed. If you choose delete the original root volume after the replacement
process completes, the original root volume is automatically deleted and becomes unrecoverable. If you
choose to keep the original root volume after the process completes, the volume remains provisioned in
your account; you must manually delete it when you no longer need it.
If the root volume replacement task fails, the instance is rebooted and the original root volume remains
attached to the instance.
Topics
• Restore a root volume to its launch state (p. 1554)
• Replace a root volume using a snapshot (p. 1554)
• Replace a root volume using an AMI (p. 1555)
You can perform a root volume replacement that replaces an instance's root volume with a replacement
root volume that is restored to the original root volume's launch state. The replacement volume is
automatically restored from the snapshot that was used to create the original volume during the
instance launch.
The replacement root volume gets the same type, size, and delete on termination attributes as the
original root volume.
You can perform a root volume replacement that replaces an instance's root volume with a replacement
volume that is restored to a specific snapshot. This enables you to restore the root volume for an
instance to a specific snapshot that you previously created from that root volume.
The replacement root volume gets the same type, size, and delete on termination attributes as the
original root volume.
1554
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• You can only use snapshots that belong to the same lineage as the instance's current root volume.
• You can't use snapshot copies created from snapshots that were taken from the root volume.
• After successfully replacing the root volume, snapshots taken from the original root volume can still be
used to replace the new (replacement) root volume.
You can perform a root volume replacement using an AMI that you own or an AMI that is shared with
you. The AMI must have the same product code, billing information, architecture type, and virtualization
type as that of the instance.
If the instance is enabled for NitroTPM, ENA, or sriov-net, then you must use an AMI that supports those
features. If the instance is not enabled for NitroTPM, ENA, or sriov-net, then you can select an AMI that
does not support those features, or you can select an AMI that does support them, in which case support
is added to the instance.
You can select an AMI with a different boot mode than that of the instance, as long as the instance
supports the boot mode of the AMI. If the instance does not support the boot mode, the request fails. If
the instance supports the boot mode, the new boot mode is propagated to the instance and its UEFI data
is updated accordingly. If you manually modified the boot order or added a private UEFI Secure Boot key
to load private kernel modules, the changes are lost during root volume replacement.
The replacement root volume gets the same volume type and delete on termination attribute as the
original root volume, and it gets the size of the AMI root volume block device mapping.
Note
The size of the AMI root volume block device mapping must be equal to or greater than the size
of the original root volume. If the size of the AMI root volume block device mapping is smaller
than the size of the original root volume, the request fails.
After the root volume replacement task completes, the following new and updated information is
reflected when you describe the instance using the console, AWS CLI or AWS SDKs:
• New AMI ID
• New volume ID for the root volume
• Updated boot mode configuration (if changed by the AMI)
• Updated NitroTPM configuration (if enabled by the AMI)
• Updated ENA configuration (if enabled by the AMI)
• Updated sriov-net configuration (if enabled by the AMI)
• If you use an AMI that has multiple block device mappings, only the root volume of the AMI is used.
The other (non-root) volumes are ignored.
• You can only use this feature if you have permissions to the AMI and its associated root volume
snapshot. You cannot use this feature with AWS Marketplace AMIs.
• You can only use an AMI without a product code only if the instance does not have a product code.
• You can't specify the encryption status for the replacement root volume. The following table
summarizes the possible encryption outcomes.
1555
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Original root volume AMI block device mapping Replacement root volume
• The size of the AMI root volume block device mapping must be equal to or greater than the size of the
original root volume. If the size of the AMI root volume block device mapping is smaller than the size
of the original root volume, the request fails.
• The instance identity documents for the instance are automatically updated.
• If the instance supports NitroTPM, the NitroTPM data for the instance is reset and new keys are
generated.
You can replace the root volume for an instance using one of the following methods.
Note
If you use the Amazon EC2 console, the functionality is available in the new console only.
New console
• To restore the replacement root volume to its initial launch state, choose Create replacement
task without selecting a snapshot.
• To restore the replacement root volume to a specific snapshot, for Snapshot, select the
snapshot to use, and then choose Create replacement task.
• To restore the replacement root volume using an AMI, for AMI, select the AMI to use, and then
choose Create replacement task.
5. To delete the original root volume after the replacement task completes, select Delete replaced
root volume.
AWS CLI
1556
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
For example:
For example:
For example:
1557
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
You can view the root volume replacement tasks for an instance using one of the following methods.
Note
If you use the Amazon EC2 console, the functionality is available in the new console only.
Console
AWS CLI
Use the describe-replace-root-volume-tasks command and specify the IDs of the root volume
replacement tasks to view.
For example:
{
"ReplaceRootVolumeTasks": [
{
"ReplaceRootVolumeTaskId": "replacevol-1234567890abcdef0",
"InstanceId": "i-1234567890abcdef0",
"TaskState": "succeeded",
"StartTime": "2020-11-06 13:09:54.0",
"CompleteTime": "2020-11-06 13:10:14.0",
"SnapshotId": "snap-01234567890abcdef",
"DeleteReplacedRootVolume": "True"
}]
}
1558
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
For example:
Contents
• EBS volume status checks (p. 1559)
• EBS volume events (p. 1561)
• Work with an impaired volume (p. 1562)
• Work with the Auto-Enabled IO volume attribute (p. 1564)
For additional monitoring information, see Amazon CloudWatch metrics for Amazon EBS (p. 1788) and
EventBridge for Amazon EBS (p. 1794).
Volume status checks are automated tests that run every 5 minutes and return a pass or fail status. If
all checks pass, the status of the volume is ok. If a check fails, the status of the volume is impaired. If
the status is insufficient-data, the checks may still be in progress on the volume. You can view the
results of volume status checks to identify any impaired volumes and take any necessary actions.
When Amazon EBS determines that a volume's data is potentially inconsistent, the default is that it
disables I/O to the volume from any attached EC2 instances, which helps to prevent data corruption.
After I/O is disabled, the next volume status check fails, and the volume status is impaired. In addition,
you'll see an event that lets you know that I/O is disabled, and that you can resolve the impaired status
of the volume by enabling I/O to the volume. We wait until you enable I/O to give you the opportunity
to decide whether to continue to let your instances use the volume, or to run a consistency check using a
command, such as chkdsk, before doing so.
Note
Volume status is based on the volume status checks, and does not reflect the volume state.
Therefore, volume status does not indicate volumes in the error state (for example, when
a volume is incapable of accepting I/O.) For information about volume states, see Volume
state (p. 1551).
If the consistency of a particular volume is not a concern, and you'd prefer that the volume be made
available immediately if it's impaired, you can override the default behavior by configuring the volume
to automatically enable I/O. If you enable the Auto-Enable IO volume attribute (autoEnableIO in the
API), the volume status check continues to pass. In addition, you'll see an event that lets you know that
the volume was determined to be potentially inconsistent, but that its I/O was automatically enabled.
This enables you to check the volume's consistency or replace it at a later time.
The I/O performance status check compares actual volume performance to the expected performance of
a volume. It alerts you if the volume is performing below expectations. This status check is available only
for Provisioned IOPS SSD (io1 and io2) and General Purpose SSD (gp3) volumes that are attached to an
1559
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
instance. The status check is not valid for General Purpose SSD (gp2), Throughput Optimized HDD (st1),
Cold HDD (sc1), or Magnetic(standard) volumes. The I/O performance status check is performed once
every minute, and CloudWatch collects this data every 5 minutes. It might take up to 5 minutes from
the moment that you attach an io1 or io2 volume to an instance for the status check to report the I/O
performance status.
Important
While initializing Provisioned IOPS SSD volumes that were restored from snapshots, the
performance of the volume may drop below 50 percent of its expected level, which causes the
volume to display a warning state in the I/O Performance status check. This is expected, and
you can ignore the warning state on Provisioned IOPS SSD volumes while you are initializing
them. For more information, see Initialize Amazon EBS volumes (p. 1779).
Insufficient Data
You can view and work with status checks using the following methods.
Console
The Volume status column displays the operational status of each volume.
3. To view the status details of a specific volume, select it in the grid and choose the Status checks
tab.
4. If you have a volume with a failed status check (status is impaired), see Work with an impaired
volume (p. 1562).
Alternatively, you can choose Events in the navigator to view all the events for your instances and
volumes. For more information, see EBS volume events (p. 1561).
1560
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
AWS CLI
For more information about these command line interfaces, see Access Amazon EC2 (p. 3).
To automatically enable I/O on a volume with potential data inconsistencies, change the setting of the
Auto-Enabled IO volume attribute (autoEnableIO in the API). For more information about changing
this attribute, see Work with an impaired volume (p. 1562).
Each event includes a start time that indicates the time at which the event occurred, and a duration that
indicates how long I/O for the volume was disabled. The end time is added to the event when I/O for the
volume is enabled.
Volume data is potentially inconsistent. I/O is disabled for the volume until you explicitly enable it.
The event description changes to IO Enabled after you explicitly enable I/O.
IO Enabled
I/O operations were automatically enabled on this volume after an event occurred. We recommend
that you check for data inconsistencies before continuing to use the data.
Normal
For io1, io2, and gp3 volumes only. Volume performance is as expected.
Degraded
For io1, io2, and gp3 volumes only. Volume performance is below expectations.
Severely Degraded
For io1, io2, and gp3 volumes only. Volume performance is well below expectations.
Stalled
For io1, io2, and gp3 volumes only. Volume performance is severely impacted.
You can view events for your volumes using the following methods.
Console
1561
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
2. In the navigation pane, choose Events. All instances and volumes that have events are listed.
3. You can filter by volume to view only volume status. You can also filter on specific status types.
4. Select a volume to view its specific event.
AWS CLI
For more information about these command line interfaces, see Access Amazon EC2 (p. 3).
If you have a volume where I/O is disabled, see Work with an impaired volume (p. 1562). If you have a
volume where I/O performance is below normal, this might be a temporary condition due to an action
you have taken (for example, creating a snapshot of a volume during peak usage, running the volume on
an instance that cannot support the I/O bandwidth required, accessing data on the volume for the first
time, etc.).
Options
• Option 1: Perform a consistency check on the volume attached to its instance (p. 1562)
• Option 2: Perform a consistency check on the volume using another instance (p. 1563)
• Option 3: Delete the volume if you no longer need it (p. 1564)
The simplest option is to enable I/O and then perform a data consistency check on the volume while the
volume is still attached to its Amazon EC2 instance.
Console
1562
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
AWS CLI
You can use one of the following commands to view event information for your Amazon EBS
volumes. For more information about these command line interfaces, see Access Amazon
EC2 (p. 3).
Use the following procedure to check the volume outside your production environment.
Important
This procedure may cause the loss of write I/Os that were suspended when volume I/O was
disabled.
Console
AWS CLI
You can use one of the following commands to view event information for your Amazon EBS
volumes. For more information about these command line interfaces, see Access Amazon
EC2 (p. 3).
1563
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
If you have a recent snapshot that backs up the data on the volume, you can create a new volume from
the snapshot. For more information, see Create a volume from a snapshot (p. 1541).
You can view and modify the Auto-Enabled IO attribute of a volume using one of the following
methods.
New console
The Auto-enabled I/O field displays the current setting (Enabled or Disabled) for the selected
volume.
AWS CLI
1564
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
For more information about these command line interfaces, see Access Amazon EC2 (p. 3)
For information about detaching volumes from a Linux instance, see Detach a volume from a Linux
instance in the Amazon EC2 User Guide for Linux Instances.
Topics
• Considerations (p. 330)
• Unmount and detach a volume (p. 1565)
• Troubleshoot (p. 1567)
Considerations
• You can detach an Amazon EBS volume from an instance explicitly or by terminating the instance.
However, if the instance is running, you must first unmount the volume from the instance.
• If an EBS volume is the root device of an instance, you must stop the instance before you can detach
the volume.
• You can reattach a volume that you detached (without unmounting it), but it might not get the same
mount point. If there were writes to the volume in progress when it was detached, the data on the
volume might be out of sync.
• After you detach a volume, you are still charged for volume storage as long as the storage amount
exceeds the limit of the AWS Free Tier. You must delete a volume to avoid incurring further charges.
For more information, see Delete an Amazon EBS volume (p. 1567).
Steps
• Step 1: Unmount the volume (p. 1566)
• Step 2: Detach the volume from the instance (p. 1566)
• Step 3: Uninstall the offline device locations (p. 1566)
1565
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• (Windows Server 2012 and later) On the taskbar, right-click the Windows logo and choose Disk
Management.
• Windows Server 2008) Choose Start, Administrative Tools, Computer Management, Disk
Management.
2. Right-click the disk (for example, right-click Disk 1) and then choose Offline. Wait for the disk status
to change to Offline before opening the Amazon EC2 console.
Console
Command line
The device locations to which the detached volumes were mounted are named AWS NVMe Elastic
Block Storage Adapter and they should appear greyed out.
4. Right-click each greyed out device location named AWS NVMe Elastic Block Storage
Adapter, select Uninstall device and choose Uninstall.
Important
Do not select the Delete the driver software for this device check box.
1566
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
Troubleshoot
The following are common problems encountered when detaching volumes, and how to resolve them.
Note
To guard against the possibility of data loss, take a snapshot of your volume before attempting
to unmount it. Forced detachment of a stuck volume can cause damage to the file system or the
data it contains or an inability to attach a new volume using the same device name, unless you
reboot the instance.
• If you encounter problems while detaching a volume through the Amazon EC2 console, it can be
helpful to use the describe-volumes CLI command to diagnose the issue. For more information, see
describe-volumes.
• If your volume stays in the detaching state, you can force the detachment by choosing Force Detach.
Use this option only as a last resort to detach a volume from a failed instance, or if you are detaching
a volume with the intention of deleting it. The instance doesn't get an opportunity to flush file system
caches or file system metadata. If you use this option, you must perform the file system check and
repair procedures.
• If you've tried to force the volume to detach multiple times over several minutes and it stays in the
detaching state, you can post a request for help to AWS re:Post. To help expedite a resolution,
include the volume ID and describe the steps that you've already taken.
• When you attempt to detach a volume that is still mounted, the volume can become stuck in the busy
state while it is trying to detach. The following output from describe-volumes shows an example of
this condition:
"Volumes": [
{
"AvailabilityZone": "us-west-2b",
"Attachments": [
{
"AttachTime": "2016-07-21T23:44:52.000Z",
"InstanceId": "i-fedc9876",
"VolumeId": "vol-1234abcd",
"State": "busy",
"DeleteOnTermination": false,
"Device": "/dev/sdf"
}
...
}
]
When you encounter this state, detachment can be delayed indefinitely until you unmount the volume,
force detachment, reboot the instance, or all three.
1567
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes
• If a volume is detached from an instance, it’s in the available state. You can delete this
volume.
You can delete an EBS volume using one of the following methods.
Console
AWS CLI
For more information about AWS FIS, see the AWS Fault Injection Simulator User Guide.
Considerations
Keep in mind the following considerations for pausing volume I/O:
• You can pause I/O for all Amazon EBS volume types that are attached to instances built on the Nitro
System (p. 210).
• You can pause I/O for the root volume.
• You can pause I/O for Multi-Attach enabled volumes. If you pause I/O for a Multi-Attach enabled
volume, I/O is paused between the volume and all of the instances to which it is attached.
• To test your OS timeout configuration, set the experiment duration equal to or greater than the value
specified for nvme_core.io_timeout. For more information, see I/O operation timeout (p. 1751).
• If you drive I/O to a volume that has I/O paused, the following happens:
• The volume's status transitions to impaired within 120 seconds. For more information, see Monitor
the status of your volumes (p. 1559).
• The CloudWatch metrics for queue length (VolumeQueueLength) will be non-zero. Any alarms or
monitoring should monitor for a non-zero queue depth. For more information see Volume metrics
for volumes attached to all instance types (p. 1789).
1568
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• The CloudWatch metrics for VolumeReadOps or VolumeWriteOps will be 0, which indicates that
the volume is no longer processing I/O.
Limitations
You can perform a basic experiment from the Amazon EC2 console, or you can perform more advanced
experiments using the AWS FIS console. For more information about performing advanced experiments
using the AWS FIS console, see Tutorials for AWS FIS in the AWS Fault Injection Simulator User Guide.
Each snapshot contains all of the information that is needed to restore your data (from the moment
when the snapshot was taken) to a new EBS volume. When you create an EBS volume based on a
snapshot, the new volume begins as an exact replica of the original volume that was used to create
the snapshot. The replicated volume loads data in the background so that you can begin using it
immediately. If you access data that hasn't been loaded yet, the volume immediately downloads the
requested data from Amazon S3, and then continues loading the rest of the volume's data in the
background. For more information, see Create Amazon EBS snapshots (p. 1574).
1569
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
When you delete a snapshot, only the data unique to that snapshot is removed. For more information,
see Delete an Amazon EBS snapshot (p. 1591).
Snapshot events
You can track the status of your EBS snapshots through CloudWatch Events. For more information, see
EBS snapshot events (p. 1798).
Application-consistent snapshots
Using Systems Manager Run Command, you can take application-consistent snapshots of all EBS
volumes attached to your Amazon EC2 Windows instances. The snapshot process uses the Windows
Volume Shadow Copy Service (VSS) to take image-level backups of VSS-aware applications, including
data from pending transactions between these applications and the disk. You don't need to shut down
your instances or disconnect them when you back up all attached volumes. For more information, see
Creating a VSS Application-Consistent Snapshot.
Multi-volume snapshots
Snapshots can be used to create a backup of critical workloads, such as a large database or a file system
that spans across multiple EBS volumes. Multi-volume snapshots allow you to take exact point-in-
time, data coordinated, and crash-consistent snapshots across multiple EBS volumes attached to an
EC2 instance. You are no longer required to stop your instance or to coordinate between volumes to
ensure crash consistency, because snapshots are automatically taken across multiple EBS volumes. For
more information, see the steps for creating a multi-volume EBS snapshot under Create Amazon EBS
snapshots (p. 1574) .
Snapshot pricing
Charges for your snapshots are based on the amount of data stored. Because snapshots are incremental,
deleting a snapshot might not reduce your data storage costs. Data referenced exclusively by a snapshot
is removed when that snapshot is deleted, but data referenced by other snapshots is preserved. For more
information, see Amazon Elastic Block Store Volumes and Snapshots in the AWS Billing User Guide.
Contents
• How snapshots work (p. 1570)
• Copy and share snapshots (p. 1573)
• Encryption support for snapshots (p. 1574)
• Create Amazon EBS snapshots (p. 1574)
• Create a VSS application-consistent snapshot (p. 1578)
• Delete an Amazon EBS snapshot (p. 1591)
• Copy an Amazon EBS snapshot (p. 1593)
• Archive Amazon EBS snapshots (p. 1597)
• View Amazon EBS snapshot information (p. 1620)
• Share an Amazon EBS snapshot (p. 1621)
• Recover snapshots from the Recycle Bin (p. 1625)
• Amazon EBS local snapshots on Outposts (p. 1628)
• Use EBS direct APIs to access the contents of an EBS snapshot (p. 1638)
• Automate the snapshot lifecycle (p. 1670)
1570
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
volume are incremental snapshots. They include only changed and new data blocks written to the
volume since the last snapshot was created
The size of a full snapshot is determined by the size of the data being backed up, not the size of the
source volume. Similarly, the storage costs associated with a full snapshot is determined by the size of
the snapshot, not the size of the source volume. For example, you create the first snapshot of a 200 GiB
Amazon EBS volume that contains only 50 GiB of data. This results in a full snapshot that is 50 GiB in
size, and you are billed for 50 GiB snapshot storage.
Similarly, the size and storage costs of an incremental snapshot are determined by the size of any data
that was written to the volume since the previous snapshot was created. Continuing this example, if
you create a second snapshot of the 200 GiB volume after changing 20 GiB of data and adding 10
GiB of data, the incremental snapshot is 30 GiB in size. You are then billed for that additional 30 GiB
snapshot storage.
For more information about snapshot pricing, see Amazon EBS pricing.
Important
When you archive an incremental snapshot, it is converted to a full snapshot that includes all
of the blocks written to the volume at the time that the snapshot was created. It is then moved
to the Amazon EBS Snapshots Archive tier. Snapshots in the archive tier are billed at a different
rate from snapshots in the standard tier. For more information, see Pricing and billing (p. 1599).
The following sections show how an EBS snapshot captures the state of a volume at a point in time, and
how subsequent snapshots of a changing volume create a history of those changes.
The diagram in this section shows Volume 1, which is 15 GiB in size, at three points in time. A snapshot
is taken of each of these three volume states. The diagram specifically shows the following:
• In State 1, the volume has 10 GiB of data. Snap A is the first snapshot taken of the volume. Snap A is
a full snapshot and the entire 10 GiB of data is backed up.
• In State 2, the volume still contains 10 GiB of data, but only 4 GiB have changed after Snap A was
taken. Snap B is an incremental snapshot. It needs to back up only the 4 GiB that changed. The other
6 GiB of unchanged data, which are already backed up in Snap A, are referenced by Snap B rather
than being backed up again. This is indicated by the dashed arrow.
• In State 3, 2 GiB of data have been added to the volume, for a total of 12 GiB, after Snap B was
taken. Snap C is an incremental snapshot. It needs to back up only the 2 GiB that were added after
Snap B was taken. As shown by the dashed arrows, Snap C also references the 4 GiB of data stored in
Snap B, and the 6 GiB of data stored in Snap A.
• The total storage required for the three snapshots is 16 GiB total. This accounts for 10 GiB for Snap
A, 4 GiB for Snap B, and 2 GiB for Snap C.
1571
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The diagram in this section shows how incremental snapshots can be taken from different volumes.
1. Vol 1, which is 14 GiB in size, has 10 GiB of data. Because Snap A is the first snapshot taken of the
volume, it is a full snapshot and the entire 10 GiB of data is backed up.
2. Vol 2 is created from Snap A, so it is an exact replica of Vol 1 at the time the snapshot was taken.
3. Over time, 4 GiB of data is added to Vol 2 and the total size of its data is 14 GiB.
4. Snap B is taken from Vol 2. For Snap B, only the 4 GiB of data that was added after the volume was
created from Snap A is backed up. The other 10 GiB of unchanged data, which is already stored in
Snap A, is referenced by Snap B instead of being backed up again.
Snap B is an incremental snapshot of Snap A, even though it was created from a different volume.
1572
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Important
The diagram assumes that you own Vol 1 and Snap A, and that Vol 2 is encrypted with the same
KMS key as Vol 1. If Vol 1 was owned by another AWS account and that account took Snap A
and shared it with you, then Snap B would be a full snapshot. Or, if Vol 2 was encrypted with a
different KMS key than Vol 1, then Snap B would be a full snapshot.
For more information about how data is managed when you delete a snapshot, see Delete an Amazon
EBS snapshot (p. 1591).
A snapshot is constrained to the AWS Region where it was created. After you create a snapshot of an EBS
volume, you can use it to create new volumes in the same Region. For more information, see Create a
volume from a snapshot (p. 1541). You can also copy snapshots across Regions, making it possible to use
multiple Regions for geographical expansion, data center migration, and disaster recovery. You can copy
any accessible snapshot that has a completed status. For more information, see Copy an Amazon EBS
snapshot (p. 1593).
1573
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Complete documentation of possible snapshot encryption scenarios is provided in Create Amazon EBS
snapshots (p. 1574) and in Copy an Amazon EBS snapshot (p. 1593).
You can create a point-in-time snapshot of an EBS volume and use it as a baseline for new volumes or
for data backup. If you make periodic snapshots of a volume, the snapshots are incremental—the new
snapshot saves only the blocks that have changed since your last snapshot.
Snapshots occur asynchronously; the point-in-time snapshot is created immediately, but the status of
the snapshot is pending until the snapshot is complete (when all of the modified blocks have been
transferred to Amazon S3), which can take several hours for large initial snapshots or subsequent
snapshots where many blocks have changed. While it is completing, an in-progress snapshot is not
affected by ongoing reads and writes to the volume.
You can take a snapshot of an attached volume that is in use. However, snapshots only capture data
that has been written to your Amazon EBS volume at the time the snapshot command is issued. This
might exclude any data that has been cached by any applications or the operating system. If you can
pause any file writes to the volume long enough to take a snapshot, your snapshot should be complete.
However, if you can't pause all file writes to the volume, you should unmount the volume from within
the instance, issue the snapshot command, and then remount the volume to ensure a consistent and
complete snapshot. You can remount and use your volume while the snapshot status is pending.
To make snapshot management easier, you can tag your snapshots during creation or add tags
afterward. For example, you can apply tags describing the original volume from which the snapshot
was created, or the device name that was used to attach the original volume to an instance. For more
information, see Tag your Amazon EC2 resources (p. 1894).
Snapshot encryption
Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created
from encrypted snapshots are also automatically encrypted. The data in your encrypted volumes and
any associated snapshots is protected both at rest and in motion. For more information, see Amazon EBS
encryption (p. 1732).
1574
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
By default, only you can create volumes from snapshots that you own. However, you can share your
unencrypted snapshots with specific AWS accounts, or you can share them with the entire AWS
community by making them public. For more information, see Share an Amazon EBS snapshot (p. 1621).
You can share an encrypted snapshot only with specific AWS accounts. For others to use your shared,
encrypted snapshot, you must also share the CMK key that was used to encrypt it. Users with access to
your encrypted snapshot must create their own personal copy of it and then use that copy. Your copy of
a shared, encrypted snapshot can also be re-encrypted using a different key. For more information, see
Share an Amazon EBS snapshot (p. 1621).
Multi-volume snapshots
You can create multi-volume snapshots, which are point-in-time snapshots for all, or some, of the
volumes attached to an instance.
By default, when you create multi-volume snapshots from an instance, Amazon EBS creates snapshots of
all the volumes (root and data (non-root)) that are attached to the instance. However, you can choose to
create snapshots of a subset of the volumes that are attached to the instance.
You can tag your multi-volume snapshots as you would a single volume snapshot. We recommend you
tag your multiple volume snapshots to manage them collectively during restore, copy, or retention. You
can also choose to automatically copy tags from the source volume to the corresponding snapshots.
This helps you to set the snapshot metadata, such as access policies, attachment information, and cost
allocation, to match the source volume.
After the snapshots are created, each snapshot is treated as an individual snapshot. You can perform all
snapshot operations, such as restore, delete, and copy across Regions or accounts, just as you would with
a single volume snapshot.
Multi-volume, crash-consistent snapshots are typically restored as a set. It is helpful to identify the
snapshots that are in a crash-consistent set by tagging your set with the instance ID, name, or other
relevant details.
After creating your snapshots, they appear in your EC2 console created at the exact point-in-time.
If any one snapshot for the multi-volume snapshot set fails, all of the other snapshots display an error
status and a createSnapshots CloudWatch event with a result of failed is sent to your AWS account.
For more information, see Create snapshots (createSnapshots) (p. 1799).
Considerations
The following considerations apply to creating snapshots:
• When you create a snapshot for an EBS volume that serves as a root device, we recommend that you
stop the instance before taking the snapshot.
• You cannot create snapshots from instances for which hibernation is enabled, or from hibernated
instances. If you create a snapshot or AMI from an instance that is hibernated or has hibernation
enabled, you might not be able to connect to a new instance that is launched from the AMI, or from an
AMI that was created from the snapshot.
• Although you can take a snapshot of a volume while a previous snapshot of that volume is in the
pending status, having multiple pending snapshots of a volume can result in reduced volume
performance until the snapshots complete.
1575
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• There is a limit of one pending snapshot for a single st1 or sc1 volume, or five
pending snapshots for a single volume of the other volume types. If you receive a
ConcurrentSnapshotLimitExceeded error while trying to create multiple concurrent snapshots of
the same volume, wait for one or more of the pending snapshots to complete before creating another
snapshot of that volume.
• When a snapshot is created from a volume with an AWS Marketplace product code, the product code is
propagated to the snapshot.
• When creating multi-volume snapshot sets from instances, you can specify up to 40 data (non-root)
volumes to exclude.
Create a snapshot
To create a snapshot from the specified volume, use one of the following methods.
Console
The Encryption field indicates the selected volume's encryption status. If the selected volume
is encrypted, the snapshot is automatically encrypted using the same KMS key. If the selected
volume is unencrypted, the snapshot is not encrypted.
5. (Optional) For Description, enter a brief description for the snapshot.
6. (Optional) To assign custom tags to the snapshot, in the Tags section, choose Add tag, and then
enter the key-value pair. You can add up to 50 tags.
7. Choose Create snapshot.
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
Considerations
To create a snapshot from the volumes of an instance, use one of the following methods.
1576
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Console
In the Attached data volumes section, select the data volumes for which you do not want to
create snapshots. Only the volumes that remain unselected will be included in the multi-volume
snapshot set. You can exclude up to 40 volumes.
7. (Optional) To automatically copy tags from the source volumes to the corresponding snapshots,
for Copy tags from source volume, select Copy tags. This sets snapshot metadata—such as
access policies, attachment information, and cost allocation—to match the source volume.
8. (Optional) To assign additional custom tags to the snapshots, in the Tags section, choose Add
tag, and then enter the key-value pair. You can add up to 50 tags.
9. Choose Create snapshot.
During snapshot creation, the snapshots are managed together. If one of the snapshots in the
volume set fails, the other snapshots are moved to error status for the volume set. You can
monitor the progress of your snapshots using CloudWatch Events. After the snapshot creation
process completes, CloudWatch generates an event that contains the status and all of the
relevant snapshot details for the affected instance.
Command line
AWS CLI
To create multi-volume snapshots using the AWS CLI, use the create-snapshots command.
If you do not want to create a snapshot of the root volume, for --instance-specification
ExcludeBootVolume, specify true. If you do not want to create snapshots of all the
data (non-root) volumes attached to the instance, for --instance-specification
ExcludeDataVolumes, specify the IDs of the data volumes for which you do not want to create
snapshots. You can specify up to 40 volumes to exclude.
To create multi-volume snapshots using the Tools for Windows PowerShell, use the New-
EC2SnapshotBatch command.
1577
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You can use Systems Manager Run Command to take application-consistent snapshots of all EBS
volumes attached to your Amazon EC2 Windows instances. The snapshot process uses the Windows
Volume Shadow Copy Service (VSS) to take image-level backups of VSS-aware applications,
including data from pending transactions between these applications and the disk. You don't need
to shut down your instances or disconnect them when you back up all attached volumes. For more
information, see Create a VSS application-consistent snapshot (p. 1578).
If all of the snapshots complete successfully, a createSnapshots CloudWatch event with a result
of succeeded is sent to your AWS account. If any one snapshot for the multi-volume snapshot set
fails, all of the other snapshots display an error status and a createSnapshots CloudWatch event
with a result of failed is sent to your AWS account. For more information, see Create snapshots
(createSnapshots) (p. 1799).
There is no additional cost to use VSS-enabled EBS snapshots. You only pay for EBS snapshots created by
the backup process. For more information, see How is my EBS snapshot bill calculated?
Contents
• How it works (p. 1578)
• Before you begin (p. 1579)
• Get started (p. 1580)
• Create a VSS application-consistent snapshot (p. 1584)
• Restore volumes from VSS-enabled EBS snapshots (p. 1590)
• AWS VSS component package version history (p. 1590)
How it works
The process for taking application-consistent, VSS-enabled EBS snapshots consists of the following
steps.
1578
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
4. The system flushes all I/O buffers and temporarily pauses all I/O operations. The pause lasts, at most,
ten seconds.
5. During the pause, the system creates snapshots of all volumes attached to the instance.
6. The pause is lifted and I/O resumes operation.
7. The system adds all newly-created snapshots to the list of EBS snapshots. The system tags all VSS-
enabled EBS snapshots successfully created by this process with AppConsistent:true. This tag
helps you identify snapshots created by this process, as opposed to other processes. If the system
encounters an error, the snapshot created by this process does not include the AppConsistent:true
tag.
8. If you need to restore from a snapshot, you can use the standard EBS process of creating a volume
from a snapshot, or you can restore all volumes to an instance by using a sample script, which is
described later in this section.
VSS-enabled EBS snapshots are supported for instances running Windows Server 2012 or later. Verify
that your instances meet all requirements for Amazon EC2 Windows. For more information, see Setting
Up AWS Systems Manager in the AWS Systems Manager User Guide.
The AWSVssComponents package requires .NET Framework version 4.6 and later. If you are using
Windows 2012, or 2012 R2, the default .NET Framework version is earlier than 4.6 and you must install
version 4.6 or later using Windows Update.
Update your instances to use SSM Agent version 2.2.58.0 or later. If you are using an older version of
SSM Agent, you can update it by using Run Command. For more information, see Update SSM Agent by
using Run Command in the AWS Systems Manager User Guide.
Ensure that your instance is running version 3.3.48.0 or later of the AWS Tools for Windows PowerShell.
To check your version number, run the following command on the instance in a PowerShell console:
Get-AWSPowerShellVersion
If you need to update the version of Tools for Windows PowerShell on your instance, see Setting up
the AWS Tools for Windows PowerShell on a Windows-based Computer in the AWS Tools for Windows
PowerShell User Guide.
1579
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Ensure that your instance is running Windows PowerShell major version 3, 4, or 5. To check your version
number, run the following command on the instance in a Windows PowerShell console:
$PSVersionTable.PSVersion
Ensure that your instance has the PowerShell language mode set to FullLanguage. For more
information about language modes, see about_Language_Modes in the Microsoft documentation.
Get started
These instructions describe how to install the VSS components and perform an application-consistent
snapshot of the EBS volumes attached to an EC2 Windows instance. For more information, see Getting
Started with Amazon EC2 Windows Instances.
Contents
• Create an IAM role for VSS-enabled snapshots (p. 1580)
• Download and install VSS components to the Windows on EC2 instance (p. 1581)
• Create a VSS application-consistent snapshot using the console (p. 1583)
The following procedures describes how to work with IAM policies and IAM roles. The policy enables
Systems Manager to create snapshots, tags snapshots, and attach metadata like a device ID to the
default snapshot tags that the system creates.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": [
"arn:aws:ec2:*::snapshot/*",
"arn:aws:ec2:*::image/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:CreateSnapshot",
"ec2:CreateImage",
"ec2:DescribeImages",
"ec2:DescribeSnapshots"
],
"Resource": "*"
}
]
}
1580
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If you do not intend to set the CreateAmi parameter to True, then you can omit
arn:aws:ec2:*::image/* from the first policy statement and you can omit ec2:CreateImage,
ec2:DescribeSnapshots, and ec2:DescribeImages from the second policy statement.
If you intend to always set the CreateAmi parameter to True, then you can omit
ec2:CreateSnapshot from the second policy statement.
4. Choose Review policy.
5. For Name, enter a name to identify the policy, such as VssSnapshotRole or another name that you
prefer.
6. (Optional) For Description, enter a description of the role's purpose.
7. Choose Create policy.
Use the following procedure to create an IAM role for VSS-enabled snapshots. This role includes policies
for Amazon EC2 and Systems Manager.
Systems Manager requires VSS components to be installed on your instances. Use the following
procedure to install the components using the AWSVssComponents package. The package installs two
components: a VSS requester and a VSS provider. We recommend that you install the latest AWS VSS
component package to improve reliability and performance of application-consistent snapshots on
your EC2 Windows instances. To view the latest package version, see the AWS VSS component package
version history (p. 1590).
1581
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• For Concurrency, specify either a number or a percentage of instances on which to run the
command at the same time.
Note
If you selected targets by choosing Amazon EC2 tags, and you are not certain how many
instances use the selected tags, then limit the number of instances that can run the
document at the same time by specifying a percentage.
• For Error threshold, specify when to stop running the command on other instances after it fails
on either a number or a percentage of instances. For example, if you specify three errors, then
Systems Manager stops sending the command when the fourth error is received. Instances still
processing the command might also send errors.
9. (Optional) For Output options section, if you want to save the command output to a file, select the
box next to Enable writing to an S3 bucket. Specify the bucket and (optional) prefix (folder) names.
Note
The S3 permissions that grant the ability to write the data to an S3 bucket are those of
the instance profile assigned to the instance, not those of the user performing this task.
For more information, see Create an IAM Instance Profile for Systems Manager in the AWS
Systems Manager User Guide.
10. (Optional) Specify options for SNS notifications.
For information about configuring Amazon SNS notifications for Run Command, see Configuring
Amazon SNS Notifications for AWS Systems Manager.
11. Choose Run.
Use the following procedure to verify the signature on the AWSVssComponents package.
1. Connect to your Windows instance. For more information, see Connect to your Windows
instance (p. 610).
2. Navigate to C:\Program Files\Amazon\AwsVssComponents.
3. Open the context (right-click) menu for ec2-vss-agent.exe, and then choose Properties.
1582
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
4. Navigate to the Digital Signatures tab and verify that the name of the signer is Amazon Web
Services Inc.
5. Use the preceding steps to verify the signature on Ec2VssInstaller and Ec2VssProvider.dll.
a. Choose an option from the Exclude Boot Volume list. Use this parameter to exclude boot
volumes from the backup process.
b. (Optional) For Description field, type a description. This description is applied to any snapshot
created by this process.
c. (Optional) For Tags, type keys and values for tags that you want to apply to any snapshot
created by this process. Tags can help you locate, manage, and restore volumes from a list
of snapshots. By default, the system populates the tag parameter with a Name key. For the
value of this key, specify a name that you want to apply to snapshots created by this process.
If you want to specify additional tags, separate tags by using a semicolon. For example,
Key=Environment,Value=Test;Key=User,Value=TestUser1.
We recommended that you tag snapshots. By default, the systems tags snapshots with the
device ID, and AppConsistent (for indicating successful, application-consistent VSS-enabled
EBS snapshots).
d. For Copy Only, choose True to perform a copy only backup operation. This option is set
to False by default so that the system performs a full backup operation. A full backup
operation prevents the system from breaking the differential backup chain in SQL Server when
performing a backup.
Note
This option requires that AWS VSS provider version 1.2.00 or later be installed.
e. For No Writers, choose True to exclude application VSS writers from the snapshot process. This
can help you resolve conflicts with third-party VSS backup components. This option is set to
False by default.
Note
This option requires that AWS VSS provider version 1.2.00 or later be installed.
f. For CreateAmi, choose True to create an Amazon Machine Image (AMI) backup that is VSS-
enabled, instead of an EBS snapshot. This option is set to False by default. For more information
about creating an AMI, see Create a Windows AMI from a running instance.
g. (Optional) For AmiName, specify a name for the created AMI. This option applies only if the
CreateAmi option is set to True.
1583
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• For Concurrency, specify either a number or a percentage of instances on which to run the
command at the same time.
Note
If you selected targets by choosing Amazon EC2 tags, and you are not certain how many
instances use the selected tags, then limit the number of instances that can run the
document at the same time by specifying a percentage.
• For Error threshold, specify when to stop running the command on other instances after it fails
on either a number or a percentage of instances. For example, if you specify three errors, then
Systems Manager stops sending the command when the fourth error is received. Instances still
processing the command might also send errors.
9. (Optional) For Output options, to save the command output to a file, select the box next to Enable
writing to an S3 bucket. Specify the bucket and (optional) prefix (folder) names.
Note
The S3 permissions that grant the ability to write the data to an S3 bucket are those of the
instance profile assigned to the instance, not those of the user performing this task. For
more information, see Setting Up Systems Manager.
10. (Optional) Specify options for SNS notifications.
For information about configuring Amazon SNS notifications for Run Command, see Configuring
Amazon SNS Notifications for AWS Systems Manager in the AWS Systems Manager User Guide.
11. Choose Run.
If successful, the command populates the list of EBS snapshots with the new snapshots. You can
locate these snapshots in the list of EBS snapshots by searching for the tags you specified, or
by searching for AppConsistent. If the command execution failed, view the Systems Manager
command output for details about why the execution failed. If the command successfully completed,
but a specific volume backup failed, you can troubleshoot the failure in the list of EBS volumes.
If the command failed and you are using Systems Manager with VPC endpoints, verify that you
configured the com.amazonaws.region.ec2 endpoint. Without the EC2 endpoint defined, the call
to enumerate attached EBS volumes fails, which causes the Systems Manager command to fail.
For more information about setting up VPC endpoints with Systems Manager, see Create a Virtual
Private Cloud Endpoint in the AWS Systems Manager User Guide.
Note
You can automate backups by creating a maintenance window task that uses the
AWSEC2-CreateVssSnapshot SSM document. For more information, see Working with
Maintenance Windows (Console).
Contents
• Before you begin (p. 1585)
• Install the VSS package (p. 1585)
1584
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If you intend to use the AWS CLI, ensure that you have the latest version of the AWS CLI installed. For
more information, see Installing or upgrading and then configuring the AWS CLI in the AWS Systems
Manager User Guide.
If you intend to use the AWS Tools for Windows PowerShell, ensure that you have the latest version of
the Tools for Windows PowerShell installed. For more information, see Installing or upgrading and then
configuring the AWS Tools for Windows PowerShell in the AWS Systems Manager User Guide.
Tip
You can also use AWS CloudShell for a browser-based, pre-authenticated shell launched directly
from the AWS Management Console.
Use one of the following command-line procedures to download and install the VSS components to the
Windows on EC2 instance.
Topics
• Install the VSS package using the AWS CLI (p. 1585)
• Install the VSS package using the Tools for Windows PowerShell (p. 1585)
Use the following procedure to download and install the AwsVssComponents package on your instances
by using Run Command from the AWS CLI. The package installs two components: a VSS requestor and a
VSS provider. The system copies these components to a directory on the instance, and then registers the
provider DLL as a VSS provider.
• Run the following command to download and install the required VSS components for Systems
Manager.
Install the VSS package using the Tools for Windows PowerShell
Use the following procedure to download and install the AwsVssComponents package on your instances
by using Run Command from the Tools for Windows PowerShell. The package installs two components:
a VSS requestor and a VSS provider. The system copies these components to a directory on the instance,
and then registers the provider DLL as a VSS provider.
To install the VSS package using the AWS Tools for Windows PowerShell
1. Open AWS Tools for Windows PowerShell and run the following command to specify your user
access keys. Your user must either have administrative access for Amazon EC2 or it must have the
required permissions granted. For more information, see Setting Up AWS Systems Manager in the
AWS Systems Manager User Guide.
1585
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
2. Run the following command to set the Region for your PowerShell session. The example uses the
us-east-2 Region.
3. Run the following command to download and install the required VSS components for Systems
Manager.
Use one of the following command-line procedures to create VSS-enabled EBS snapshots.
Topics
• Create VSS-enabled EBS snapshots using the AWS CLI (p. 1586)
• Create VSS-enabled EBS snapshots using AWS Tools for Windows PowerShell (p. 1587)
• Create VSS-enabled EBS snapshots using the AWSEC2-ManageVssIO SSM document
(advanced) (p. 1588)
Use the following procedure to create VSS-enabled EBS snapshots by using the AWS CLI. When you run
the command, you can specify the following parameters:
• Instance (Required): Specify one or more Amazon EC2 Windows instances. You can either manually
specify instances, or you can specify tags.
• Description (Optional): Specify details about this backup.
• Tags (Optional): Specify key-value tag pairs that you want to assign to the snapshots. Tags can help
you locate, manage, and restore volumes from a list of snapshots. By default, the system populates
the tag parameter with a Name key. For the value of this key, specify a name that you want to apply
to snapshots created by this process. You can also add custom tags to this list by using the following
format: Key=Environment,Value=Test;Key=User,Value=TestUser1.
This parameter is optional, but we recommended that you tag snapshots. By default, the systems tags
snapshots with the device ID, and AppConsistent (for indicating successful, application-consistent
VSS-enabled EBS snapshots).
• Exclude Boot Volume (Optional): Use this parameter to exclude boot volumes from the backup process.
1586
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If successful, the command populates the list of EBS snapshots with the new snapshots. You can locate
these snapshots in the list of EBS snapshots by searching for the tags you specified, or by searching for
AppConsistent. If the command execution failed, view the command output for details about why the
execution failed.
You can automate backups by creating a maintenance window task that uses the AWSEC2-
CreateVssSnapshot SSM document. For more information, see Working with Maintenance Windows
(Console) in the AWS Systems Manager User Guide.
Create VSS-enabled EBS snapshots using AWS Tools for Windows PowerShell
Use the following procedure to create VSS-enabled EBS snapshots by using the AWS Tools for Windows
PowerShell. When you run the command, you can specify the following parameters:
• Instance (Required): Specify one or more Amazon EC2 Windows instances. You can either manually
specify instances, or you can specify tags.
• Description (Optional): Specify details about this backup.
• Tags (Optional): Specify key-value tag pairs that you want to assign to the snapshots. Tags can help
you locate, manage, and restore volumes from a list of snapshots. By default, the system populates
the tag parameter with a Name key. For the value of this key, specify a name that you want to apply
to snapshots created by this process. You can also add custom tags to this list by using the following
format: Key=Environment,Value=Test;Key=User,Value=TestUser1.
This parameter is optional, but we recommend that you tag snapshots. By default, the systems tags
snapshots with the device ID, and AppConsistent (for indicating successful, application-consistent
VSS-enabled EBS snapshots).
• Exclude Boot Volume (Optional): Use this parameter to exclude boot volumes from the backup process.
To create VSS-enabled EBS snapshots by using AWS Tools for Windows PowerShell
1. Open AWS Tools for Windows PowerShell and run the following command to specify your user
access keys. Your user must either have administrative access for Amazon EC2 or it must have the
required permissions granted. For more information, see Setting Up AWS Systems Manager in the
AWS Systems Manager User Guide.
2. Execute the following command to set the Region for your PowerShell session. The example uses the
us-east-2 Region.
If successful, the command populates the list of EBS snapshots with the new snapshots. You can locate
these snapshots in the list of EBS snapshots by searching for the tags you specified, or by searching for
AppConsistent. If the command execution failed, view the command output for details about why the
execution failed. If the command successfully completed, but a specific volume backup failed, you can
troubleshoot the failure in the list of EBS snapshots.
1587
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You can automate backups by creating a maintenance window task that uses the AWSEC2-
CreateVssSnapshot SSM document. For more information, see Working with Maintenance Windows
(Console) in the AWS Systems Manager User Guide.
Create VSS-enabled EBS snapshots using the AWSEC2-ManageVssIO SSM document (advanced)
You can use the following script and the pre-defined AWSEC2-ManageVssIO SSM document to
temporarily pause I/O, create VSS-enabled EBS snapshots, and restart I/O. This process runs in the
context of the user who runs the command. If the user has sufficient permission to create and tag
snapshots, then AWS Systems Manager can create and tag VSS-enabled EBS snapshots without the need
for the additional IAM snapshot role on the instance.
In contrast, the AWSEC2-CreateVssSnapshot document requires that you assign the IAM snapshot role
to each instance for which you want to create EBS snapshots. If you don’t want to provide additional IAM
permissions to your instances for policy or compliance reasons, then you can use the following script.
1. Open AWS Tools for Windows PowerShell and run the following command to specify your user
access keys. Your user must either have administrative access for Amazon EC2 or it must have the
required permissions granted. For more information, see Setting Up AWS Systems Manager in the
AWS Systems Manager User Guide.
2. Execute the following command to set the Region for your PowerShell session. The example uses the
us-east-2 Region.
If successful, the command populates the list of EBS snapshots with the new snapshots. You can locate
these snapshots in the list of EBS snapshots by searching for the tags you specified, or by searching for
AppConsistent. If the command execution failed, view the command output for details about why the
execution failed. If the command was successfully completed, but a specific volume backup failed, you
can troubleshoot the failure in the list of EBS volumes.
1588
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If you experience problems or receive error messages when creating VSS-enabled EBS snapshots, you can
view the command output in the Systems Manager console. You can also view the following logs:
• %ProgramData%\Amazon\SSM\InstanceData\InstanceID\document\orchestration
\SSMCommandID\awsrunPowerShellScript\runPowerShellScript\stdout
• %ProgramData%\Amazon\SSM\InstanceData\InstanceID\document\orchestration
\SSMCommandID\awsrunPowerShellScript\runPowerShellScript\stderr
You can also open the Event Viewer Windows application and choose Windows Logs, Application to
view additional logs. To see events specifically from the EC2 Windows VSS Provider and the Volume
Shadow Copy Service, filter by Source on the terms Ec2VssSoftwareProvider and VSS.
Error: Thaw pipe connection timed out, error on thaw, timeout waiting for VSS Freeze, or other
timeout errors
The EC2 Windows VSS Provider might time out due to activity or services on the instance preventing
VSS-enabled snapshots from proceeding in a timely manner. The Windows VSS Framework provides a
non-configurable 10-second window during which communication to the file system is paused. During
this time, AWSEC2-CreateVssSnapshot snapshots your volumes.
The following items can cause the EC2 Windows VSS Provider to run into time limits during a snapshot:
Usually, when running into time limits with the AWSEC2-CreateVssSnapshot command, the cause is
related to the workload on the instance being too high at the time of backup. The following actions can
help you take a successful snapshot:
1589
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Error: Cannot invoke method. Method invocation is supported only on core types in this language
mode.
You will encounter this error when the PowerShell language mode is not set to FullLanguage. The
AWSEC2-CreateVssSnapshot and AWSEC2-ManageVssIo SSM documents require PowerShell to be
configured to FullLanguage mode.
To verify the language mode, run the following command on the instance in a PowerShell console:
$ExecutionContext.SessionState.LanguageMode
For more information about language modes, see about_Language_Modes in the Microsoft
documentation.
• Stops an instance
• Removes all existing drives from the instance (except the boot volume, if it was excluded)
• Creates new volumes from the snapshots
• Attaches the volumes to the instance by using the device ID tag on the snapshot
• Restarts the instance
Important
The following script detaches all volumes attached to an instance, and then creates new
volumes from a snapshot. Make sure that you have properly backed-up the instance. The old
volumes are not deleted. If you want, you can edit the script to delete the old volumes.
1. Open AWS Tools for Windows PowerShell and run the following command to specify your user
access keys. Your user must either have administrative access for Amazon EC2 or it must have the
required permissions granted. For more information, see Setting Up AWS Systems Manager in the
AWS Systems Manager User Guide.
2. Run the following command to set the Region for your PowerShell session. The example uses the
us-east-2 Region.
1590
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
2.0.0 Added capability to the AWS VSS component to create snapshots April 28, 2023
and AMIs, which enables compatibility with PowerShell module
logging, script block logging, and transcription features.
1.3.2.0 Fixed a case where installation failure is not reported correctly. May 10, 2022
1.2.00 • Added command line parameters -nw (no-writers) and -copy November 15,
(copy-only) to agent. 2018
• Fixed EventLog errors caused by improper memory allocation
calls.
1.1 Fixed AWS VSS components that were being used incorrectly as the December 12,
default Windows Backup and Restore provider. 2017
If data was present on a volume held in an earlier snapshot or series of snapshots, and that data is
subsequently deleted from the volume later on, the data is still considered to be unique data of the
earlier snapshots. Unique data is only deleted from the sequence of snapshots if all snapshots that
reference the unique data are deleted.
When you delete a snapshot, only the data that is referenced exclusively by that snapshot is removed.
Unique data is only deleted if all of the snapshots that reference it are deleted. Deleting previous
snapshots of a volume does not affect your ability to create volumes from later snapshots of that
volume.
Deleting a snapshot might not reduce your organization's data storage costs. Other snapshots might
reference that snapshot's data, and referenced data is always preserved. If you delete a snapshot
containing data being used by a later snapshot, costs associated with the referenced data are allocated
to the later snapshot. For more information about how snapshots store data, see How snapshots
work (p. 1570) and the following example.
1591
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
In the following diagram, Volume 1 is shown at three points in time. A snapshot has captured each of the
first two states, and in the third, a snapshot has been deleted.
• In State 1, the volume has 10 GiB of data. Because Snap A is the first snapshot taken of the volume,
the entire 10 GiB of data must be copied.
• In State 2, the volume still contains 10 GiB of data, but 4 GiB have changed. Snap B needs to copy and
store only the 4 GiB that changed after Snap A was taken. The other 6 GiB of unchanged data, which
are already copied and stored in Snap A, are referenced by Snap B rather than (again) copied. This is
indicated by the dashed arrow.
• In state 3, the volume has not changed since State 2, but Snapshot A has been deleted. The 6 GiB of
data stored in Snapshot A that were referenced by Snapshot B have now been moved to Snapshot
B, as shown by the heavy arrow. As a result, you are still charged for storing 10 GiB of data; 6 GiB of
unchanged data preserved from Snap A and 4 GiB of changed data from Snap B.
Considerations
The following considerations apply to deleting snapshots:
• You can't delete a snapshot of the root device of an EBS volume used by a registered AMI. You must
first deregister the AMI before you can delete the snapshot. For more information, see Deregister your
AMI (p. 177).
1592
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• You can't delete a snapshot that is managed by the AWS Backup service using Amazon EC2.
Instead, use AWS Backup to delete the corresponding recovery points in the backup vault. For more
information, see Deleting backups in the AWS Backup Developer Guide.
• You can create, retain, and delete snapshots manually, or you can use Amazon Data Lifecycle
Manager to manage your snapshots for you. For more information, see Amazon Data Lifecycle
Manager (p. 1670).
• Although you can delete a snapshot that is still in progress, the snapshot must complete before the
deletion takes effect. This might take a long time. If you are also at your concurrent snapshot limit, and
you attempt to take an additional snapshot, you might get a ConcurrentSnapshotLimitExceeded
error. For more information, see the Service Quotas for Amazon EBS in the Amazon Web Services
General Reference.
• If you delete a snapshot that matches an Recycle Bin retention rule, the snapshot is retained in the
Recycle Bin instead of being immediately deleted. For more information, see Recycle Bin (p. 1854).
Delete a snapshot
To delete a snapshot, use one of the following methods.
Console
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
You will not be prevented from deleting individual snapshots in the multi-volume snapshot set. If you
delete a snapshot while it is in the pending state, only that snapshot is deleted. The other snapshots
in the multi-volume snapshot set still complete successfully.
1593
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
To copy multi-volume snapshots to another AWS Region, retrieve the snapshots using the tag you
applied to the multi-volume snapshot set when you created it. Then individually copy the snapshots to
another Region.
If you would like another account to be able to copy your snapshot, you must either modify the snapshot
permissions to allow access to that account or make the snapshot public so that all AWS accounts can
copy it. For more information, see Share an Amazon EBS snapshot (p. 1621).
For information about copying an Amazon RDS snapshot, see Copying a DB Snapshot in the Amazon RDS
User Guide.
Use cases
Prerequisites
• You can copy any accessible snapshots that have a completed status, including shared snapshots and
snapshots that you have created.
• You can copy AWS Marketplace, VM Import/Export, and Storage Gateway snapshots, but you must
verify that the snapshot is supported in the destination Region.
Considerations
• There is a limit of 20 concurrent snapshot copy requests per destination Region. If you exceed this
quota, you receive a ResourceLimitExceeded error. If you receive this error, wait for one or more of
the copy requests to complete before making a new snapshot copy request.
• User-defined tags are not copied from the source snapshot to the new snapshot. You can add user-
defined tags during or after the copy operation. For more information, see Tag your Amazon EC2
resources (p. 1894).
• Snapshots created by a snapshot copy operation have an arbitrary volume ID, such as vol-ffff or
vol-ffffffff. These arbitrary volume IDs should not be used for any purpose.
• Resource-level permissions specified for the snapshot copy operation apply only to the new snapshot.
You cannot specify resource-level permissions for the source snapshot. For an example, see Example:
Copying snapshots (p. 1427).
Pricing
• For pricing information about copying snapshots across AWS Regions and accounts, see Amazon EBS
Pricing.
• Snapshot copy operations within a single account and Region do not copy any actual data and
therefore are cost-free as long as the encryption status of the snapshot copy does not change.
1594
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• If you copy a snapshot and encrypt it to a new KMS key, a complete (non-incremental) copy is created.
This results in additional storage costs.
• If you copy a snapshot to a new Region, a complete (non-incremental) copy is created. This results in
additional storage costs. Subsequent copies of the same snapshot are incremental.
If the most recent snapshot copy was deleted, the next copy is a full copy, not an incremental copy. If
a copy is still pending when you start a another copy, the second copy starts only after the first copy
finishes.
Incremental snapshot copying reduces the time required to copy snapshots and saves on data transfer
and storage costs by not duplicating data.
We recommend that you tag your snapshots with the volume ID and creation time so that you can keep
track of the most recent snapshot copy of a volume in the destination Region or account.
To see whether your snapshot copies are incremental, check the copySnapshot (p. 1800) CloudWatch
event.
To copy an encrypted snapshot shared from another AWS account, you must have permissions to use
the snapshot and the customer master key (CMK) that was used to encrypt the snapshot. When using
an encrypted snapshot that was shared with you, we recommend that you re-encrypt the snapshot by
copying it using a KMS key that you own. This protects you if the original KMS key is compromised, or if
the owner revokes it, which could cause you to lose access to any encrypted volumes that you created
using the snapshot. For more information, see Share an Amazon EBS snapshot (p. 1621).
You apply encryption to EBS snapshot copies by setting the Encrypted parameter to true. (The
Encrypted parameter is optional if encryption by default (p. 1735) is enabled).
Optionally, you can use KmsKeyId to specify a custom key to use to encrypt the snapshot copy. (The
Encrypted parameter must also be set to true, even if encryption by default is enabled.) If KmsKeyId
is not specified, the key that is used for encryption depends on the encryption state of the source
snapshot and its ownership.
The following table describes the encryption outcomes for each possible combination of settings when
copying snapshots that you own and snapshots that are shared with you.
1595
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Encryption by Is Encrypted Source snapshot Default (no KMS Custom (KMS key
default parameter set? encryption status key specified) specified)
Encrypted Encrypted by
default KMS key
** This is a customer managed key specified for the copy action. This customer managed key is used
instead of the default customer managed key for the AWS account and Region.
Copy a snapshot
To copy a snapshot, use one of the following methods.
Console
By default, the description includes information about the source snapshot so that you can
identify a copy from the original. You can change this description as needed.
5. For Destination Region, select the Region in which to create the snapshot copy.
6. Specify the encryption status for the snapshot copy.
If the source snapshot is unencrypted and your account is not enabled for encryption by
default, encryption is optional. To encrypt the snapshot copy, for Encryption, select Encrypt
this snapshot. Then, for KMS key, select the KMS key to use to encrypt the snapshot in the
destination Region.
7. Choose Copy snapshot.
1596
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
If you attempt to copy an encrypted snapshot without having permissions to use the encryption key, the
operation fails silently. The error state is not displayed in the console until you refresh the page. You can
also check the state of the snapshot from the command line, as in the following example.
If the copy failed because of insufficient key permissions, you see the following message:
"StateMessage": "Given key ID is not accessible".
When copying an encrypted snapshot, you must have DescribeKey permissions on the default CMK.
Explicitly denying these permissions results in copy failure. For information about managing CMK keys,
see Controlling Access to Customer Master Keys.
By default, when you create a snapshot, it is stored in the Amazon EBS Snapshot Standard tier (standard
tier). Snapshots stored in the standard tier are incremental. This means that only the blocks on the
volume that have changed after your most recent snapshot are saved.
When you archive a snapshot, the incremental snapshot is converted to a full snapshot, and it is moved
from the standard tier to the Amazon EBS Snapshots Archive tier (archive tier). Full snapshots include all
of the blocks that were written to the volume at the time when the snapshot was created.
When you need to access an archived snapshot, you can restore it from the archive tier to the standard
tier, and then use it in the same way that you use any other snapshot in your account.
Amazon EBS Snapshots Archive offers up to 75 percent lower snapshot storage costs for snapshots that
you plan to store for 90 days or longer and that you rarely need to access.
Topics
• Considerations and limitations (p. 1598)
• Pricing and billing (p. 1599)
1597
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Considerations
• The minimum archive period is 90 days. If you delete or permanently restore an archived snapshot
before the minimum archive period of 90 days, you are billed for remaining days in the archive tier,
rounded to the nearest hour. For more information, see Pricing and billing (p. 1599).
• It can take up to 72 hours to restore an archived snapshot from the archive tier to the standard tier,
depending on the size of the snapshot.
• Archived snapshots are always full snapshots. A full snapshot contains all the blocks written to
the volume at the time the snapshot was created. The full snapshot will likely be larger than the
incremental snapshot from which it was created. However, if you have only one incremental snapshot
of a volume on the standard tier, the size of the full snapshot in the archive tier will be the same size
as the snapshot in standard tier. This is because the first snapshot taken of a volume is always a full
snapshot.
• Archiving is recommended for monthly, quarterly, or yearly snapshots. Archiving daily incremental
snapshots of a single volume can lead to higher costs when compared to keeping them in the standard
tier.
• When a snapshot is archived, the data of the snapshot that is referenced by other snapshots in
the snapshot lineage are retained in the standard tier. Data and storage costs associated with the
referenced data that is retained on the standard tier are allocated to the next snapshot in the lineage.
This ensures that subsequent snapshots in the lineage are not affected by the archival.
• If you delete an archived snapshot that matches a Recycle Bin retention rule, the archived snapshot is
retained in the Recycle Bin for the retention period defined in the retention rule. To use the snapshot,
you must first recover it from the Recycle Bin and then restore it from the archive tier. For more
information, see Recycle Bin (p. 1854) and Pricing and billing (p. 1599).
Limitations
• You can archive snapshots that are in the completed state only.
• You can archive only snapshots that you own in your account. To archive a snapshot that is shared with
you, first copy the snapshot to your account and then archive the snapshot copy.
• You can’t archive a snapshot of the root device volume of a registered AMI.
• You can't archive snapshots that are associated with an Amazon EBS-backed AMI.
• You can't cancel the snapshot archive or snapshot restore process after it has been started.
• You can't share archived snapshots. If you archive a snapshot that you have shared with other
accounts, the accounts with which the snapshot is shared lose access after the snapshot is archived.
• You can't copy an archived snapshot. If you need to copy an archived snapshot, you must first restore
it.
• You can't enable fast snapshot restore for an archived snapshot. Fast snapshot restore is automatically
disabled when a snapshot is archived. If you need to use fast snapshot restore, you must manually
enable it after restoring the snapshot.
• You can’t archive snapshots that were created by AWS Backup.
1598
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Snapshot restores are billed at a rate of $0.03 per GB of data restored. For example, if you restore a 100
GiB snapshot from the archive tier, you are billed one time for $3 (100 GiB * $0.03).
After the snapshot is restored to the standard tier, the snapshot is billed at the standard rate for
snapshots of $0.05 per GB-month.
The minimum archive period is 90 days. If you delete or permanently restore an archived snapshot
before the minimum archive period of 90 days, you are billed a pro-rated charge equal to the archive
tier storage charge for the remaining days, rounded to the nearest hour. For example, if you delete or
permanently restore an archived snapshot after 40 days, you are billed for the remaining 50 days of the
minimum archive period.
Note
Temporarily restoring an archived snapshot before the minimum archive period of 90 days does
not incur this charge.
Temporary restores
When you temporarily restore a snapshot, the snapshot is restored from the archive tier to the standard
tier, and a copy of the snapshot remains in the archive tier. You are billed for both the snapshot in the
standard tier and the snapshot copy in the archive tier for the duration of the temporary restore period.
When the temporarily restored snapshot is removed from the standard tier, you are no longer billed for
it, and you are billed for the snapshot in the archive tier only.
Permanent restores
When you permanently restore a snapshot, the snapshot is restored from the archive tier to the standard
tier, and the snapshot is deleted from the archive tier. You are billed for the snapshot in the standard tier
only.
Deleting snapshots
If you delete a snapshot while it is being archived, you are billed for the snapshot data that has already
been moved to the archive tier. This data is subject to the minimum archive period of 90 days and billed
accordingly upon deletion. For example, if you archive a 100 GiB snapshot, and you delete the snapshot
after only 40 GiB has been archived, you are billed $1.50 for the minimum archive period of 90 days for
the 40 GiB that has already been archived ($0.0125 per GB-month * 40 GB * (90 days * 24 hours) / (24
hours/day * 30-day month).
If you delete a snapshot while it is being restored from the archive tier, you are billed for the snapshot
restore for the full size of the snapshot (snapshot size * $0.03). For example, if you restore a 100 GiB
snapshot from the archive tier, and you delete the snapshot at any point before the snapshot restore
completes, you are billed $3 (100 GiB snapshot size * $0.03).
Recycle Bin
Archived snapshots are billed at the rate for archived snapshots while they are in the Recycle Bin.
Archived snapshots that are in the Recycle Bin are subject to the minimum archive period of 90 days and
1599
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
they are billed accordingly if they are deleted by Recycle Bin before the minimum archive period. In other
words, if a retention rule deletes an archived snapshot from the Recycle Bin before the minimum period
of 90 days, you are billed for the remaining days.
If you delete a snapshot that matches a retention rule while the snapshot is being archived, the archived
snapshot is retained in the Recycle Bin for the retention period defined in the retention rule. It is billed at
the rate for archived snapshots.
If you delete a snapshot that matches a retention rule while the snapshot is being restored, the restored
snapshot is retained in the Recycle Bin for the remainder of the retention period, and billed at the
standard snapshot rate. To use the restored snapshot, you must first recover it from the Recycle Bin.
Cost tracking
Archived snapshots appear in the AWS Cost and Usage Report with their same resource ID and Amazon
Resource Name (ARN). For more information, see the AWS Cost and Usage Report User Guide.
You can use the following usage types to identify the associated costs:
Quotas
This section describes the default quotas for archived and in-progress snapshots.
Archived 25
snapshots
per
volume
Concurrent 25
in-
progress
snapshot
archives
per
account
Concurrent 5
in-
progress
snapshot
restores
per
account
If you need more than the default limits, complete the AWS Support Center Create case form to request
a limit increase.
1600
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Topics
• Archiving the only snapshot of a volume (p. 1601)
• Archiving incremental snapshots of a single volume (p. 1601)
• Archiving full snapshots for compliance reasons (p. 1602)
• Determining the reduction in standard tier storage costs (p. 1603)
When you have only one snapshot of a volume, the snapshot is always the same size as the blocks
written to the volume at the time the snapshot was created. When you archive such a snapshot, the
snapshot in the standard tier is converted to an equivalent-sized full snapshot and it is moved from the
standard tier to the archive tier.
Archiving these snapshots can help you save with lower storage costs. If you no longer need the source
volume, you can delete the volume for further storage cost savings.
When you archive an incremental snapshot, the snapshot is converted to a full snapshot and it is moved
to the archive tier. For example, in the following image, if you archive Snap B, the snapshot is converted
to a full snapshot that is 10 GiB in size and moved to the archive tier. Similarly, if you archive Snap C, the
size of the full snapshot in the archive tier is 14 GiB.
1601
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If you are archiving snapshots to reduce your storage costs in the standard tier, you should not archive
the first snapshot in a set of incremental snapshots. These snapshots are referenced by subsequent
snapshots in the snapshot lineage. In most cases, archiving these snapshots will not reduce storage costs.
Note
You should not archive the last snapshot in a set of incremental snapshots. The last snapshot is
the most recent snapshot taken of a volume. You will need this snapshot in the standard tier if
you want to create volumes from it in the case of a volume corruption or loss.
If you archive a snapshot that contains data that is referenced by a later snapshot in the lineage, the data
storage and storage costs associated with the referenced data are allocated to the later snapshot in the
lineage. In this case, archiving the snapshot will not reduce data storage or storage costs. For example,
in the preceding image, if you archive Snap B, its 4 GiB of data is attributed to Snap C. In this case, your
overall storage costs will increase because you incur storage costs for the full version of Snap B in the
archive tier, and your storage costs for the standard tier remain unchanged.
If you archive Snap C, your standard tier storage will decrease by 4 GiB because the data is not
referenced by any other snapshots later in the lineage. And your archive tier storage will increase by 14
GiB because the snapshot is converted to a full snapshot.
1602
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
references to other snapshots in the snapshot lineage. Snapshots archived with EBS Snapshots Archive
are full snapshots, and they do not have any references to other snapshots in the lineage. Additionally,
you will likely need to retain these snapshots for compliance reasons for several years. EBS Snapshots
Archive makes it cost-effective to archive these full snapshots for long-term retention.
If you want to archive an incremental snapshot to reduce your storage costs, you should consider the
size of the full snapshot in the archive tier and the reduction in storage in the standard tier. This section
explains how to do this.
Important
The API responses are data accurate at the point-in-time when the APIs are called. API responses
can differ as the data associated with a snapshot changes as a result of changes in the snapshot
lineage.
To determine the reduction in storage and storage costs in the standard tier, use the following steps.
1. Check the size of the full snapshot. To determine the full size of the snapshot, use the list-snapshot-
blocks command. For --snapshot-id, specify the ID of the snapshot that you want to archive.
This returns information about all of the blocks in the specified snapshot. The BlockIndex of the
last block returned by the command indicates the number of blocks in the snapshot. The number of
blocks multiplied by 512 KiB, which is the snapshot block size, gives you a close approximation of
the size of the full snapshot in the archive tier (blocks * 512 KiB = full snapshot size).
For example, the following command lists the blocks for snapshot snap-01234567890abcdef.
The following is the command output, with some blocks omitted. The following output indicates
that the snapshot includes about 16,383 blocks of data. This approximates to a full snapshot size of
about 8 GiB (16,383 * 512 KiB = 7.99 GiB).
{
"VolumeSize": 8,
"Blocks": [
{
"BlockToken": "ABgBAeShfa5RwG+RiWUg2pwmnCU/
YMnV7fGMxLbCWfEBEUmmuqac5RmoyVat",
"BlockIndex": 0
},
{
"BlockToken": "ABgBATdTONyThPUAbQhbUQXsn5TGoY/
J17GfE83j9WN7siupavOTw9E1KpFh",
"BlockIndex": 1
},
{
"BlockToken": "EBEUmmuqXsn5TGoY/QwmnCU/YMnV74eKE2TSsn5TGoY/
E83j9WQhbUQXsn5T",
"BlockIndex": 4
},
.....
{
"BlockToken": "yThPUAbQhb5V8xpwmnCU/
YMnV74eKE2TSFY1sKP/4r05y47WETdTONyThPUA",
"BlockIndex": 12890
},
1603
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
{
"BlockToken":
"ABgBASHKD5V8xEbaRKdxdkZZS4eKE2TSFYlMG1sKP/4r05y47WEHqKaNPcLs",
"BlockIndex": 12906
},
{
"BlockToken": "ABgBARROGMUJo6P9X3CFHQGZNQ7av9B6vZtTTqV89QqC
+SkO0HWMlwkGXjnA",
"BlockIndex": 16383
}
],
"VolumeSize": 8,
"ExpiryTime": 1637677800.845,
"BlockSize": 524288
}
2. Find the source volume from which the snapshot that you want to archive was created. Use the
describe-snapshots command. For --snapshot-id, specify the ID of the snapshot that you want to
archive. The VolumeId response parameter indicates the ID of the source volume.
The following is the command output, which indicates that snapshot snap-09c9114207084f0d9
was created from volume vol-0f3e2c292c52b85c3.
{
"Snapshots": [
{
"Description": "",
"Tags": [],
"Encrypted": false,
VolumeId": "vol-0f3e2c292c52b85c3",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2021-11-16T08:29:49.840Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-09c9114207084f0d9"
}
]
}
3. Find all of the snapshots created from the source volume. Use the describe-snapshots command.
Specify the volume-id filter, and for the filter value, specify the volume ID from the previous step.
For example, the following command returns all snapshots created from volume
vol-0f3e2c292c52b85c3.
1604
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The following is the command output, which indicates that three snapshots were created from
volume vol-0f3e2c292c52b85c3.
{
"Snapshots": [
{
"Description": "",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-0f3e2c292c52b85c3",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2021-11-14T08:57:39.300Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-08ca60083f86816b0"
},
{
"Description": "",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-0f3e2c292c52b85c3",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2021-11-15T08:29:49.840Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-09c9114207084f0d9"
},
{
"Description": "01",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-0f3e2c292c52b85c3",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2021-11-16T07:50:08.042Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-024f49fe8dd853fa8"
}
]
}
4. Using the output from the previous command, sort the snapshots by their creation times, from
earliest to newest. The StartTime response parameter for each snapshot indicates its creation
time, in UTC time format.
For example, the snapshots returned in the previous step arranged by creation time, from earliest to
newest, is as follows:
1. snap-08ca60083f86816b0 (earliest – created before the snapshot that you want to archive)
2. snap-09c9114207084f0d9 (the snapshot to archive)
3. snap-024f49fe8dd853fa8 (newest – created after the snapshot that you that want to archive)
5. Identify the snapshots that were created immediately before and after the snapshot that
you want to archive. In this case, you want to archive snapshot snap-09c9114207084f0d9,
which was the second incremental snapshot created in the set of three snapshots.
Snapshot snap-08ca60083f86816b0 was created immediately before, and snapshot
snap-024f49fe8dd853fa8 was created immediately after.
1605
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
6. Find the unreferenced data in the snapshot that you want to archive. First, find the blocks that are
different between the snapshot that was created immediately before the snapshot that you want
to archive, and the snapshot that you want to archive. Use the list-changed-blocks command. For
--first-snapshot-id, specify the ID of the snapshot that was created immediately before the
snapshot that you want to archive. For --second-snapshot-id, specify the ID of the snapshot
that you want to archive.
For example, the following command shows the block indexes for the blocks that are different
between snapshot snap-08ca60083f86816b0 (the snapshot created before the snapshot you
want to archive), and snapshot snap-09c9114207084f0d9 (the snapshot you want to archive).
The following shows the command output, with some blocks omitted.
{
"BlockSize": 524288,
"ChangedBlocks": [
{
"FirstBlockToken": "ABgBAX6y
+WH6Rm9y5zq1VyeTCmEzGmTT0jNZG1cDirFq1rOVeFbWXsH3W4z/",
"SecondBlockToken": "ABgBASyx0bHHBnTERu
+9USLxYK/81UT0dbHIUFqUjQUkwTwK5qkjP8NSGyNB",
"BlockIndex": 4
},
{
"FirstBlockToken": "ABgBAcfL
+EfmQmlNgstqrFnYgsAxR4SDSO4LkNLYOOChGBWcfJnpn90E9XX1",
"SecondBlockToken": "ABgBAdX0mtX6aBAt3EBy+8jFCESMpig7csKjbO2Ocd08m2iNJV2Ue
+cRwUqF",
"BlockIndex": 5
},
{
"FirstBlockToken": "ABgBAVBaFJmbP/eRHGh7vnJlAwyiyNUi3MKZmEMxs2wC3AmM/
fc6yCOAMb65",
"SecondBlockToken":
"ABgBAdewWkHKTcrhZmsfM7GbaHyXD1Ctcn2nppz4wYItZRmAo1M72fpXU0Yv",
"BlockIndex": 13
},
{
"FirstBlockToken": "ABgBAQGxwuf6z095L6DpRoVRVnOqPxmx9r7Wf6O+i
+ltZ0dwPpGN39ijztLn",
"SecondBlockToken": "ABgBAUdlitCVI7c6hGsT4ckkKCw6bMRclnV
+bKjViu/9UESTcW7CD9w4J2td",
"BlockIndex": 14
},
{
"FirstBlockToken":
"ABgBAZBfEv4EHS1aSXTXxSE3mBZG6CNeIkwxpljzmgSHICGlFmZCyJXzE4r3",
"SecondBlockToken":
"ABgBAVWR7QuQQB0AP2TtmNkgS4Aec5KAQVCldnpc91zBiNmSfW9ouIlbeXWy",
"BlockIndex": 15
},
.....
{
"SecondBlockToken": "ABgBAeHwXPL+z3DBLjDhwjdAM9+CPGV5VO5Q3rEEA
+ku50P498hjnTAgMhLG",
1606
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"BlockIndex": 13171
},
{
"SecondBlockToken":
"ABgBAbZcPiVtLx6U3Fb4lAjRdrkJMwW5M2tiCgIp6ZZpcZ8AwXxkjVUUHADq",
"BlockIndex": 13172
},
{
"SecondBlockToken": "ABgBAVmEd/pQ9VW9hWiOujOAKcauOnUFCO
+eZ5ASVdWLXWWC04ijfoDTpTVZ",
"BlockIndex": 13173
},
{
"SecondBlockToken": "ABgBAT/jeN7w
+8ALuNdaiwXmsSfM6tOvMoLBLJ14LKvavw4IiB1d0iykWe6b",
"BlockIndex": 13174
},
{
"SecondBlockToken": "ABgBAXtGvUhTjjUqkwKXfXzyR2GpQei/
+pJSG/19ESwvt7Hd8GHaUqVs6Zf3",
"BlockIndex": 13175
}
],
"ExpiryTime": 1637648751.813,
"VolumeSize": 8
}
Next, use the same command to find blocks that are different between the snapshot that you want
to archive and the snapshot that was created immediately after it. For --first-snapshot-id,
specify the ID of the snapshot that you want to archive. For --second-snapshot-id, specify the
ID of the snapshot that was created immediately after the snapshot that you want to archive.
For example, the following command shows the block indexes of the blocks that are different
between snapshot snap-09c9114207084f0d9 (the snapshot that you want to archive) and
snapshot snap-024f49fe8dd853fa8 (the snapshot created after the snapshot that you want to
archive).
The following shows the command output, with some blocks omitted.
{
"BlockSize": 524288,
"ChangedBlocks": [
{
"FirstBlockToken": "ABgBAVax0bHHBnTERu
+9USLxYK/81UT0dbSnkDk0gqwRFSFGWA7HYbkkAy5Y",
"SecondBlockToken":
"ABgBASEvi9x8Om7Htp37cKG2NT9XUzEbLHpGcayelomSoHpGy8LGyvG0yYfK",
"BlockIndex": 4
},
{
"FirstBlockToken": "ABgBAeL0mtX6aBAt3EBy+8jFCESMpig7csfMrI4ufnQJT3XBm/
pwJZ1n2Uec",
"SecondBlockToken": "ABgBAXmUTg6rAI
+v0LvekshbxCVpJjWILvxgC0AG0GQBEUNRVHkNABBwXLkO",
1607
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"BlockIndex": 5
},
{
"FirstBlockToken":
"ABgBATKwWkHKTcrhZmsfM7GbaHyXD1CtcnjIZv9YzisYsQTMHfTfh4AhS0s2",
"SecondBlockToken": "ABgBAcmiPFovWgXQio
+VBrxOqGy4PKZ9SAAHaZ2HQBM9fQQU0+EXxQjVGv37",
"BlockIndex": 13
},
{
"FirstBlockToken":
"ABgBAbRlitCVI7c6hGsT4ckkKCw6bMRclnARrMt1hUbIhFnfz8kmUaZOP2ZE",
"SecondBlockToken": "ABgBAXe935n544+rxhJ0INB8q7pAeoPZkkD27vkspE/
qKyvOwpozYII6UNCT",
"BlockIndex": 14
},
{
"FirstBlockToken": "ABgBAd+yxCO26I
+1Nm2KmuKfrhjCkuaP6LXuol3opCNk6+XRGcct4suBHje1",
"SecondBlockToken": "ABgBAcPpnXz821NtTvWBPTz8uUFXnS8jXubvghEjZulIjHgc
+7saWys77shb",
"BlockIndex": 18
},
.....
{
"SecondBlockToken": "ABgBATni4sDE5rS8/a9pqV03lU/lKCW
+CTxFl3cQ5p2f2h1njpuUiGbqKGUa",
"BlockIndex": 13190
},
{
"SecondBlockToken": "ABgBARbXo7zFhu7IEQ/9VMYFCTCtCuQ+iSlWVpBIshmeyeS5FD/
M0i64U+a9",
"BlockIndex": 13191
},
{
"SecondBlockToken": "ABgBAZ8DhMk+rROXa4dZlNK45rMYnVIGGSyTeiMli/sp/
JXUVZKJ9sMKIsGF",
"BlockIndex": 13192
},
{
"SecondBlockToken":
"ABgBATh6MBVE904l6sqOC27s1nVntFUpDwiMcRWGyJHy8sIgGL5yuYXHAVty",
"BlockIndex": 13193
},
{
"SecondBlockToken":
"ABgBARuZykaFBWpCWrJPXaPCneQMbyVgnITJqj4c1kJWPIj5Gn61OQyy+giN",
"BlockIndex": 13194
}
],
"ExpiryTime": 1637692677.286,
"VolumeSize": 8
}
7. Compare the output returned by both commands in the previous step. If the same block index
appears in both command outputs, it indicates that the block contains unreferenced data.
For example, the command output in the previous step indicates that blocks 4, 5, 13, and 14 are
unique to snapshot snap-09c9114207084f0d9 and that they are not referenced by any other
snapshots in the snapshot lineage.
To determine the reduction in standard tier storage, multiply the number of blocks that appear in
both command outputs by 512 KiB, which is the snapshot block size.
1608
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
For example, if 9,950 block indexes appear in both command outputs, it indicates that you will
decrease standard tier storage by around 4.85 GiB (9,950 blocks * 512 KiB = 4.85 GiB).
8. Determine the storage costs for storing the unreferenced blocks in the standard tier for 90 days.
Compare this value with the cost of storing the full snapshot, described in from step 1, in the
archive tier. You can determine your costs savings by comparing the values, assuming that you do
not restore the full snapshot from the archive tier during the minimum 90-day period. For more
information, see Pricing and billing (p. 1599).
• ec2:DescribeSnapshotTierStatus
• ec2:ModifySnapshotTier
• ec2:RestoreSnapshotTier
To archive and restore encrypted snapshots, the following additional AWS KMS permissions are required.
• kms:CreateGrant
• kms:Decrypt
• kms:DescribeKey
The following is an example IAM policy that gives IAM users permission to archive, restore, and view
encrypted and unencrypted snapshots. It includes the ec2:DescribeSnapshots permission for
console users. If some permissions are not needed, you can remove them from the policy.
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant. Instead,
use the kms:GrantIsForAWSResource condition key to allow the user to create grants on the
KMS key only when the grant is created on the user's behalf by an AWS service, as shown in the
following example.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeSnapshotTierStatus",
"ec2:ModifySnapshotTier",
"ec2:RestoreSnapshotTier",
"ec2:DescribeSnapshots",
"kms:CreateGrant",
"kms:Decrypt",
"kms:DescribeKey"
],
"Resource": "*",
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": true
1609
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
}
}
}]
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
Archive a snapshot
You can archive any snapshot that is in the completed state and that you own in your account. You can't
archive snapshots that are in the pending or error states, or snapshots that are shared with you. For
more information, see Considerations and limitations (p. 1598).
Archived snapshots retain their snapshot ID, encryption status, AWS Identity and Access Management
(IAM) permissions, owner information, and resource tags. However, fast snapshot restore and snapshot
sharing are automatically disabled after the snapshot is archived.
You can continue to use the snapshot while the archive is in process. As soon as the snapshot tiering
status reaches the archival-complete state, you can no longer use the snapshot.
Console
To archive a snapshot
1610
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
AWS CLI
To archive a snapshot
Use the modify-snapshot-tier AWS CLI command. For --snapshot-id, specify the ID of the
snapshot to archive. For --storage-tier, specify archive.
The following is the command output. The TieringStartTime response parameter indicates
the date and time at which the archive process was started, in UTC time format (YYYY-MM-
DDTHH:MM:SSZ).
{
"SnapshotId": "snap-01234567890abcedf",
"TieringStartTime": "2021-09-15T16:44:37.574Z"
}
When you restore a snapshot, you can choose to restore it permanently or temporarily.
If you restore a snapshot permanently, the snapshot is moved from the archive tier to the standard tier
permanently. The snapshot remains restored and ready for use until you manually re-archive it or you
manually delete it. When you permanently restore a snapshot, the snapshot is removed from the archive
tier.
If you restore a snapshot temporarily, the snapshot is copied from the archive tier to the standard tier
for a restore period that you specify. The snapshot remains restored and ready for use for the restore
period only. During the restore period, a copy of the snapshot remains in the archive tier. After the period
expires, the snapshot is automatically removed from the standard tier. You can increase or decrease the
restore period or change the restore type to permanent at any time during the restore period. For more
information, see Modify the restore period or restore type for a temporarily restored snapshot (p. 1613).
You can restore an archived snapshot using one of the following methods.
Console
1611
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
3. Specify the type of restore to perform. For Restore type, do one of the following:
AWS CLI
Use the restore-snapshot-tier AWS CLI command. For --snapshot-id, specify the ID of the
snapshot to restore, and include the --permanent-restore option.
{
"SnapshotId": "snap-01234567890abcedf",
"IsPermanentRestore": true
}
Use the restore-snapshot-tier AWS CLI command. Omit the --permanent-restore option. For --
snapshot-id, specify the ID of the snapshot to restore, and for --temporary-restore-days,
specify the number of days for which to restore the snapshot.
{
"SnapshotId": "snap-01234567890abcedf",
"RestoreDuration": 5,
"IsPermanentRestore": false
1612
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Modify the restore period or restore type for a temporarily restored snapshot
When you restore a snapshot temporarily, you must specify the number of days for which the snapshot
is to remain restored in your account. After the restore period expires, the snapshot is automatically
removed from the standard tier.
You can change the restore period for a temporarily restored snapshot at any time.
You can choose to either increase or decrease the restore period, or you can change the restore type from
temporary to permanent.
If you change the restore period, the new restore period is effective from the current date. For example,
if you specify a new restore period of 5 days, the snapshot will remain restored for five days from the
current date.
Note
You can end a temporary restore early by setting the restore period to 1 day.
If you change the restore type from temporary to permanent, the snapshot copy is deleted from the
archive tier, and the snapshot remains available in your account until you manually re-archive it or delete
it.
You can modify the restore period for a snapshot using one of the following methods.
Console
AWS CLI
Use the restore-snapshot-tier AWS CLI command. For --snapshot-id, specify the ID of the
snapshot that you previously temporarily restored. To change the restore type from temporary to
permanent, specify --permanent-restore and omit --temporary-restore-days. To increase
or decrease the restore period, omit --permanent-restore and for --temporary-restore-
days, specify the new restore period in days.
The following command changes the restore period for snapshot snap-01234567890abcedf to 10
days.
1613
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
--snapshot-id snap-01234567890abcedf
--temporary-restore-days 10
{
"SnapshotId": "snap-01234567890abcedf",
"RestoreDuration": 10,
"IsPermanentRestore": false
}
The following command changes the restore type for snapshot snap-01234567890abcedf from
temporary to permanent.
{
"SnapshotId": "snap-01234567890abcedf",
"IsPermanentRestore": true
}
You can view storage tier information for snapshots using one of the following methods.
Console
• Last tier change started on — The date and time when the last archive or restore was started.
• Tier change progress — The progress of the last archive or restore action, as a percentage.
• Storage tier — The storage tier for the snapshot. Always archive for archived snapshots,
and standard for snapshots stored on the standard tier, including temporarily restored
snapshots.
• Tiering status — The status of the last archive or restore action.
• Archive completed on — The date and time when the archive completed.
• Temporary restore expires on — The date and time when a temporarily restored snapshot is
set to expire.
AWS CLI
1614
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Use the describe-snapshot-tier-status AWS CLI command. Specify the snapshot-id filter, and for
the filter value, specify the snapshot ID. Alternatively, to view all archived snapshots, omit the filter.
• Status — The status of the snapshot. Always completed for archived snapshots. Only snapshots
that are in the completed state can be archived.
• LastTieringStartTime — The date and time that the archival process started, in UTC time
format (YYYY-MM-DDTHH:MM:SSZ).
• LastTieringOperationState — The current state of the archival process. Possible states
include: archival-in-progress | archival-completed | archival-failed | permanent-
restore-in-progress | permanent-restore-completed | permanent-restore-failed
| temporary-restore-in-progress | temporary-restore-completed | temporary-
restore-failed
• LastTieringProgress — The progress of the snapshot archival process, as a percentage.
• StorageTier — The storage tier for the snapshot. Always archive for archived snapshots, and
standard for snapshots stored on the standard tier, including temporarily restored snapshots.
• ArchivalCompleteTime — The date and time that the archival process completed, in UTC time
format (YYYY-MM-DDTHH:MM:SSZ).
Example
{
"SnapshotTierStatuses": [
{
"Status": "completed",
"ArchivalCompleteTime": "2021-09-15T17:33:16.147Z",
"LastTieringProgress": 100,
"Tags": [],
"VolumeId": "vol-01234567890abcedf",
"LastTieringOperationState": "archival-completed",
"StorageTier": "archive",
"OwnerId": "123456789012",
"SnapshotId": "snap-01234567890abcedf",
"LastTieringStartTime": "2021-09-15T16:44:37.574Z"
}
]
}
Use the describe-snapshot AWS CLI command. For --snapshot-ids, specify the ID of the snapshot
view.
1615
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The following is the command output. The StorageTier response parameter indicates whether the
snapshot is currently archived. archive indicates that the snapshot is currently archived and stored
in the archive tier, and standard indicates that the snapshot is currently not archived and that it is
stored in the standard tier.
In the following example output, only Snap A is archived. Snap B and Snap C are not archived.
Additionally, the RestoreExpiryTime response parameter is returned only for snapshots that are
temporarily restored from the archive. It indicates when temporarily restored snapshots are to be
automatically removed from the standard tier. It is not returned for snapshots that are permanently
restored.
In the following example output, Snap C is temporarily restored, and it will be automatically
removed from the standard tier at 2021-09-19T21:00:00.000Z (September 19, 2021 at 21:00 UTC).
{
"Snapshots": [
{
"Description": "Snap A",
"Encrypted": false,
"VolumeId": "vol-01234567890aaaaaa",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2021-09-07T21:00:00.000Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-01234567890aaaaaa",
"StorageTier": "archive",
"Tags": []
},
{
"Description": "Snap B",
"Encrypted": false,
"VolumeId": "vol-09876543210bbbbbb",
"State": "completed",
"VolumeSize": 10,
"StartTime": "2021-09-14T21:00:00.000Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-09876543210bbbbbb",
"StorageTier": "standard",
"RestoreExpiryTime": "2019-09-19T21:00:00.000Z",
"Tags": []
},
{
"Description": "Snap C",
"Encrypted": false,
"VolumeId": "vol-054321543210cccccc",
"State": "completed",
"VolumeSize": 12,
"StartTime": "2021-08-01T21:00:00.000Z",
"Progress": "100%",
"OwnerId": "123456789012",
"SnapshotId": "snap-054321543210cccccc",
"StorageTier": "standard",
"Tags": []
}
]
1616
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
To view only snapshots that are stored in the archive tier or the standard tier
Use the describe-snapshot AWS CLI command. Include the --filter option, for the filter name,
specify storage-tier, and for the filter value specify either archive or standard.
The following is an example of an event that is emitted when a snapshot archive action succeeds.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "archiveSnapshot",
"result": "succeeded",
"cause": "",
"request-id": "123456789",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
The following is an example of an event that is emitted when a snapshot archive action fails.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
1617
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
],
"detail": {
"event": "archiveSnapshot",
"result": "failed",
"cause": "Source snapshot ID is not valid",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
}
The following is an example of an event that is emitted when a permanent restore action succeeds.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "permanentRestoreSnapshot",
"result": "succeeded",
"cause": "",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-10-45T15:30:00Z"
}
}
The following is an example of an event that is emitted when a permanent restore action fails.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "permanentRestoreSnapshot",
"result": "failed",
"cause": "Source snapshot ID is not valid",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
}
1618
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The following is an example of an event that is emitted when a temporary restore action succeeds.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "temporaryRestoreSnapshot",
"result": "succeeded",
"cause": "",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"restoreExpiryTime": "2021-06-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
}
The following is an example of an event that is emitted when a temporary restore action fails.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "temporaryRestoreSnapshot",
"result": "failed",
"cause": "Source snapshot ID is not valid",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
}
• restoreExpiry — Emitted when the restore period for a temporarily restored snapshot expires.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
1619
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"time": "2021-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
],
"detail": {
"event": "restoryExpiry",
"result": "succeeded",
"cause": "",
"request-id": "1234567890",
"snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
"startTime": "2021-05-25T13:12:22Z",
"endTime": "2021-05-45T15:30:00Z",
"recycleBinExitTime": "2021-10-45T15:30:00Z"
}
}
Console
AWS CLI
You can use one of the following commands. For more information about these command line
interfaces, see Access Amazon EC2 (p. 3).
The following command describes the snapshots with the tag Stack=production.
The following command describes the snapshots created from the specified volume.
1620
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
With the AWS CLI, you can use JMESPath to filter results using expressions. For example, the
following command displays the IDs of all snapshots created by your AWS account (represented by
123456789012) before the specified date (represented by 2020-03-31). If you do not specify the
owner, the results include all public snapshots.
The following command displays the IDs of all snapshots created in the specified date range.
Topics
• Before you share a snapshot (p. 1621)
• Share a snapshot (p. 1621)
• Share a KMS key (p. 1623)
• View snapshots that are shared with you (p. 1624)
• Use snapshots that are shared with you (p. 1625)
• Determine the use of snapshots that you share (p. 1625)
• Snapshots are constrained to the Region in which they were created. To share a snapshot with another
Region, copy the snapshot to that Region and then share the copy. For more information, see Copy an
Amazon EBS snapshot (p. 1593).
• You can't share snapshots that are encrypted with the default AWS managed key. You can only share
snapshots that are encrypted with a customer managed key. For more information, see Creating Keys
in the AWS Key Management Service Developer Guide.
• You can share only unencrypted snapshots publicly.
• When you share an encrypted snapshot, you must also share the customer managed key used to
encrypt the snapshot. For more information, see Share a KMS key (p. 1623).
Share a snapshot
You can share a snapshot using one of the methods described in the section.
1621
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Console
To share a snapshot
AWS CLI
The permissions for a snapshot are specified using the createVolumePermission attribute of the
snapshot. To make a snapshot public, set the group to all. To share a snapshot with a specific AWS
account, set the user to the ID of the AWS account.
1622
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Users of your shared customer managed key who are accessing encrypted snapshots must be granted
permissions to perform the following actions on the key:
• kms:DescribeKey
• kms:CreateGrant
• kms:GenerateDataKey
• kms:ReEncrypt
• kms:Decrypt
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant. Instead,
use the kms:GrantIsForAWSResource condition key to allow the user to create grants on the
KMS key only when the grant is created on the user's behalf by an AWS service.
For more information about controlling access to a customer managed key, see Using key policies in
AWS KMS in the AWS Key Management Service Developer Guide.
Use either the policy view or the default view, depending on which view you can access, to add one
or more AWS account IDs to the policy, as follows:
• (Policy view) Choose Edit. Add one or more AWS account IDs to the following statements:
"Allow use of the key" and "Allow attachment of persistent resources".
Choose Save changes. In the following example, the AWS account ID 444455556666 is added
to the policy.
1623
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• (Default view) Scroll down to Other AWS accounts. Choose Add other AWS accounts and enter
the AWS account ID as prompted. To add another account, choose Add another AWS account
and enter the AWS account ID. When you have added all AWS accounts, choose Save changes.
Console
• Private snapshots — To view only snapshots that are shared with you privately.
• Public snapshots — To view only snapshots that are shared with you publicly.
AWS CLI
1624
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Locate the shared snapshot by ID or description. For more information, see View snapshots that are
shared with you (p. 1624). You can use this snapshot as you would any other snapshot that you own in
your account. For example, you can create a volume from the snapshot or copy it to a different Region.
Locate the shared snapshot by ID or description. For more information, see View snapshots that are
shared with you (p. 1624). Create a copy of the shared snapshot in your account, and encrypt the copy
with a KMS key that you own. You can then use the copy to create volumes or you can copy it to different
Regions.
For more information about using CloudTrail, see Log Amazon EC2 and Amazon EBS API calls with AWS
CloudTrail (p. 1170).
You can restore a resource from the Recycle Bin at any time before its retention period expires. After you
restore a resource from the Recycle Bin, the resource is removed from the Recycle Bin and you can use
it in the same way that you use any other resource of that type in your account. If the retention period
expires and the resource is not restored, the resource is permanently deleted from the Recycle Bin and it
is no longer available for recovery.
Snapshots in the Recycle Bin are billed at the same rate as regular snapshots in your account. There are
no additional charges for using Recycle Bin and retention rules. For more information, see Amazon EBS
pricing.
Topics
• Permissions for working with snapshots in the Recycle Bin (p. 1625)
• View snapshots in the Recycle Bin (p. 1627)
• Restore snapshots from the Recycle Bin (p. 1627)
To view and recover snapshots that are in the Recycle Bin, users must have the following permissions:
1625
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• ec2:ListSnapshotsInRecycleBin
• ec2:RestoreSnapshotFromRecycleBin
To manage tags for snapshots in the Recycle Bin, users need the following additional permissions.
• ec2:CreateTags
• ec2:DeleteTags
To use the Recycle Bin console, users need the ec2:DescribeTags permission.
The following is an example IAM policy. It includes the ec2:DescribeTags permission for console
users, and it includes the ec2:CreateTags and ec2:DeleteTags permissions for managing tags. If the
permissions are not needed, you can remove them from the policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:ListSnapshotsInRecycleBin",
"ec2:RestoreSnapshotFromRecycleBin"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:DeleteTags",
"ec2:DescribeTags"
],
"Resource": "arn:aws:ec2:Region:account-id:snapshot/*"
},
]
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
For more information about the permissions needed to use Recycle Bin, see Permissions for working with
Recycle Bin and retention rules (p. 1858).
1626
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You can view the snapshots in the Recycle Bin using one of the following methods.
AWS CLI
Use the list-snapshots-in-recycle-bin AWS CLI command. Include the --snapshot-id option to
view a specific snapshot. Or omit the --snapshot-id option to view all snapshots in the Recycle
Bin.
Example output:
{
"SnapshotRecycleBinInfo": [
{
"Description": "Monthly data backup snapshot",
"RecycleBinEnterTime": "2021-12-01T13:00:00.000Z",
"RecycleBinExitTime": "2021-12-15T13:00:00.000Z",
"VolumeId": "vol-abcdef09876543210",
"SnapshotId": "snap-01234567890abcdef"
}
]
}
1627
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
use, and it is removed from the Recycle Bin. You can use a restored snapshot in the same way that you
use any other snapshot in your account.
You can restore a snapshot from the Recycle Bin using one of the following methods.
AWS CLI
To restore a deleted snapshot from the Recycle Bin using the AWS CLI
Use the restore-snapshot-from-recycle-bin AWS CLI command. For --snapshot-id, specify the ID
of the snapshot to restore.
For example, the following command restores snapshot snap-01234567890abcdef from the
Recycle Bin.
By default, snapshots of EBS volumes on an Outpost are stored in Amazon S3 in the Region of the
Outpost. You can also use Amazon EBS local snapshots on Outposts to store snapshots of volumes on
an Outpost locally in Amazon S3 on the Outpost itself. This ensures that the snapshot data resides on
the Outpost, and on your premises. In addition, you can use AWS Identity and Access Management (IAM)
policies and permissions to set up data residency enforcement policies to ensue that snapshot data does
not leave the Outpost. This is especially useful if you reside in a country or region that is not yet served
by an AWS Region and that has data residency requirements.
This topic provides information about working with Amazon EBS local snapshots on Outposts. For more
information about Amazon EBS snapshots and about working with snapshots in an AWS Region, see
Amazon EBS snapshots (p. 1569).
For more information about AWS Outposts, see AWS Outposts Features and the AWS Outposts User
Guide. For pricing information, see AWS Outposts pricing.
Topics
• Frequently asked questions (p. 1629)
• Prerequisites (p. 909)
• Considerations (p. 330)
1628
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
By default, Amazon EBS snapshots of volumes on an Outpost are stored in Amazon S3 in the Region
of the Outpost. If the Outpost is provisioned with Amazon S3 on Outposts, you can choose to store
the snapshots locally on the Outpost itself. Local snapshots are incremental, which means that only
the blocks of the volume that have changed after your most recent snapshot are saved. You can use
these snapshots to restore a volume on the same Outpost as the snapshot at any time. For more
information about Amazon EBS snapshots, see Amazon EBS snapshots (p. 1569).
2. Why should I use local snapshots?
Snapshots are a convenient way of backing up your data. With local snapshots, all of your snapshot
data is stored locally on the Outpost. This means that it does not leave your premises. This is
especially useful if you reside in a country or region that is not yet served by an AWS Region and that
has residency requirements.
Additionally, using local snapshots can help to reduce the bandwidth used for communication
between the Region and the Outpost in bandwidth constrained environments.
3. How do I enforce snapshot data residency on Outposts?
You can use AWS Identity and Access Management (IAM) policies to control the permissions that
principals (AWS accounts, IAM users, and IAM roles) have when working with local snapshots and
to enforce data residency. You can create a policy that prevents principals from creating snapshots
from Outpost volumes and instances and storing the snapshots in an AWS Region. Currently, copying
snapshots and images from an Outpost to a Region is not supported. For more information, see
Controlling access with IAM (p. 1631).
4. Are multi-volume, crash-consistent local snapshots supported?
Yes, you can create multi-volume, crash-consistent local snapshots from instances on an Outpost.
5. How do I create local snapshots?
You can create snapshots manually using the AWS Command Line Interface (AWS CLI) or the
Amazon EC2 console. For more information see, Working with local snapshots (p. 1632). You can
also automate the lifecycle of local snapshots using Amazon Data Lifecycle Manager. For more
information see, Automate snapshots on an Outpost (p. 1637).
6. Can I create, use, or delete local snapshots if my Outpost loses connectivity to its Region?
No. The Outpost must have connectivity with its Region as the Region provides the access,
authorization, logging, and monitoring services that are critical for your snapshots' health. If there
is no connectivity, you can't create new local snapshots, create volumes or launch instances from
existing local snapshots, or delete local snapshots.
7. How quickly is Amazon S3 storage capacity made available after deleting local snapshots?
Amazon S3 storage capacity becomes available within 72 hours after deleting local snapshots and
the volumes that reference them.
8. How can I ensure that I do not run out of Amazon S3 capacity on my Outpost?
We recommend that you use Amazon CloudWatch alarms to monitor your Amazon S3 storage
capacity, and delete snapshots and volumes that you no longer need to avoid running out of
storage capacity. If you are using Amazon Data Lifecycle Manager to automate the lifecycle of local
snapshots, ensure that your snapshot retention policies do not retain snapshots for longer than is
needed.
1629
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
If you run out of local Amazon S3 capacity on your Outposts, Amazon Data Lifecycle Manager
will not be able to successfully create local snapshots on the Outposts. Amazon Data Lifecycle
Manager will attempt to create the local snapshots on the Outposts, but the snapshots immediately
transition to the error state and they are eventually deleted by Amazon Data Lifecycle Manager.
We recommend that you use the SnapshotsCreateFailed Amazon CloudWatch metric to monitor
your snapshot lifecycle policies for snapshot creation failures. For more information, see Monitor
your policies using Amazon CloudWatch (p. 1713).
10. Can I use local snapshots and AMIs backed by local snapshots with Spot Instances and Spot Fleet?
No, you can't use local snapshots or AMIs backed by local snapshots to launch Spot Instances or a
Spot Fleet.
11. Can I use local snapshots and AMIs backed by local snapshots with Amazon EC2 Auto Scaling?
Yes, you can use local snapshots and AMIs backed by local snapshots to launch Auto Scaling groups
in a subnet that is on the same Outpost as the snapshots. The Amazon EC2 Auto Scaling group
service-linked role must have permission to use the KMS key used to encrypt the snapshots.
You can't use local snapshots or AMIs backed by local snapshots to launch Auto Scaling groups in an
AWS Region.
Prerequisites
To store snapshots on an Outpost, you must have an Outpost that is provisioned with Amazon S3 on
Outposts. For more information about Amazon S3 on Outposts, see Using Amazon S3 on Outposts in the
Amazon Simple Storage Service User Guide.
Considerations
Keep the following in mind when working with local snapshots.
• Outposts must have connectivity to their AWS Region to use local snapshots.
• Snapshot metadata is stored in the AWS Region associated with the Outpost. This does not include any
snapshot data.
• Snapshots stored on Outposts are encrypted by default. Unencrypted snapshots are not supported.
Snapshots that are created on an Outpost and snapshots that are copied to an Outpost are encrypted
using the default KMS key for the Region or a different KMS key that you specify at the time of the
request.
• When you create a volume on an Outpost from a local snapshot, you cannot re-encrypt the volume
using a different KMS key. Volumes created from local snapshots must be encrypted using the same
KMS key as the source snapshot.
• After you delete local snapshots from an Outpost, the Amazon S3 storage capacity used by the
deleted snapshots becomes available within 72 hours. For more information, see Delete local
snapshots (p. 1637).
• You can't export local snapshots from an Outpost.
• You can't enable fast snapshot restore for local snapshots.
• EBS direct APIs are not supported with local snapshots.
• You can't copy local snapshots or AMIs from an Outpost to an AWS Region, from one Outpost to
another, or within an Outpost. However, you can copy snapshots from an AWS Region to an Outpost.
For more information, see Copy snapshots from an AWS Region to an Outpost (p. 1635).
• When copying a snapshot from an AWS region to an Outpost, the data is transferred over the service
link. Copying multiple snapshots simultaneously could impact other services running on the Outpost.
• You can't share local snapshots.
1630
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• You must use IAM policies to ensure that your data residency requirements are met. For more
information, see Controlling access with IAM (p. 1631).
• Local snapshots are incremental backups. Only the blocks in the volume that have changed after your
most recent snapshot are saved. Each local snapshot contains all of the information that is needed to
restore your data (from the moment when the snapshot was taken) to a new EBS volume. For more
information, see How snapshots work (p. 1570).
• You can’t use IAM policies to enforce data residency for CopySnapshot and CopyImage actions.
Topics
• Enforce data residency for snapshots (p. 1631)
• Prevent principals from deleting local snapshots (p. 1632)
The following example policy prevents all principals from creating snapshots from volumes
and instances on Outpost arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef and storing the snapshot data in an AWS Region. Principals can still create local
snapshots. This policy ensures that all snapshots remain on the Outpost.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots"
],
"Resource": "arn:aws:ec2:us-east-1::snapshot/*",
"Condition": {
"StringEquals": {
"ec2:SourceOutpostArn": "arn:aws:outposts:us-
east-1:123456789012:outpost/op-1234567890abcdef0"
},
"Null": {
"ec2:OutpostArn": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots"
],
"Resource": "*"
}
1631
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
]
}
The following example policy prevents all principals from deleting local snapshots that are stored on
Outpost arn:aws:outposts:us-east-1:123456789012:outpost/op-1234567890abcdef0.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:DeleteSnapshot"
],
"Resource": "arn:aws:ec2:us-east-1::snapshot/*",
"Condition": {
"StringEquals": {
"ec2:OutpostArn": "arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef0"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:DeleteSnapshot"
],
"Resource": "*"
}
]
}
Topics
• Rules for storing snapshots (p. 1632)
• Create local snapshots from volumes on an Outpost (p. 1633)
• Create multi-volume local snapshots from instances on an Outpost (p. 1634)
• Create AMIs from local snapshots (p. 1635)
• Copy snapshots from an AWS Region to an Outpost (p. 1635)
• Copy AMIs from an AWS Region to an Outpost (p. 1636)
• Create volumes from local snapshots (p. 1637)
• Launch instances from AMIs backed by local snapshots (p. 1637)
• Delete local snapshots (p. 1637)
• Automate snapshots on an Outpost (p. 1637)
• If the most recent snapshot of a volume is stored on an Outpost, then all successive snapshots must be
stored on the same Outpost.
1632
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• If the most recent snapshot of a volume is stored in an AWS Region, then all successive snapshots must
be stored in the same Region. To start creating local snapshots from that volume, do the following:
For the new volume on the Outpost, the next snapshot can be stored on the Outpost or in the AWS
Region. All successive snapshots must then be stored in that same location.
• Local snapshots, including snapshots created on an Outpost and snapshots copied to an Outpost from
an AWS Region, can be used only to create volumes on the same Outpost.
• If you create a volume on an Outpost from a snapshot in a Region, then all successive snapshots of
that new volume must be in the same Region.
• If you create a volume on an Outpost from a local snapshot, then all successive snapshots of that new
volume must be on the same Outpost.
You can create local snapshots from volumes on your Outpost. You can choose to store the snapshots on
the same Outpost as the source volume, or in the Region for the Outpost.
Local snapshots can be used to create volumes on the same Outpost only.
You can create local snapshots from volumes on an Outpost using one of the following methods.
Console
Command line
Use the create-snapshot command. Specify the ID of the volume from which to create the snapshot,
and the ARN of the destination Outpost on which to store the snapshot. If you omit the Outpost
ARN, the snapshot is stored in the AWS Region for the Outpost.
1633
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You can create crash-consistent multi-volume local snapshots from instances on your Outpost. You
can choose to store the snapshots on the same Outpost as the source instance, or in the Region for the
Outpost.
Multi-volume local snapshots can be used to create volumes on the same Outpost only.
You can create multi-volume local snapshots from instances on an Outpost using one of the following
methods.
Console
In the Attached data volumes section, deselect the data volumes to exclude from the multi-
volume snapshot set. Only the volumes that remain selected will be included in the multi-
volume snapshot set.
9. (Optional) To automatically copy tags from the source volumes to the corresponding snapshots,
for Copy tags from source volume, select Copy tags. This sets snapshot metadata—such as
access policies, attachment information, and cost allocation—to match the source volume.
10. (Optional) To assign additional custom tags to the snapshots, in the Tags section, choose Add
tag, and then enter the key-value pair. You can add up to 50 tags.
11. Choose Create Snapshot.
During snapshot creation, the snapshots are managed together. If one of the snapshots in the
volume set fails, the other snapshots in the volume set are moved to error status.
Command line
Use the create-snapshots command. Specify the ID of the instance from which to create the
snapshots, and the ARN of the destination Outpost on which to store the snapshots. If you omit the
Outpost ARN, the snapshots are stored in the AWS Region for the Outpost.
1634
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
For example, the following command creates snapshots of the volumes attached to instance
i-1234567890abcdef0 and stores the snapshots on Outpost arn:aws:outposts:us-
east-1:123456789012:outpost/op-1234567890abcdef0.
You can create Amazon Machine Images (AMIs) using a combination of local snapshots and snapshots
that are stored in the Region of the Outpost. For example, if you have an Outpost in us-east-1, you can
create an AMI with data volumes that are backed by local snapshots on that Outpost, and a root volume
that is backed by a snapshot in the us-east-1 Region.
Note
• You can't create AMIs that include backing snapshots stored across multiple Outposts.
• You can’t currently create AMIs directly from instances on an Outposts using CreateImage API
or the Amazon EC2 console for Outposts that are enabled with Amazon S3 on Outposts.
• AMIs that are backed by local snapshots can be used to launch instances on the same Outpost
only.
1. Copy the snapshots from the Region to the Outpost. For more information, see Copy snapshots from
an AWS Region to an Outpost (p. 1635).
2. Use the Amazon EC2 console or the register-image command to create the AMI using the snapshot
copies on the Outpost. For more information, see Creating an AMI from a snapshot.
1. Create snapshots from the instance on the Outpost and store the snapshots on the Outpost. For more
information, see Create multi-volume local snapshots from instances on an Outpost (p. 1634).
2. Use the Amazon EC2 console or the register-image command to create the AMI using the local
snapshots. For more information, see Creating an AMI from a snapshot.
1. Create snapshots from the instance on the Outpost and store the snapshots in the Region. For more
information, see Create local snapshots from volumes on an Outpost (p. 1633) or Create multi-
volume local snapshots from instances on an Outpost (p. 1634).
2. Use the Amazon EC2 console or the register-image command to create the AMI using the snapshot
copies in the Region. For more information, see Creating an AMI from a snapshot.
You can copy snapshots from an AWS Region to an Outpost. You can do this only if the snapshots are in
the Region for the Outpost. If the snapshots are in a different Region, you must first copy the snapshot
to the Region for the Outpost, and then copy it from that Region to the Outpost.
Note
You can't copy local snapshots from an Outpost to a Region, from one Outpost to another, or
within the same Outpost.
1635
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You can copy snapshots from a Region to an Outpost using one of the following methods.
Console
The Snapshot Destination field only appears if you have Outposts in the selected destination
Region. If the field does not appear, you do not have any Outposts in the selected destination
Region.
5. For Destination Outpost ARN, enter the ARN of the Outpost to which to copy the snapshot.
6. (Optional) For Description, enter a brief description of the copied snapshot.
7. Encryption is enabled by default for the snapshot copy. Encryption cannot be disabled. For KMS
key, choose the KMS key to use.
8. Choose Copy.
Command line
Use the copy-snapshot command. Specify the ID of the snapshot to copy, the Region from which to
copy the snapshot, and the ARN of the destination Outpost.
For example, the following command copies snapshot snap-1234567890abcdef0 from the
us-east-1 Region to Outpost arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef0.
You can copy AMIs from an AWS Region to an Outpost. When you copy an AMI from a Region to an
Outpost, all of the snapshots associated with the AMI are copied from the Region to the Outpost.
You can copy an AMI from a Region to an Outpost only if the snapshots associated with the AMI are in
the Region for the Outpost. If the snapshots are in a different Region, you must first copy the AMI to the
Region for the Outpost, and then copy it from that Region to the Outpost.
Note
You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within an
Outpost.
You can copy AMIs from a Region to an Outpost using the AWS CLI only.
Command line
1636
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Use the copy-image command. Specify the ID of the AMI to copy, the source Region, and the ARN of
the destination Outpost.
For example, the following command copies AMI ami-1234567890abcdef0 from the us-
east-1 Region to Outpost arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef0.
When you create a volume from a local snapshot, you cannot re-encrypt the volume using different KMS
key. Volumes created from local snapshots must be encrypted using the same KMS key as the source
snapshot.
For more information, see Create a volume from a snapshot (p. 1541).
Because Amazon S3 storage capacity does not become available immediately, we recommend that you
use Amazon CloudWatch alarms to monitor your Amazon S3 storage capacity. Delete snapshots and
volumes that you no longer need to avoid running out of storage capacity.
For more information about deleting snapshots, see Delete a snapshot (p. 1593).
The following table shows provides and Overview of the supported features.
Region Region ✓ ✓ ✓ ✓
Outpost Region ✓ ✓ ✓ ✓
Outpost Outpost ✗ ✗ ✗ ✗
1637
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Considerations
• Only Amazon EBS snapshot lifecycle policies are currently supported. EBS-backed AMI policies and
Cross-account sharing event policies are not supported.
• If a policy manages snapshots for volumes or instances in a Region, then snapshots are created in the
same Region as the source resource.
• If a policy manages snapshots for volumes or instances on an Outpost, then snapshots can be created
on the source Outpost, or in the Region for that Outpost.
• A single policy can't manage both snapshots in a Region and snapshots on an Outpost. If you need to
automate snapshots in a Region and on an Outpost, you must create separate policies.
• Fast snapshot restore is not supported for snapshots created on an Outpost, or for snapshots copied to
an Outpost.
• Cross-account sharing is not supported for snapshots created on an Outpost.
For more information about creating a snapshot lifecycle that manages local snapshots, see Automating
snapshot lifecycles (p. 1673).
You can create incremental snapshots directly from data on-premises into EBS volumes and the cloud
to use for quick disaster recovery. With the ability to write and read snapshots, you can write your on-
premises data to an EBS snapshot during a disaster. Then after recovery, you can restore it back to AWS
or on-premises from the snapshot. You no longer need to build and maintain complex mechanisms to
copy data to and from Amazon EBS.
This user guide provides an overview of the elements that make up the EBS direct APIs, and examples of
how to use them effectively. For more information about the actions, data types, parameters, and errors
of the APIs, see the EBS direct APIs reference. For more information about the supported AWS Regions,
endpoints, and service quotas for the EBS direct APIs, see Amazon EBS Endpoints and Quotas in the AWS
General Reference.
Contents
• Understand the EBS direct APIs (p. 1638)
• IAM permissions for EBS direct APIs (p. 1640)
• Use EBS direct APIs (p. 1644)
• Pricing for EBS direct APIs (p. 1662)
• Using interface VPC endpoints with EBS direct APIs (p. 1663)
• Log API Calls for EBS direct APIs with AWS CloudTrail (p. 1663)
• Frequently asked questions (p. 1669)
1638
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Snapshots
Snapshots are the primary means to back up data from your EBS volumes. With the EBS direct APIs,
you can also back up data from your on-premises disks to snapshots. To save storage costs, successive
snapshots are incremental, containing only the volume data that changed since the previous snapshot.
For more information, see Amazon EBS snapshots (p. 1569).
Note
EBS direct APIs does not support public snapshots and local snapshots on Outposts.
Blocks
A block is a fragment of data within a snapshot. Each snapshot can contain thousands of blocks. All
blocks in a snapshot are of a fixed size.
Block indexes
A block index is a logical index in units of 512 KiB blocks. To identify the block index, divide the logical
offset of the data in the logical volume by the block size (logical offset of data/524288). The logical
offset of the data must be 512 KiB aligned.
Block tokens
A block token is the identifying hash of a block within a snapshot, and it is used to locate the block data.
Block tokens returned by EBS direct APIs are temporary. They change on the expiry timestamp specified
for them, or if you run another ListSnapshotBlocks or ListChangedBlocks request for the same snapshot.
Checksum
A checksum is a small-sized datum derived from a block of data for the purpose of detecting errors that
were introduced during its transmission or storage. The EBS direct APIs use checksums to validate data
integrity. When you read data from an EBS snapshot, the service provides Base64-encoded SHA256
checksums for each block of data transmitted, which you can use for validation. When you write data
to an EBS snapshot, you must provide a Base64 encoded SHA256 checksum for each block of data
transmitted. The service validates the data received using the checksum provided. For more information,
see Use checksums (p. 1656) later in this guide.
Encryption
Encryption protects your data by converting it into unreadable code that can be deciphered only
by people who have access to the KMS key used to encrypt it. You can use the EBS direct APIs to
read and write encrypted snapshots, but there are some limitations. For more information, see Use
encryption (p. 1654) later in this guide.
API actions
The EBS direct APIs consists of six actions. There are three read actions and three write actions. The read
actions are:
• ListSnapshotBlocks — returns the block indexes and block tokens of blocks in the specified snapshot
• ListChangedBlocks — returns the block indexes and block tokens of blocks that are different between
two specified snapshots of the same volume and snapshot lineage.
• GetSnapshotBlock — returns the data in a block for the specified snapshot ID, block index, and block
token.
1639
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• PutSnapshotBlock — adds data to a started snapshot in the form of individual blocks. You must
specify a Base64-encoded SHA256 checksum for the block of data transmitted. The service validates
the checksum after the transmission is completed. The request fails if the checksum computed by the
service doesn’t match what you specified.
• CompleteSnapshot — completes a started snapshot that is in a pending state. The snapshot is then
changed to a completed state.
For more information about the EBS direct APIs resources, actions, and condition context keys for use in
IAM permission policies, see Actions, resources, and condition keys for Amazon Elastic Block Store in the
Service Authorization Reference.
Important
Be cautious when assigning the following policies to users. By assigning these policies, you
might give access to a user who is denied access to the same resource through the Amazon EC2
APIs, such as the CopySnapshot or CreateVolume actions.
The following policy allows the read EBS direct APIs to be used on all snapshots in a specific AWS Region.
In the policy, replace <Region> with the Region of the snapshot.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:<Region>::snapshot/*"
}
]
}
The following policy allows the read EBS direct APIs to be used on snapshots with a specific key-value
tag. In the policy, replace <Key> with the key value of the tag, and <Value> with the value of the tag.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"StringEqualsIgnoreCase": {
"aws:ResourceTag/<Key>": "<Value>"
}
1640
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
}
}
]
}
The following policy allows all of the read EBS direct APIs to be used on all snapshots in the account
only within a specific time range. This policy authorizes use of the EBS direct APIs based on the
aws:CurrentTime global condition key. In the policy, be sure to replace the date and time range shown
with the date and time range for your policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"DateGreaterThan": {
"aws:CurrentTime": "2018-05-29T00:00:00Z"
},
"DateLessThan": {
"aws:CurrentTime": "2020-05-29T23:59:59Z"
}
}
}
]
}
For more information, see Changing permissions for a user in the IAM User Guide.
The following policy allows the write EBS direct APIs to be used on all snapshots in a specific AWS
Region. In the policy, replace <Region> with the Region of the snapshot.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:<Region>::snapshot/*"
}
]
}
The following policy allows the write EBS direct APIs to be used on snapshots with a specific key-value
tag. In the policy, replace <Key> with the key value of the tag, and <Value> with the value of the tag.
{
"Version": "2012-10-17",
1641
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"StringEqualsIgnoreCase": {
"aws:ResourceTag/<Key>": "<Value>"
}
}
}
]
}
The following policy allows all of the EBS direct APIs to be used. It also allows the StartSnapshot
action only if a parent snapshot ID is specified. Therefore, this policy blocks the ability to start new
snapshots without using a parent snapshot.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ebs:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ebs:ParentSnapshot": "arn:aws:ec2:*::snapshot/*"
}
}
}
]
}
The following policy allows all of the EBS direct APIs to be used. It also allows only the user tag key
to be created for a new snapshot. This policy also ensures that the user has access to create tags. The
StartSnapshot action is the only action that can specify tags.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ebs:*",
"Resource": "*",
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": "user"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
1642
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The following policy allows all of the write EBS direct APIs to be used on all snapshots in the account
only within a specific time range. This policy authorizes use of the EBS direct APIs based on the
aws:CurrentTime global condition key. In the policy, be sure to replace the date and time range shown
with the date and time range for your policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"DateGreaterThan": {
"aws:CurrentTime": "2018-05-29T00:00:00Z"
},
"DateLessThan": {
"aws:CurrentTime": "2020-05-29T23:59:59Z"
}
}
}
]
}
For more information, see Changing permissions for a user in the IAM User Guide.
The following policy grants permission to decrypt an encrypted snapshot using a specific KMS key. It also
grants permission to encrypt new snapshots using the default KMS key for EBS encryption. In the policy,
replace <Region> with the Region of the KMS key, <AccountId> with the ID of the AWS account of the
KMS key, and <KeyId> with the ID of the KMS key.
Note
By default, all principals in the account have access to the default AWS managed KMS key for
Amazon EBS encryption, and they can use it for EBS encryption and decryption operations. If
you are using a customer managed key, you must create a new key policy or modify the existing
key policy for the customer managed key to grant the principal access to the customer managed
key. For more information, see Key policies in AWS KMS in the AWS Key Management Service
Developer Guide.
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant. Instead,
use the kms:GrantIsForAWSResource condition key to allow the user to create grants on the
KMS key only when the grant is created on the user's behalf by an AWS service, as shown in the
following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey",
"kms:GenerateDataKeyWithoutPlaintext",
1643
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"kms:ReEncrypt*",
"kms:CreateGrant",
"ec2:CreateTags",
"kms:DescribeKey"
],
"Resource": "arn:aws:kms:<Region>:<AccountId>:key/<KeyId>",
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": true
}
}
}
]
}
For more information, see Changing permissions for a user in the IAM User Guide.
Important
The EBS direct APIs require an AWS Signature Version 4 signature. For more information, see
Use Signature Version 4 signing (p. 1656).
Topics
• Read snapshots with EBS direct APIs (p. 1644)
• Write snapshots with EBS direct APIs (p. 1650)
• Use encryption (p. 1654)
• Use Signature Version 4 signing (p. 1656)
• Use checksums (p. 1656)
• Idempotency for StartSnapshot API (p. 1657)
• Error retries (p. 1657)
• Optimize performance (p. 1659)
• EBS direct APIs service endpoints (p. 1659)
The following steps describe how to use the EBS direct APIs to read snapshots:
1. Use the ListSnapshotBlocks action to view all block indexes and block tokens of blocks in a snapshot.
Or use the ListChangedBlocks action to view only the block indexes and block tokens of blocks that
are different between two snapshots of the same volume and snapshot lineage. These actions help
you identify the block tokens and block indexes of blocks for which you might want to get data.
2. Use the GetSnapshotBlock action, and specify the block index and block token of the block for which
you want to get data.
The following examples show how to read snapshots using the EBS direct APIs.
1644
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Topics
• List blocks in a snapshot (p. 1645)
• List blocks that are different between two snapshots (p. 1646)
• Get block data from a snapshot (p. 1649)
AWS CLI
The following list-snapshot-blocks example command returns the block indexes and block tokens
of blocks that are in snapshot snap-0987654321. The --starting-block-index parameter
limits the results to block indexes greater than 1000, and the --max-results parameter limits the
results to the first 100 blocks.
The following example response for the previous command lists the block indexes and block tokens
in the snapshot. Use the get-snapshot-block command and specify the block index and block
token of the block for which you want to get data. The block tokens are valid until the expiry time
listed.
{
"Blocks": [
{
"BlockIndex": 1001,
"BlockToken": "AAABAV3/
PNhXOynVdMYHUpPsetaSvjLB1dtIGfbJv5OJ0sX855EzGTWos4a4"
},
{
"BlockIndex": 1002,
"BlockToken": "AAABATGQIgwr0WwIuqIMjCA/Sy7e/
YoQFZsHejzGNvjKauzNgzeI13YHBfQB"
},
{
"BlockIndex": 1007,
"BlockToken": "AAABAZ9CTuQtUvp/
dXqRWw4d07eOgTZ3jvn6hiW30W9duM8MiMw6yQayzF2c"
},
{
"BlockIndex": 1012,
"BlockToken": "AAABAQdzxhw0rVV6PNmsfo/
YRIxo9JPR85XxPf1BLjg0Hec6pygYr6laE1p0"
},
{
"BlockIndex": 1030,
"BlockToken": "AAABAaYvPax6mv+iGWLdTUjQtFWouQ7Dqz6nSD9L
+CbXnvpkswA6iDID523d"
},
{
"BlockIndex": 1031,
"BlockToken": "AAABATgWZC0XcFwUKvTJbUXMiSPg59KVxJGL
+BWBClkw6spzCxJVqDVaTskJ"
},
...
],
"ExpiryTime": 1576287332.806,
"VolumeSize": 32212254720,
"BlockSize": 524288
}
1645
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
AWS API
The following ListSnapshotBlocks example request returns the block indexes and block tokens of
blocks that are in snapshot snap-0acEXAMPLEcf41648. The startingBlockIndex parameter
limits the results to block indexes greater than 1000, and the maxResults parameter limits the
results to the first 100 blocks.
GET /snapshots/snap-0acEXAMPLEcf41648/blocks?maxResults=100&startingBlockIndex=1000
HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent parameter>
X-Amz-Date: 20200617T231953Z
Authorization: <Authentication parameter>
The following example response for the previous request lists the block indexes and block tokens in
the snapshot. Use the GetSnapshotBlock action and specify the block index and block token of the
block for which you want to get data. The block tokens are valid until the expiry time listed.
HTTP/1.1 200 OK
x-amzn-RequestId: d6e5017c-70a8-4539-8830-57f5557f3f27
Content-Type: application/json
Content-Length: 2472
Date: Wed, 17 Jun 2020 23:19:56 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"Blocks": [
{
"BlockIndex": 0,
"BlockToken": "AAUBAcuWqOCnDNuKle11s7IIX6jp6FYcC/q8oT93913HhvLvA
+3JRrSybp/0"
},
{
"BlockIndex": 1536,
"BlockToken":
"AAUBAWudwfmofcrQhGVlLwuRKm2b8ZXPiyrgoykTRC6IU1NbxKWDY1pPjvnV"
},
{
"BlockIndex": 3072,
"BlockToken":
"AAUBAV7p6pC5fKAC7TokoNCtAnZhqq27u6YEXZ3MwRevBkDjmMx6iuA6tsBt"
},
{
"BlockIndex": 3073,
"BlockToken":
"AAUBAbqt9zpqBUEvtO2HINAfFaWToOwlPjbIsQOlx6JUN/0+iMQl0NtNbnX4"
},
...
],
"ExpiryTime": 1.59298379649E9,
"VolumeSize": 3
}
Keep the following in mind when making paginated requests to list the changed blocks between two
snapshots:
• The response can include one or more empty ChangedBlocks arrays. For example:
1646
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• Snapshot 1 — full snapshot with 1000 blocks with block indexes 0 - 999.
• Snapshot 2 — incremental snapshot with only one changed block with block index 999.
Listing the changed blocks for these snapshots with StartingBlockIndex = 0 and MaxResults
= 100 returns an empty array of ChangedBlocks. You must request the remaining results using
nextToken until the changed block is returned in the tenth result set, which includes blocks with
block indexes 900 - 999.
• The response can skip unwritten blocks in the snapshots. For example:
• Snapshot 1 — full snapshot with 1000 blocks with block indexes 2000 - 2999.
• Snapshot 2 — incremental snapshot with only one changed block with block index 2000.
Listing the changed blocks for these snapshots with StartingBlockIndex = 0 and MaxResults =
100, the response skips block indexes 0 - 1999 and includes block index 2000. The response will not
include empty ChangedBlocks arrays.
AWS CLI
The following list-changed-blocks example command returns the block indexes and block tokens of
blocks that are different between snapshots snap-1234567890 and snap-0987654321. The --
starting-block-index parameter limits the results to block indexes greater than 0, and the --
max-results parameter limits the results to the first 500 blocks..
The following example response for the previous command shows that block indexes 0, 6000, 6001,
6002, and 6003 are different between the two snapshots. Additionally, block indexes 6001, 6002,
and 6003 exist only in the first snapshot ID specified, and not in the second snapshot ID because
there is no second block token listed in the response.
Use the get-snapshot-block command and specify the block index and block token of the block
for which you want to get data. The block tokens are valid until the expiry time listed.
{
"ChangedBlocks": [
{
"BlockIndex": 0,
"FirstBlockToken": "AAABAVahm9SO60Dyi0ORySzn2ZjGjW/
KN3uygGlS0QOYWesbzBbDnX2dGpmC",
"SecondBlockToken":
"AAABAf8o0o6UFi1rDbSZGIRaCEdDyBu9TlvtCQxxoKV8qrUPQP7vcM6iWGSr"
},
{
"BlockIndex": 6000,
"FirstBlockToken": "AAABAbYSiZvJ0/
R9tz8suI8dSzecLjN4kkazK8inFXVintPkdaVFLfCMQsKe",
"SecondBlockToken":
"AAABAZnqTdzFmKRpsaMAsDxviVqEI/3jJzI2crq2eFDCgHmyNf777elD9oVR"
},
{
"BlockIndex": 6001,
"FirstBlockToken": "AAABASBpSJ2UAD3PLxJnCt6zun4/
T4sU25Bnb8jB5Q6FRXHFqAIAqE04hJoR"
},
{
"BlockIndex": 6002,
"FirstBlockToken": "AAABASqX4/
NWjvNceoyMUljcRd0DnwbSwNnes1UkoP62CrQXvn47BY5435aw"
},
1647
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
{
"BlockIndex": 6003,
"FirstBlockToken":
"AAABASmJ0O5JxAOce25rF4P1sdRtyIDsX12tFEDunnePYUKOf4PBROuICb2A"
},
...
],
"ExpiryTime": 1576308931.973,
"VolumeSize": 32212254720,
"BlockSize": 524288,
"NextToken": "AAADARqElNng/sV98CYk/bJDCXeLJmLJHnNSkHvLzVaO0zsPH/QM3Bi3zF//O6Mdi/
BbJarBnp8h"
}
AWS API
The following ListChangedBlocks example request returns the block indexes and block
tokens of blocks that are different between snapshots snap-0acEXAMPLEcf41648 and
snap-0c9EXAMPLE1b30e2f. The startingBlockIndex parameter limits the results to block
indexes greater than 0, and the maxResults parameter limits the results to the first 500 blocks.
GET /snapshots/snap-0c9EXAMPLE1b30e2f/changedblocks?
firstSnapshotId=snap-0acEXAMPLEcf41648&maxResults=500&startingBlockIndex=0 HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent parameter>
X-Amz-Date: 20200617T232546Z
Authorization: <Authentication parameter>
The following example response for the previous request shows that block indexes 0, 3072, 6002,
and 6003 are different between the two snapshots. Additionally, block indexes 6002, and 6003 exist
only in the first snapshot ID specified, and not in the second snapshot ID because there is no second
block token listed in the response.
Use the GetSnapshotBlock action and specify the block index and block token of the block for
which you want to get data. The block tokens are valid until the expiry time listed.
HTTP/1.1 200 OK
x-amzn-RequestId: fb0f6743-6d81-4be8-afbe-db11a5bb8a1f
Content-Type: application/json
Content-Length: 1456
Date: Wed, 17 Jun 2020 23:25:47 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"ChangedBlocks": [
{
"BlockIndex": 0,
"FirstBlockToken": "AAUBAVaWqOCnDNuKle11s7IIX6jp6FYcC/
tJuVT1GgP23AuLntwiMdJ+OJkL",
"SecondBlockToken": "AAUBASxzy0Y0b33JVRLoYm3NOresCxn5RO+HVFzXW3Y/
RwfFaPX2Edx8QHCh"
},
{
"BlockIndex": 3072,
"FirstBlockToken": "AAUBAcHp6pC5fKAC7TokoNCtAnZhqq27u6fxRfZOLEmeXLmHBf2R/
Yb24MaS",
"SecondBlockToken":
"AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid"
},
{
"BlockIndex": 6002,
1648
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"FirstBlockToken": "AAABASqX4/
NWjvNceoyMUljcRd0DnwbSwNnes1UkoP62CrQXvn47BY5435aw"
},
{
"BlockIndex": 6003,
"FirstBlockToken":
"AAABASmJ0O5JxAOce25rF4P1sdRtyIDsX12tFEDunnePYUKOf4PBROuICb2A"
},
...
],
"ExpiryTime": 1.592976647009E9,
"VolumeSize": 3
}
AWS CLI
The following get-snapshot-block example command returns the data in the block index 6001 with
block token AAABASBpSJ2UAD3PLxJnCt6zun4/T4sU25Bnb8jB5Q6FRXHFqAIAqE04hJoR, in
snapshot snap-1234567890. The binary data is output to the data file in the C:\Temp directory
on a Windows computer. If you run the command on a Linux or Unix computer, replace the output
path with /tmp/data to output the data to the data file in the /tmp directory.
The following example response for the previous command shows the size of the data returned, the
checksum to validate the data, and the algorithm of the checksum. The binary data is automatically
saved to the directory and file you specified in the request command.
{
"DataLength": "524288",
"Checksum": "cf0Y6/Fn0oFa4VyjQPOa/iD0zhTflPTKzxGv2OKowXc=",
"ChecksumAlgorithm": "SHA256"
}
AWS API
The following GetSnapshotBlock example request returns the data in the block index 3072 with
block token AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid, in
snapshot snap-0c9EXAMPLE1b30e2f.
GET /snapshots/snap-0c9EXAMPLE1b30e2f/blocks/3072?
blockToken=AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent parameter>
X-Amz-Date: 20200617T232838Z
Authorization: <Authentication parameter>
The following example response for the previous request shows the size of the data returned, the
checksum to validate the data, and the algorithm used to generate the checksum. The binary data is
transmitted in the body of the response and is represented as BlockData in the following example.
HTTP/1.1 200 OK
x-amzn-RequestId: 2d0db2fb-bd88-474d-a137-81c4e57d7b9f
x-amz-Data-Length: 524288
x-amz-Checksum: Vc0yY2j3qg8bUL9I6GQuI2orTudrQRBDMIhcy7bdEsw=
1649
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
x-amz-Checksum-Algorithm: SHA256
Content-Type: application/octet-stream
Content-Length: 524288
Date: Wed, 17 Jun 2020 23:28:38 GMT
Connection: keep-alive
BlockData
The following steps describe how to use the EBS direct APIs to write incremental snapshots:
1. Use the StartSnapshot action and specify a parent snapshot ID to start a snapshot as an incremental
snapshot of an existing one, or omit the parent snapshot ID to start a new snapshot. This action
returns the new snapshot ID, which is in a pending state.
2. Use the PutSnapshotBlock action and specify the ID of the pending snapshot to add data to it in the
form of individual blocks. You must specify a Base64-encoded SHA256 checksum for the block of
data transmitted. The service computes the checksum of the data received and validates it with the
checksum that you specified. The action fails if the checksums don't match.
3. When you're done adding data to the pending snapshot, use the CompleteSnapshot action to start an
asynchronous workflow that seals the snapshot and moves it to a completed state.
Repeat these steps to create a new, incremental snapshot using the previously created snapshot as the
parent.
For example, in the following diagram, snapshot A is the first new snapshot started. Snapshot A is used
as the parent snapshot to start snapshot B. Snapshot B is used as the parent snapshot to start and create
snapshot C. Snapshots A, B, and C are incremental snapshots. Snapshot A is used to create EBS volume
1. Snapshot D is created from EBS volume 1. Snapshot D is an incremental snapshot of A; it is not an
incremental snapshot of B or C.
The following examples show how to write snapshots using the EBS direct APIs.
Topics
• Start a snapshot (p. 1651)
• Put data into a snapshot (p. 1652)
• Complete a snapshot (p. 1653)
1650
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Start a snapshot
AWS CLI
The following start-snapshot example command starts an 8 GiB snapshot, using snapshot
snap-123EXAMPLE1234567 as the parent snapshot. The new snapshot will be an incremental
snapshot of the parent snapshot. The snapshot moves to an error state if there are no put or
complete requests made for the snapshot within the specified 60 minute timeout period. The
550e8400-e29b-41d4-a716-446655440000 client token ensures idempotency for the request. If
the client token is omitted, the AWS SDK automatically generates one for you. For more information
about idempotency, see Idempotency for StartSnapshot API (p. 1657).
The following example response for the previous command shows the snapshot ID, AWS account
ID, status, volume size in GiB, and size of the blocks in the snapshot. The snapshot is started in a
pending state. Specify the snapshot ID in subsequent put-snapshot-block commands to write
data to the snapshot, then use the complete-snapshot command to complete the snapshot and
change its status to completed.
{
"SnapshotId": "snap-0aaEXAMPLEe306d62",
"OwnerId": "111122223333",
"Status": "pending",
"VolumeSize": 8,
"BlockSize": 524288
}
AWS API
The following StartSnapshot example request starts an 8 GiB snapshot, using snapshot
snap-123EXAMPLE1234567 as the parent snapshot. The new snapshot will be an incremental
snapshot of the parent snapshot. The snapshot moves to an error state if there are no put or
complete requests made for the snapshot within the specified 60 minute timeout period. The
550e8400-e29b-41d4-a716-446655440000 client token ensures idempotency for the request. If
the client token is omitted, the AWS SDK automatically generates one for you. For more information
about idempotency, see Idempotency for StartSnapshot API (p. 1657).
{
"VolumeSize": 8,
"ParentSnapshot": snap-123EXAMPLE1234567,
"ClientToken": "550e8400-e29b-41d4-a716-446655440000",
"Timeout": 60
}
The following example response for the previous request shows the snapshot ID, AWS account
ID, status, volume size in GiB, and size of the blocks in the snapshot. The snapshot is started in a
pending state. Specify the snapshot ID in a subsequent PutSnapshotBlocks request to write data
to the snapshot.
1651
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
x-amzn-RequestId: 929e6eb9-7183-405a-9502-5b7da37c1b18
Content-Type: application/json
Content-Length: 181
Date: Thu, 18 Jun 2020 04:07:29 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"Description": null,
"OwnerId": "138695307491",
"Progress": null,
"SnapshotId": "snap-052EXAMPLEc85d8dd",
"StartTime": null,
"Status": "pending",
"Tags": null,
"VolumeSize": 8
}
AWS CLI
The following example response for the previous command confirms the data length, checksum, and
checksum algorithm for the data received by the service.
{
"DataLength": "524288",
"Checksum": "QOD3gmEQOXATfJx2Aa34W4FU2nZGyXfqtsUuktOw8DM=",
"ChecksumAlgorithm": "SHA256"
}
AWS API
1652
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
BlockData
The following is example response for the previous request confirms the data length, checksum, and
checksum algorithm for the data received by the service.
{}
Complete a snapshot
AWS CLI
{
"Status": "pending"
}
AWS API
1653
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Content-Type: application/json
Content-Length: 20
Date: Thu, 18 Jun 2020 04:31:50 GMT
Connection: keep-alive
{"Status":"pending"}
Use encryption
When you start a new snapshot using StartSnapshot, the encryption status depends on the values
that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your AWS account is
enabled for encryption by default (p. 1735).
Note
• You might need additional IAM permissions to use the EBS direct APIs with encryption. For
moreinformation, see Permissions to use AWS KMS keys (p. 1643).
• If Amazon EBS encryption by default is enabled on your AWS account, you can't create
unencrypted snapshots.
• If Amazon EBS encryption by default is enabled on your AWS account, you cannot start a new
snapshot using an unencrypted parent snapshot. You must first encrypt the parent snapshot
by copying it. For more information, see Copy an Amazon EBS snapshot (p. 1593).
Topics
• Encryption outcomes: Unencrypted parent snapshot (p. 1654)
• Encryption outcomes: Encrypted parent snapshot (p. 1655)
• Encryption outcomes: No parent snapshot (p. 1655)
The following table describes the encryption outcome for each possible combination of settings when
specifying an unencrypted parent snapshot.
ParentSnapshotId
Encrypted KmsKeyArn Encryption by Result
default
Specified Enabled
Disabled
Specified Enabled
Disabled
1654
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
ParentSnapshotId
Encrypted KmsKeyArn Encryption by Result
default
Specified Enabled
Disabled
ParentSnapshotId
Encrypted KmsKeyArn Encryption by Result
default
Specified Enabled
Disabled
Specified Enabled
Disabled
ParentSnapshotId
Encrypted KmsKeyArn Encryption by Result
default
1655
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
ParentSnapshotId
Encrypted KmsKeyArn Encryption by Result
default
* This default KMS key could be a customer managed key or the default AWS managed KMS key for
Amazon EBS encryption.
Signature Version 4 is the process to add authentication information to AWS requests sent by HTTP. For
security, most requests to AWS must be signed with an access key, which consists of an access key ID and
secret access key. These two keys are commonly referred to as your security credentials. For information
about how to obtain credentials for your account, see Understanding and getting your credentials.
If you intend to manually create HTTP requests, you must learn how to sign them. When you use the
AWS Command Line Interface (AWS CLI) or one of the AWS SDKs to make requests to AWS, these tools
automatically sign the requests for you with the access key that you specify when you configure the
tools. When you use these tools, you don't need to learn how to sign requests yourself.
For more information, see Signing AWS requests with Signature Version 4 in the AWS General Reference.
Use checksums
The GetSnapshotBlock action returns data that is in a block of a snapshot, and the PutSnapshotBlock
action adds data to a block in a snapshot. The block data that is transmitted is not signed as part of the
Signature Version 4 signing process. As a result, checksums are used to validate the integrity of the data
as follows:
• When you use the GetSnapshotBlock action, the response provides a Base64-encoded SHA256
checksum for the block data using the x-amz-Checksum header, and the checksum algorithm using
the x-amz-Checksum-Algorithm header. Use the returned checksum to validate the integrity of
the data. If the checksum that you generate doesn't match what Amazon EBS provided, you should
consider the data not valid and retry your request.
• When you use the PutSnapshotBlock action, your request must provide a Base64-encoded SHA256
checksum for the block data using the x-amz-Checksum header, and the checksum algorithm using
the x-amz-Checksum-Algorithm header. The checksum that you provide is validated against a
checksum generated by Amazon EBS to validate the integrity of the data. If the checksums do not
correspond, the request fails.
• When you use the CompleteSnapshot action, your request can optionally provide an aggregate
Base64-encoded SHA256 checksum for the complete set of data added to the snapshot. Provide the
checksum using the x-amz-Checksum header, the checksum algorithm using the x-amz-Checksum-
Algorithm header, and the checksum aggregation method using the x-amz-Checksum-Aggregation-
Method header. To generate the aggregated checksum using the linear aggregation method, arrange
1656
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
the checksums for each written block in ascending order of their block index, concatenate them to
form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.
The checksums in these actions are part of the Signature Version 4 signing process.
The StartSnapshot API supports idempotency using a client token. A client token is a unique string
that you specify when you make an API request. If you retry an API request with the same client token
and the same request parameters after it has completed successfully, the result of the original request
is returned. If you retry a request with the same client token, but change one or more of the request
parameters, the ConflictException error is returned.
If you do not specify your own client token, the AWS SDKs automatically generates a client token for the
request to ensure that it is idempotent.
A client token can be any string that includes up to 64 ASCII characters. You should not reuse the same
client tokens for different requests.
To make an idempotent StartSnapshot request with your own client token using the API
{
"VolumeSize": 8,
"ParentSnapshot": snap-123EXAMPLE1234567,
"ClientToken": "550e8400-e29b-41d4-a716-446655440000",
"Timeout": 60
}
To make an idempotent StartSnapshot request with your own client token using the AWS CLI
Error retries
The AWS SDKs implement automatic retry logic for requests that return error responses. You can
configure the retry settings for the AWS SDKs. For more information, see your SDK's documentation.
You can configure the AWS CLI to automatically retry some failed requests. For more information about
configuring retries for the AWS CLI, see AWS CLI retries in the AWS Command Line Interface User Guide.
The AWS Query API does not support retry logic for failed requests. If you are using HTTP or HTTPS
requests, you must implement retry logic in your client application.
For more information, see Error retries and exponential backoff in AWS in the AWS General Reference.
1657
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
The following table shows the possible API error responses. Some API errors are retryable. Your client
application should always retry failed requests that receive a retryable error.
500
InternalServerException The request failed All APIs Yes
due to a network
or AWS server-side
issue.
400
ThrottlingException The number of All APIs Yes
API requests has
exceeded the
maximum allowed
API request
throttling limit for
the account.
400
RequestThrottleException The number of GetSnapshotBlock Yes
API requests has |
exceeded the PutSnapshotBlock
maximum allowed
API request
throttling limit for
the snapshot.
400
ValidationException The provided data PutSnapshotBlock Yes
with message block was not
"Failed to readable.
read block
data"
400
ValidationException The request syntax All APIs No
with any other is malformed,
message or the input
does not satisfy
the constraints
specified by the
AWS service.
404
ResourceNotFoundException The specified All APIs No
snapshot ID does
not exist.
409
ConflictException The specified StartSnapshot No
client token
was previously
used in a similar
request that had
different request
parameters. For
more information,
see Idempotency
for StartSnapshot
API (p. 1657).
403
AccessDeniedException You do not All APIs No
have permission
1658
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
402
ServiceQuotaExceededException The request failed All APIs No
because fulfilling
the request would
exceed one or
more dependent
service quotas for
your account.
403
InvalidSignatureException The request All APIs No
authorization
signature has
expired. You
can retry the
request only after
refreshing the
authorization
signature.
Optimize performance
You can run API requests concurrently. Assuming PutSnapshotBlock latency is 100ms, then a thread
can process 10 requests in one second. Furthermore, assuming your client application creates multiple
threads and connections (for example, 100 connections), it can make 1000 (10 * 100) requests per
second in total. This will correspond to a throughput of around 500 MB per second.
The following list contains few things to look for in your application:
• Is each thread using a separate connection? If the connections are limited on the application then
multiple threads will wait for the connection to be available and you will notice lower throughput.
• Is there any wait time in the application between two put requests? This will reduce the effective
throughput of a thread.
• The bandwidth limit on the instance – If bandwidth on the instance is shared by other applications, it
could limit the available throughput for PutSnapshotBlock requests.
Be sure to take note of other workloads that might be running in the account to avoid bottlenecks. You
should also build retry mechanisms into your EBS direct APIs workflows to handle throttling, timeouts,
and service unavailability.
Review the EBS direct APIs service quotas to determine the maximum API requests that you can run per
second. For more information, see Amazon Elastic Block Store Endpoints and Quotas in the AWS General
Reference.
An endpoint is a URL that serves as an entry point for an AWS web service. EBS direct APIs supports the
following endpoint types:
• IPv4 endpoints
• Dual-stack endpoints that support both IPv4 and IPv6
• FIPS endpoints
1659
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
When you make a request, you can specify the endpoint and Region to use. If you do not specify an
endpoint, the IPv4 endpoint is used by default. To use a different endpoint type, you must specify it in
your request. For examples of how to do this, see Specifying endpoints (p. 1661).
For more information about Regions, see Regions and Availability Zones in the Amazon EC2 User Guide
for Linux Instances. For a list of endpoints for EBS direct APIs, see Endpoints for the EBS direct APIs in
the Amazon Web Services General Reference.
Topics
• IPv4 endpoints (p. 1660)
• Dual-stack (IPv4 and IPv6) endpoints (p. 1660)
• FIPS endpoints (p. 1661)
• Specifying endpoints (p. 1661)
IPv4 endpoints
IPv4 endpoints support IPv4 traffic only. IPv4 endpoints are available for all Regions.
If you specify the general endpoint, ebs.amazonaws.com, we use the endpoint for us-east-1.
To use a different Region, specify its associated endpoint. For example, if you specify ebs.us-
east-2.amazonaws.com as the endpoint, we direct your request to the us-east-2 endpoint.
• ebs.region.amazonaws.com
For example, the IPv4 endpoint name for the us-west-1 Region is ebs.us-west-1.amazonaws.com.
For a list of endpoints for EBS direct APIs, see Endpoints for the EBS direct APIs in the Amazon Web
Services General Reference.
Pricing
You are not charged for data transferred directly between EBS direct APIs and Amazon EC2 instances
using an IPv4 endpoint in the same Region. However, if there are intermediate services, such as AWS
PrivateLink endpoints, NAT Gateway, or Amazon VPC Transit Gateways, you are charged their associated
costs.
Dual-stack endpoints support both IPv4 and IPv6 traffic. Dual-stack endpoints are available for all
Regions.
To use IPv6, you must use a dual-stack endpoint. When you make a request to a dual-stack endpoint, the
endpoint URL resolves to an IPv6 or an IPv4 address, depending on the protocol used by your network
and client.
EBS direct APIs supports only regional dual-stack endpoints, which means that you must specify the
Region as part of the endpoint name. Dual-stack endpoint names use the following naming convention:
• ebs.region.api.aws
For example, the dual-stack endpoint name for the eu-west-1 Region is ebs.eu-west-1.api.aws.
For a list of endpoints for EBS direct APIs, see Endpoints for the EBS direct APIs in the Amazon Web
Services General Reference.
Pricing
1660
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
You are not charged for data transferred directly between EBS direct APIs and Amazon EC2 instances
using a dual-stack endpoint in the same Region. However, if there are intermediate services, such as AWS
PrivateLink endpoints, NAT Gateway, or Amazon VPC Transit Gateways, you are charged their associated
costs.
FIPS endpoints
EBS direct APIs provides FIPS-validated IPv4 and dual-stack (IPv4 and IPv6) endpoints for the following
Regions:
FIPS IPv4 endpoints use the following naming convention: ebs-fips.region.amazonaws.com. For
example, the FIPS IPv4 endpoint for us-east-1 is ebs-fips.us-east-1.amazonaws.com.
FIPS dual-stack endpoints use the following naming convention: ebs-fips.region.api.aws. For
example, the FIPS dual-stack endpoint for us-east-1 is ebs-fips.us-east-1.api.aws.
For more information about FIPS endpoints see, FIPS endpoints in the Amazon Web Services General
Reference.
Specifying endpoints
This section provides some examples of how to specify an endpoint when making a request.
AWS CLI
The following examples show how to specify an endpoint for the us-east-2 Region using the AWS
CLI.
• Dual-stack
• IPv4
The following examples show how to specify an endpoint for the us-east-2 Region using the AWS
SDK for Java 2.x.
• Dual-stack
1661
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
• IPv4
The following examples show how to specify an endpoint for the us-east-2 Region using the AWS
SDK for Go.
• Dual-stack
sess := session.Must(session.NewSession())
svc := ebs.New(sess, &aws.Config{
Region: aws.String(endpoints.UsEast1RegionID),
Endpoint: aws.String("https://ebs.us-east-2.api.aws")
})
• IPv4
sess := session.Must(session.NewSession())
svc := ebs.New(sess, &aws.Config{
Region: aws.String(endpoints.UsEast1RegionID),
Endpoint: aws.String("https://ebs.us-east-2.amazonaws.com")
})
The price that you pay to use the EBS direct APIs depends on the requests you make. For more
information, see Amazon EBS pricing.
• ListChangedBlocks and ListSnapshotBlocks APIs are charged per request. For example, if you make
100,000 ListSnapshotBlocks API requests in a Region that charges $0.0006 per 1,000 requests, you will
be charged $0.06 ($0.0006 per 1,000 requests x 100).
• GetSnapshotBlock is charged per block returned. For example, if you make 100,000 GetSnapshotBlock
API requests in a Region that charges $0.003 per 1,000 blocks returned, you will be charged $0.30
($0.003 per 1,000 blocks retruned x 100).
• PutSnapshotBlock is charged per block written. For example, if you make 100,000 PutSnapshotBlock
API requests in a Region that charges $0.006 per 1,000 blocks written, you will be charged $0.60
($0.006 per 1,000 blocks written x 100).
Networking costs
1662
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
Data transferred directly between EBS direct APIs and Amazon EC2 instances in the same AWS Region
is free when using non-FIPS endpoints. For more information, see AWS service endpoints. If other AWS
services are in the path of your data transfer, you will be charged their associated data processing costs.
These services include, but are not limited to, PrivateLink endpoints, NAT Gateway and Transit Gateway.
If you are using EBS direct APIs from Amazon EC2 instances or AWS Lambda functions in private subnets,
you can use VPC interface endpoints, instead of using NAT gateways, to reduce network data transfer
costs. For more information, see Using interface VPC endpoints with EBS direct APIs (p. 1663).
We create an endpoint network interface in each subnet that you enable for the interface endpoint.
For more information, see Access AWS services through AWS PrivateLink in the AWS PrivateLink Guide.
VPC endpoint policies are not supported for EBS direct APIs. By default, full access to EBS direct APIs is
allowed through the endpoint. However, you can control access to the interface endpoint using security
groups.
Create a VPC endpoint for EBS direct APIs using the following service name:
• com.amazonaws.region.ebs
If you enable private DNS for the endpoint, you can make API requests to EBS direct APIs using its
default DNS name for the Region, for example, ebs.us-east-1.amazonaws.com.
Log API Calls for EBS direct APIs with AWS CloudTrail
The EBS direct APIs service is integrated with AWS CloudTrail. CloudTrail is a service that provides a
record of actions taken by a user, role, or an AWS service. CloudTrail captures all API calls performed in
EBS direct APIs as events. If you create a trail, you can enable continuous delivery of CloudTrail events
to an Amazon Simple Storage Service (Amazon S3) bucket. If you don't configure a trail, you can still
view the most recent management events in the CloudTrail console in Event history. Data events are
not captured in Event history. You can use the information collected by CloudTrail to determine the
request that was made to EBS direct APIs, the IP address from which the request was made, who made
the request, when it was made, and additional details.
For more information about CloudTrail, see the AWS CloudTrail User Guide.
1663
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
events in Event history. You can view, search, and download recent events in your AWS account. For
more information, see Viewing Events with CloudTrail Event History.
For an ongoing record of events in your AWS account, including events for EBS direct APIs, create a
trail. A trail enables CloudTrail to deliver log files to an S3 bucket. By default, when you create a trail
in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS
partition and delivers the log files to the S3 bucket that you specify. Additionally, you can configure
other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more
information, see the following:
For EBS direct APIs, you can use CloudTrail to log two types of events:
• Management events — Management events provide visibility into management operations that are
performed on snapshots in your AWS account. The following API actions are logged by default as
management events in trails:
• StartSnapshot
• CompleteSnapshot
For more information about logging management events, see Logging management events for trails in
the CloudTrail User Guide.
• Data events — These events provide visibility into the snapshot operations performed on or within a
snapshot. The following API actions can optionally be logged as data events in trails:
• ListSnapshotBlocks
• ListChangedBlocks
• GetSnapshotBlock
• PutSnapshotBlock
Data events are not logged by default when you create a trail. You can use only advanced event
selectors to record data events on EBS direct API calls. For more information, see Logging data events
for trails in the CloudTrail User Guide.
Note
If you perform an action on a snapshot that is shared with you, data events are not sent to the
AWS account that owns the snapshot.
Identity information
Every event or log entry contains information about who generated the request. The identity
information helps you determine the following:
• Whether the request was made with root user or user credentials.
• Whether the request was made with temporary security credentials for a role or federated user.
• Whether the request was made by another AWS service.
1664
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
A trail is a configuration that enables delivery of events as log files to an S3 bucket that you specify.
CloudTrail log files contain one or more log entries. An event represents a single request from any
source and includes information about the requested action, the date and time of the action, request
parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they
don't appear in any specific order.
StartSnapshot
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2020-07-03T23:27:26Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "StartSnapshot",
"awsRegion": "eu-west-1",
"sourceIPAddress": "192.0.2.0",
"userAgent": "PostmanRuntime/7.25.0",
"requestParameters": {
"volumeSize": 8,
"clientToken": "token",
"encrypted": true
},
"responseElements": {
"snapshotId": "snap-123456789012",
"ownerId": "123456789012",
"status": "pending",
"startTime": "Jul 3, 2020 11:27:26 PM",
"volumeSize": 8,
"blockSize": 524288,
"kmsKeyArn": "HIDDEN_DUE_TO_SECURITY_REASONS"
},
"requestID": "be112233-1ba5-4ae0-8e2b-1c302EXAMPLE",
"eventID": "6e12345-2a4e-417c-aa78-7594fEXAMPLE",
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012"
}
CompleteSnapshot
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2020-07-03T23:28:24Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "CompleteSnapshot",
1665
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"awsRegion": "eu-west-1",
"sourceIPAddress": "192.0.2.0",
"userAgent": "PostmanRuntime/7.25.0",
"requestParameters": {
"snapshotId": "snap-123456789012",
"changedBlocksCount": 5
},
"responseElements": {
"status": "completed"
},
"requestID": "be112233-1ba5-4ae0-8e2b-1c302EXAMPLE",
"eventID": "6e12345-2a4e-417c-aa78-7594fEXAMPLE",
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012"
}
ListSnapshotBlocks
{
"eventVersion": "1.08",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAT4HPB2AO3JEXAMPLE",
"arn": "arn:aws:iam::123456789012:user/user",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2021-06-03T00:32:46Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "ListSnapshotBlocks",
"awsRegion": "us-east-1",
"sourceIPAddress": "111.111.111.111",
"userAgent": "PostmanRuntime/7.28.0",
"requestParameters": {
"snapshotId": "snap-abcdef01234567890",
"maxResults": 100,
"startingBlockIndex": 0
},
"responseElements": null,
"requestID": "example6-0e12-4aa9-b923-1555eexample",
"eventID": "example4-218b-4f69-a9e0-2357dexample",
"readOnly": true,
"resources": [
{
"accountId": "123456789012",
"type": "AWS::EC2::Snapshot",
"ARN": "arn:aws:ec2:us-west-2::snapshot/snap-abcdef01234567890"
}
],
"eventType": "AwsApiCall",
"managementEvent": false,
"recipientAccountId": "123456789012",
"eventCategory": "Data",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-SHA",
"clientProvidedHostHeader": "ebs.us-west-2.amazonaws.com"
}
}
ListChangedBlocks
1666
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"eventVersion": "1.08",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAT4HPB2AO3JEXAMPLE",
"arn": "arn:aws:iam::123456789012:user/user",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2021-06-02T21:11:46Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "ListChangedBlocks",
"awsRegion": "us-east-1",
"sourceIPAddress": "111.111.111.111",
"userAgent": "PostmanRuntime/7.28.0",
"requestParameters": {
"firstSnapshotId": "snap-abcdef01234567890",
"secondSnapshotId": "snap-9876543210abcdef0",
"maxResults": 100,
"startingBlockIndex": 0
},
"responseElements": null,
"requestID": "example0-f4cb-4d64-8d84-72e1bexample",
"eventID": "example3-fac4-4a78-8ebb-3e9d3example",
"readOnly": true,
"resources": [
{
"accountId": "123456789012",
"type": "AWS::EC2::Snapshot",
"ARN": "arn:aws:ec2:us-west-2::snapshot/snap-abcdef01234567890"
},
{
"accountId": "123456789012",
"type": "AWS::EC2::Snapshot",
"ARN": "arn:aws:ec2:us-west-2::snapshot/snap-9876543210abcdef0"
}
],
"eventType": "AwsApiCall",
"managementEvent": false,
"recipientAccountId": "123456789012",
"eventCategory": "Data",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-SHA",
"clientProvidedHostHeader": "ebs.us-west-2.amazonaws.com"
}
}
GetSnapshotBlock
{
"eventVersion": "1.08",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAT4HPB2AO3JEXAMPLE",
"arn": "arn:aws:iam::123456789012:user/user",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2021-06-02T20:43:05Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "GetSnapshotBlock",
"awsRegion": "us-east-1",
"sourceIPAddress": "111.111.111.111",
1667
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
"userAgent": "PostmanRuntime/7.28.0",
"requestParameters": {
"snapshotId": "snap-abcdef01234567890",
"blockIndex": 1,
"blockToken": "EXAMPLEiL5E3pMPFpaDWjExM2/mnSKh1mQfcbjwe2mM7EwhrgCdPAEXAMPLE"
},
"responseElements": null,
"requestID": "examplea-6eca-4964-abfd-fd9f0example",
"eventID": "example6-4048-4365-a275-42e94example",
"readOnly": true,
"resources": [
{
"accountId": "123456789012",
"type": "AWS::EC2::Snapshot",
"ARN": "arn:aws:ec2:us-west-2::snapshot/snap-abcdef01234567890"
}
],
"eventType": "AwsApiCall",
"managementEvent": false,
"recipientAccountId": "123456789012",
"eventCategory": "Data",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-SHA",
"clientProvidedHostHeader": "ebs.us-west-2.amazonaws.com"
}
}
PutSnapshotBlock
{
"eventVersion": "1.08",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAT4HPB2AO3JEXAMPLE",
"arn": "arn:aws:iam::123456789012:user/user",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "user"
},
"eventTime": "2021-06-02T21:09:17Z",
"eventSource": "ebs.amazonaws.com",
"eventName": "PutSnapshotBlock",
"awsRegion": "us-east-1",
"sourceIPAddress": "111.111.111.111",
"userAgent": "PostmanRuntime/7.28.0",
"requestParameters": {
"snapshotId": "snap-abcdef01234567890",
"blockIndex": 1,
"dataLength": 524288,
"checksum": "exampleodSGvFSb1e3kxWUgbOQ4TbzPurnsfVexample",
"checksumAlgorithm": "SHA256"
},
"responseElements": {
"checksum": "exampleodSGvFSb1e3kxWUgbOQ4TbzPurnsfVexample",
"checksumAlgorithm": "SHA256"
},
"requestID": "example3-d5e0-4167-8ee8-50845example",
"eventID": "example8-4d9a-4aad-b71d-bb31fexample",
"readOnly": false,
"resources": [
{
"accountId": "123456789012",
"type": "AWS::EC2::Snapshot",
"ARN": "arn:aws:ec2:us-west-2::snapshot/snap-abcdef01234567890"
1668
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS snapshots
}
],
"eventType": "AwsApiCall",
"managementEvent": false,
"recipientAccountId": "123456789012",
"eventCategory": "Data",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-SHA",
"clientProvidedHostHeader": "ebs.us-west-2.amazonaws.com"
}
}
Yes. The block indexes returned are unique, and in numerical order.
Can I submit a request with a MaxResults parameter value of under 100?
No. The minimum MaxResult parameter value you can use is 100. If you submit a request with a
MaxResult parameter value of under 100, and there are more than 100 blocks in the snapshot, then
the API will return at least 100 results.
Can I run API requests concurrently?
You can run API requests concurrently. Be sure to take note of other workloads that might be
running in the account to avoid bottlenecks. You should also build retry mechanisms into your
EBS direct APIs workflows to handle throttling, timeouts, and service unavailability. For more
information, see Optimize performance (p. 1659).
Review the EBS direct APIs service quotas to determine the API requests that you can run per
second. For more information, see Amazon Elastic Block Store Endpoints and Quotas in the AWS
General Reference.
When running the ListChangedBlocks action, is it possible to get an empty response even though
there are blocks in the snapshot?
Yes. If the changed blocks are scarce in the snapshot, the response may be empty but the API will
return a next page token value. Use the next page token value to continue to the next page of
results. You can confirm that you have reached the last page of results when the API returns a next
page token value of null.
If the NextToken parameter is specified together with a StartingBlockIndex parameter, which of the
two is used?
Block tokens are valid for seven days, and next tokens are valid for 60 minutes.
Are encrypted snapshots supported?
Yes. Encrypted snapshots can be accessed using the EBS direct APIs.
To access an encrypted snapshot, the user must have access to the KMS key used to encrypt the
snapshot, and the AWS KMS decrypt action. See the IAM permissions for EBS direct APIs (p. 1640)
section earlier in this guide for the AWS KMS policy to assign to a user.
1669
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
It returns only block indexes and tokens that have data written to them.
Can I get a history of the API calls made by the EBS direct APIs on my account for security analysis
and operational troubleshooting purposes?
Yes. To receive a history of EBS direct APIs API calls made on your account, turn on AWS CloudTrail in
the AWS Management Console. For more information, see Log API Calls for EBS direct APIs with AWS
CloudTrail (p. 1663).
For more information, see Amazon Data Lifecycle Manager (p. 1670).
When combined with the monitoring features of Amazon CloudWatch Events and AWS CloudTrail,
Amazon Data Lifecycle Manager provides a complete backup solution for Amazon EC2 instances and
individual EBS volumes at no additional cost.
Important
Amazon Data Lifecycle Manager cannot be used to manage snapshots or AMIs that are created
by any other means.
Amazon Data Lifecycle Manager cannot be used to automate the creation, retention, and
deletion of instance store-backed AMIs.
Contents
• How Amazon Data Lifecycle Manager works (p. 1671)
• Quotas (p. 1673)
• Automate snapshot lifecycles (p. 1673)
• Automate AMI lifecycles (p. 1686)
• Automate cross-account snapshot copies (p. 1692)
• View, modify, and delete lifecycle policies (p. 1700)
• AWS Identity and Access Management (p. 1704)
• Monitor the lifecycle of snapshots and AMIs (p. 1712)
1670
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Elements
• Snapshots (p. 1671)
• EBS-backed AMIs (p. 1671)
• Target resource tags (p. 1671)
• Amazon Data Lifecycle Manager tags (p. 1671)
• Lifecycle policies (p. 1672)
• Policy schedules (p. 1672)
Snapshots
Snapshots are the primary means to back up data from your EBS volumes. To save storage costs,
successive snapshots are incremental, containing only the volume data that changed since the previous
snapshot. When you delete one snapshot in a series of snapshots for a volume, only the data that's
unique to that snapshot is removed. The rest of the captured history of the volume is preserved. For
more information, see Amazon EBS snapshots (p. 1569).
EBS-backed AMIs
An Amazon Machine Image (AMI) provides the information that's required to launch an instance. You
can launch multiple instances from a single AMI when you need multiple instances with the same
configuration. Amazon Data Lifecycle Manager supports EBS-backed AMIs only. EBS-backed AMIs include
a snapshot for each EBS volume that's attached to the source instance. For more information, see
Amazon Machine Images (AMI) (p. 21).
If you want to run multiple policies on a resource, you can assign multiple tags to the target resource,
and then create separate policies that each target a specific resource tag.
You can't use the \ or = characters in a tag key. Target resource tags are case sensitive. For more
information, see Tag your Amazon EC2 resources (p. 1894).
• aws:dlm:lifecycle-policy-id
• aws:dlm:lifecycle-schedule-name
• aws:dlm:expirationTime — For snapshots created by an age-based schedule. Indicates when the
snapshot is to be deleted from the standard tier.
• aws:dlm:managed
• aws:dlm:archived — For snapshots that were archived by a schedule.
1671
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
You can also specify custom tags to be applied to snapshots and AMIs on creation. You can't use the \ or
= characters in a tag key.
The target tags that Amazon Data Lifecycle Manager uses to associate volumes with a snapshot policy
can optionally be applied to snapshots created by the policy. Similarly, the target tags that are used to
associate instances with an AMI policy can optionally be applied to AMIs created by the policy.
Lifecycle policies
A lifecycle policy consists of these core settings:
• Policy type—Defines the type of resources that the policy can manage. Amazon Data Lifecycle
Manager supports the following types of lifecycle policies:
• Snapshot lifecycle policy—Used to automate the lifecycle of EBS snapshots. These policies can
target individual EBS volumes or all EBS volumes attached to an instance.
• EBS-backed AMI lifecycle policy—Used to automate the lifecycle of EBS-backed AMIs and their
backing snapshots. These policies can target instances only.
• Cross-account copy event policy—Used to automate snapshot copies across accounts. Use this policy
type in conjunction with an EBS snapshot policy that shares snapshots across accounts.
• Resource type—Defines the type of resources that are targeted by the policy. Snapshot lifecycle
policies can target instances or volumes. Use VOLUME to create snapshots of individual volumes, or use
INSTANCE to create multi-volume snapshots of all of the volumes that are attached to an instance. For
more information, see Multi-volume snapshots (p. 1575). AMI lifecycle policies can target instances
only. One AMI is created that includes snapshots of all of the volumes that are attached to the target
instance.
• Target tags—Specifies the tags that must be assigned to an EBS volume or an Amazon EC2 instance
for it to be targeted by the policy.
• Policy schedules(Snapshot and AMI policies only)—Define when snapshots or AMIs are to be created
and how long to retain them for. For more information, see Policy schedules (p. 1672).
For example, you could create a policy with settings similar to the following:
• Manages all EBS volumes that have a tag with a key of account and a value of finance.
• Creates snapshots every 24 hours at 0900 UTC.
• Retains only the five most recent snapshots.
• Starts snapshot creation no later than 0959 UTC each day.
Policy schedules
Policy schedules define when snapshots or AMIs are created by the policy. Policies can have up to four
schedules—one mandatory schedule, and up to three optional schedules.
Adding multiple schedules to a single policy lets you create snapshots or AMIs at different frequencies
using the same policy. For example, you can create a single policy that creates daily, weekly, monthly,
and yearly snapshots. This eliminates the need to manage multiple policies.
For each schedule, you can define the frequency, fast snapshot restore settings (snapshot lifecycle
policies only), cross-Region copy rules, and tags. The tags that are assigned to a schedule are
automatically assigned to the snapshots or AMIs that are created when the schedule is initiated. In
addition, Amazon Data Lifecycle Manager automatically assigns a system-generated tag based on the
schedule's frequency to each snapshot or AMI.
Each schedule is initiated individually based on its frequency. If multiple schedules are initiated at the
same time, Amazon Data Lifecycle Manager creates only one snapshot or AMI and applies the retention
1672
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
settings of the schedule that has the highest retention period. The tags of all of the initiated schedules
are applied to the snapshot or AMI.
• (Snapshot lifecycle policies only) If more than one of the initiated schedules is enabled for fast
snapshot restore, then the snapshot is enabled for fast snapshot restore in all of the Availability Zones
specified across all of the initiated schedules. The highest retention settings of the initiated schedules
is used for each Availability Zone.
• If more than one of the initiated schedules is enabled for cross-Region copy, the snapshot or AMI is
copied to all Regions specified across all of the initiated schedules. The highest retention period of the
initiated schedules is applied.
Quotas
Your AWS account has the following quotas related to Amazon Data Lifecycle Manager:
Description Quota
Topics
• Create a snapshot lifecycle policy (p. 1673)
• Considerations for snapshot lifecycle policies (p. 1682)
• Additional resources (p. 1686)
Console
a. For Target resource types, choose the type of resource to back up. Choose Volume to
create snapshots of individual volumes, or choose Instance to create multi-volume
snapshots from the volumes attached to an instance.
b. (For AWS Outpost customers only) For Target resource location, specify where the target
resources are located.
• If the target resources are located in an AWS Region, choose AWS Region. Amazon Data
Lifecycle Manager backs up all resources of the specified type that have matching target
1673
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
tags in the current Region only. If the resource is located in a Region, snapshots created
by the policy will be stored in the same Region.
• If the target resources are located on an Outpost in your account, choose AWS Outpost.
Amazon Data Lifecycle Manager backs up all resources of the specified type that have
matching target tags across all of the Outposts in your account. If the resource is located
on an Outpost, snapshots created by the policy can be stored in the same Region or on
the same Outpost as the resource.
• If you do not have any Outposts in your account, this option is hidden and AWS Region is
selected for you.
c. For Target resource tags, choose the resource tags that identify the volumes or instances to
back up. Only resources that have the specified tag key and value pairs are backed up by the
policy.
5. For Description, enter a brief description for the policy.
6. For IAM role, choose the IAM role that has permissions to manage snapshots and to describe
volumes and instances. To use the default role provided by Amazon Data Lifecycle Manager.
choose Default role. Alternatively, to use a custom IAM role that you previously created, choose
Choose another role and then select the role to use.
7. For Policy tags, add the tags to apply to the lifecycle policy. You can use these tags to identify
and categorize your policies.
8. For Policy status, choose Enable to start the policy runs at the next scheduled time, or Disable
policy to prevent the policy from running. If you do not enable the policy now, it will not start
creating snapshots until you manually enable it after creation.
9. (Only for policies that target instances) By default, Amazon Data Lifecycle Manager will create
snapshots of all the volumes attached to targeted instances. However, you can choose to create
snapshots of a subset of the attached volumes. In the Parameters section, do the following:
• If you do not want to create snapshots of the root volumes attached to the targeted
instances, select Exclude root volume. If you select this option, only the data (non-root)
volumes that are attached to targeted instances will be included in the multi-volume
snapshot sets.
• If you want to create snapshots of a subset of the data (non-root) volumes attached to the
targeted instances, select Exclude specific data volumes, and then specify the tags that
are to be used to identify the data volumes that should not be snapshotted. Amazon Data
Lifecycle Manager will not create snapshots of data volumes that have any of the specified
tags. Amazon Data Lifecycle Manager will create snapshots only of data volumes that do not
have any of the specified tags.
10. Choose Next.
11. On the Configure schedule screen, configure the policy schedules. A policy can have up to 4
schedules. Schedule 1 is mandatory. Schedules 2, 3, and 4 are optional. For each policy schedule
that you add, do the following:
1674
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
count-based schedule, the retention count for the archive tier must be 4 or
more.
iii. For Starting at, specify the time at which the policy runs are scheduled to start. The
first policy run starts within an hour after the scheduled time. The time must be
entered in the hh:mm UTC format.
iv. For Retention type, specify the retention policy for snapshots created by the schedule.
You can retain snapshots based on either their total count or their age.
Note
• All schedules must have the same retention type (age-based or count-
based). You can specify the retention type for Schedule 1 only. Schedules 2,
3, and 4 inherit the retention type from Schedule 1. Each schedule can have
its own retention count or period.
• If you enable fast snapshot restore, cross-Region copy, or snapshot sharing,
then you must specify a retention count of 1 or more, or a retention period
of 1 day or longer.
• If you enable snapshot archiving, this retention rule determines how long
the snapshot remains in the standard tier before being archived. Once the
standard tier retention threshold is met, the snapshot is converted to a full
snapshot and it is moved to the archive tier.
v. (For AWS Outposts customers only) For Snapshot destination, specify the destination
for snapshots created by the policy.
• If the policy targets resources in a Region, snapshots must be created in the same
Region. AWS Region is selected for you.
• If the policy targets resources on an Outpost, you can choose to create snapshots on
the same Outpost as the source resource, or in the Region that is associated with the
Outpost.
• If you do not have any Outposts in your account, this option is hidden and AWS
Region is selected for you.
b. In the Tagging section, do the following:
i. To copy all of the user-defined tags from the source volume to the snapshots created
by the schedule, select Copy tags from source.
ii. To specify additional tags to assign to snapshots created by this schedule, choose Add
tags.
c. (Only for policies that target volumes) In the Snapshot archiving section, do the following:
Note
You can enable snapshot archiving for only one schedule in a policy.
i. To enable snapshot archiving for the schedule, select Archive snapshots created by
this schedule.
1675
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Note
You can enable snapshot archiving only if the snapshot creation frequency is
monthly or yearly, or if you specify a cron expression with a creation frequency
of at least 28 days.
ii. Specify the retention rule for snapshots in the archive tier.
• For count-based schedules, specify the number of snapshots to retain in the archive
tier. When the retention threshold is reached, the oldest snapshot is permanently
deleted from the archive tier. For example, if you specify 3, the schedule will retain
a maximum of 3 snapshots in the archive tier. When the fourth snapshot is archived,
the oldest of the three existing snapshots in the archive tier is deleted.
• For age-based schedules, specify the time period for which to retain snapshots in
the archive tier. When the retention threshold is reached, the oldest snapshot is
permanently deleted from the archive tier. For example, if you specify 120 days, the
schedule will automatically delete snapshots from the archive tier when they reach
that age.
Important
The minimum retention period for archived snapshots is 90 days. You must
specify a retention rule that retains the snapshot for at least 90 days.
d. To enable fast snapshot restore for snapshots created by the schedule, in the Fast snapshot
restore section, select Enable fast snapshot restore. If you enable fast snapshot restore,
you must choose the Availability Zones in which to enable it. If the schedule uses an age-
based retention schedule, you must specify the period for which to enable fast snapshot
restore for each snapshot. If the schedule uses count-based retention, you must specify the
maximum number of snapshots to enable for fast snapshot restore.
If the schedule creates snapshots on an Outpost, you can't enable fast snapshot restore.
Fast snapshot restore is not supported with local snapshots that are stored on an Outpost.
Note
You are billed for each minute that fast snapshot restore is enabled for a snapshot
in a particular Availability Zone. Charges are pro-rated with a minimum of one
hour.
e. To copy snapshots created by the schedule to an Outpost or to a different Region, in the
Cross-Region copy section, select Enable cross-Region copy.
If the schedule creates snapshots in a Region, you can copy the snapshots to up to three
additional Regions or Outposts in your account. You must specify a separate cross-Region
copy rule for each destination Region or Outpost.
For each Region or Outpost, you can choose different retention policies and you can choose
whether to copy all tags or no tags. If the source snapshot is encrypted, or if encryption
by default is enabled, the copied snapshots are encrypted. If the source snapshot is
unencrypted, you can enable encryption. If you do not specify a KMS key, the snapshots are
encrypted using the default KMS key for EBS encryption in each destination Region. If you
specify a KMS key for the destination Region, then the selected IAM role must have access
to the KMS key.
Note
You must ensure that you do not exceed the number of concurrent snapshot copies
per Region.
If the policy creates snapshots on an Outpost, then you can't copy the snapshots to a
Region or to another Outpost and the cross-Region copy settings are not available.
1676
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
f. In the Cross-account sharing, configure the policy to automatically share the snapshots
created by the schedule with other AWS accounts. Do the following:
i. To enable sharing with other AWS accounts, select Enable cross-account sharing.
ii. To add the accounts with which to share the snapshots, choose Add account, enter the
12-digit AWS account ID, and choose Add.
iii. To automatically unshare shared snapshots after a specific period, selectUnshare
automatically. If you choose to automatically unshare shared snapshots, the period
after which to automatically unshare the snapshots cannot be longer than the period
for which the policy retains its snapshots. For example, if the policy's retention
configuration retains snapshots for a period of 5 days, you can configure the policy
to automatically unshare shared snapshots after periods up to 4 days. This applies to
policies with age-based and count-based snapshot retention configurations.
If you do not enable automatic unsharing, the snapshot is shared until it is deleted.
Note
You can only share snapshots that are unencrypted or that are encrypted using
a customer managed key. You can't share snapshots that are encrypted with
the default EBS encryption KMS key. If you share encrypted snapshots, then
you must also share the KMS key that was used to encrypt the source volume
with the target accounts. For more information, see Allowing users in other
accounts to use a KMS key in the AWS Key Management Service Developer
Guide.
g. To add additional schedules, choose Add another schedule, which is located at the top of
the screen. For each additional schedule, complete the fields as described previously in this
topic.
h. After you have added the required schedules, choose Review policy.
12. Review the policy summary, and then choose Create policy.
Command line
Use the create-lifecycle-policy command to create a snapshot lifecycle policy. For PolicyType,
specify EBS_SNAPSHOT_MANAGEMENT.
Note
To simplify the syntax, the following examples use a JSON file, policyDetails.json,
that includes the policy details.
This example creates a snapshot lifecycle policy that creates snapshots of all volumes that have a
tag key of costcenter with a value of 115. The policy includes two schedules. The first schedule
creates a snapshot every day at 03:00 UTC. The second schedule creates a weekly snapshot every
Friday at 17:00 UTC.
{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": [
1677
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"VOLUME"
],
"TargetTags": [{
"Key": "costcenter",
"Value": "115"
}],
"Schedules": [{
"Name": "DailySnapshots",
"TagsToAdd": [{
"Key": "type",
"Value": "myDailySnapshot"
}],
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"RetainRule": {
"Count": 5
},
"CopyTags": false
},
{
"Name": "WeeklySnapshots",
"TagsToAdd": [{
"Key": "type",
"Value": "myWeeklySnapshot"
}],
"CreateRule": {
"CronExpression": "cron(0 17 ? * FRI *)"
},
"RetainRule": {
"Count": 5
},
"CopyTags": false
}
]}
If the request succeeds, the command returns the ID of the newly created policy. The following is
example output.
{
"PolicyId": "policy-0123456789abcdef0"
}
Example 2—Snapshot lifecycle policy that targets instances and creates snapshots of a subset of
data (non-root) volumes
This example creates a snapshot lifecycle policy that creates multi-volume snapshot sets from
instances tagged with code=production. The policy includes only one schedule. The schedule does
not create snapshots of the data volumes that are tagged with code=temp.
1678
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": [
"INSTANCE"
],
"TargetTags": [{
"Key": "code",
"Value": "production"
}],
"Parameters": {
"ExcludeDataVolumeTags": [{
"Key": "code",
"Value": "temp"
}]
},
"Schedules": [{
"Name": "DailySnapshots",
"TagsToAdd": [{
"Key": "type",
"Value": "myDailySnapshot"
}],
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"RetainRule": {
"Count": 5
},
"CopyTags": false
}
]}
If the request succeeds, the command returns the ID of the newly created policy. The following is
example output.
{
"PolicyId": "policy-0123456789abcdef0"
}
Example 3—Snapshot lifecycle policy that automates local snapshots of Outpost resources
This example creates a snapshot lifecycle policy that creates snapshots of volumes tagged with
team=dev across all of your Outposts. The policy creates the snapshots on the same Outposts as the
source volumes. The policy creates snapshots every 12 hours starting at 00:00 UTC.
{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": "VOLUME",
"ResourceLocations": "OUTPOST",
1679
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"TargetTags": [{
"Key": "team",
"Value": "dev"
}],
"Schedules": [{
"Name": "on-site backup",
"CreateRule": {
"Interval": 12,
"IntervalUnit": "HOURS",
"Times": [
"00:00"
],
"Location": [
"OUTPOST_LOCAL"
]
},
"RetainRule": {
"Count": 1
},
"CopyTags": false
}
]}
Example 4—Snapshot lifecycle policy that creates snapshots in a Region and copies them to an
Outpost
The following example policy creates snapshots of volumes that are tagged with team=dev.
Snapshots are created in the same Region as the source volume. Snapshots are created every
12 hours starting at 00:00 UTC, and retains a maximum of 1 snapshot. The policy also copies
the snapshots to Outpost arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef0, encrypts the copied snapshots using the default encryption KMS key, and
retains the copies for 1 month.
{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": "VOLUME",
"ResourceLocations": "CLOUD",
"TargetTags": [{
"Key": "team",
"Value": "dev"
}],
"Schedules": [{
"Name": "on-site backup",
"CopyTags": false,
"CreateRule": {
"Interval": 12,
"IntervalUnit": "HOURS",
"Times": [
"00:00"
],
"Location": "CLOUD"
},
"RetainRule": {
1680
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"Count": 1
},
"CrossRegionCopyRules" : [
{
"Target": "arn:aws:outposts:us-east-1:123456789012:outpost/
op-1234567890abcdef0",
"Encrypted": true,
"CopyTags": true,
"RetainRule": {
"Interval": 1,
"IntervalUnit": "MONTHS"
}
}]
}
]}
This example creates a snapshot lifecycle policy that targets volumes tagged with Name=Prod. The
policy has one age-based schedule that creates snapshots on the first day of each month at 09:00.
The schedule retains each snapshot in the standard tier for one day, after which it moves them to
the archive tier. Snapshots are stored in the archive tier for 90 days before being deleted.
{
"ResourceTypes": [ "VOLUME"],
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"Schedules" : [
{
"Name": "sched1",
"TagsToAdd": [
{"Key":"createdby","Value":"dlm"}
],
"CreateRule": {
"CronExpression": "cron(0 9 1 * ? *)"
},
"CopyTags": true,
"RetainRule":{
"Interval": 1,
"IntervalUnit": "DAYS"
},
"ArchiveRule": {
"RetainRule":{
"RetentionArchiveTier": {
"Interval": 90,
"IntervalUnit": "DAYS"
}
}
}
}
],
"TargetTags": [
{
"Key": "Name",
"Value": "Prod"
1681
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
}
]
}
This example creates a snapshot lifecycle policy that targets volumes tagged with Purpose=Test.
The policy has one count-based schedule that creates snapshots on the first day of each month at
09:00. The schedule archives snapshots immediately after creation and retains a maximum of three
snapshots in the archive tier.
{
"ResourceTypes": [ "VOLUME"],
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"Schedules" : [
{
"Name": "sched1",
"TagsToAdd": [
{"Key":"createdby","Value":"dlm"}
],
"CreateRule": {
"CronExpression": "cron(0 9 1 * ? *)"
},
"CopyTags": true,
"RetainRule":{
"Count": 0
},
"ArchiveRule": {
"RetainRule":{
"RetentionArchiveTier": {
"Count": 3
}
}
}
}
],
"TargetTags": [
{
"Key": "Purpose",
"Value": "Test"
}
]
}
• Snapshot lifecycle policies target only instances or volumes that are in the same Region as the policy.
• The first snapshot creation operation starts within one hour after the specified start time. Subsequent
snapshot creation operations start within one hour of their scheduled time.
1682
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
• You can create multiple policies to back up a volume or instance. For example, if a volume has two
tags, where tag A is the target for policy A to create a snapshot every 12 hours, and tag B is the target
for policy B to create a snapshot every 24 hours, Amazon Data Lifecycle Manager creates snapshots
according to the schedules for both policies. Alternatively, you can achieve the same result by creating
a single policy that has multiple schedules. For example, you can create a single policy that targets
only tag A, and specify two schedules — one for every 12 hours and one for every 24 hours.
• Target resource tags are case sensitive.
• If you remove the target tags from a resource that is targeted by a policy, Amazon Data Lifecycle
Manager no longer manages existing snapshots in the standard tier and archive tier; you must
manually delete them if they are no longer needed.
• If you create a policy that targets instances, and new volumes are attached to a target instance after
the policy has been created, the newly-added volumes are included in the backup at the next policy
run. All volumes attached to the instance at the time of the policy run are included.
• If you create a policy with a custom cron-based schedule that is configured to create only one
snapshot, the policy will not automatically delete that snapshot when the retention threshold is
reached. You must manually delete the snapshot if it is no longer needed.
• If you create an age-based policy where the retention period is shorter than the creation frequency,
Amazon Data Lifecycle Manager will always retain the last snapshot until the next one is created.
For example, if an age-based policy creates one snapshot every month with a retention period of
seven days, Amazon Data Lifecycle Manager will retain each snapshot for one month, even though the
retention period is seven days.
• You can enable snapshot archiving only for snapshot policies that target volumes.
• You can specify an archiving rule for only one schedule for each policy.
• If you are using the console, you can enable snapshot archiving only if the schedule has a monthly or
yearly creation frequency, or if the schedule has a cron expression with a creation frequency of at least
28 days.
If you are using the AWS CLI, AWS API, or AWS SDK, you can enable snapshot archiving only if the
schedule has a cron expression with a creation frequency of at least 28 days.
• The minimum retention period in the archive tier is 90 days.
• When a snapshot is archived, it is converted to a full snapshot when it is moved to the archive tier. This
could result in higher snapshot storage costs. For more information, see Pricing and billing (p. 1599).
• Fast snapshot restore and snapshot sharing are disabled for snapshots when they are archived.
• If, in the case of a leap year, your retention rule results in an archive retention period of less than 90
days, Amazon Data Lifecycle Manager ensures that snapshots are retained for the minimum 90-day
period.
• If you manually archive a snapshot created by Amazon Data Lifecycle Manager, and the snapshot is
still archived when the schedule's retention threshold is reached, Amazon Data Lifecycle Manager no
longer manages that snapshot. However, if you restore the snapshot to the standard tier before the
schedule's retention threshold is reached, the schedule will continue to manage the snapshot as per
the retention rules.
• If you permanently or temporarily restore a snapshot archived by Amazon Data Lifecycle Manager to
the standard tier, and the snapshot is still in the standard tier when the schedule's retention threshold
is reached, Amazon Data Lifecycle Manager no longer manages the snapshot. However, if you re-
archive the snapshot before the schedule's retention threshold is reached, the schedule will delete the
snapshot when the retention threshold is met.
• Snapshots archived by Amazon Data Lifecycle Manager count towards your Archived snapshots
per volume and In-progress snapshot archives per account quotas.
• If a schedule is unable to archive a snapshot after retrying for 24 hours, the snapshot remains in
the standard tier and it is scheduled for deletion based on the time that it would have been deleted
1683
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
from the archive tier. For example, if the schedule archives snapshots for 120 days, it remains in the
standard tier for 120 days after the failed archiving before being permanently deleted. For count-
based schedules, the snapshot does not count towards the schedule's retention count.
• Snapshots must be archived in the same Region in which they were created. If you enabled cross-
Region copy and snapshot archiving, Amazon Data Lifecycle Manager does not archive the snapshot
copy.
• Snapshots archived by Amazon Data Lifecycle Manager are tagged with the
aws:dlm:archived=true system tag. Additionally, snapshots created by an archive-enabled, age-
based schedule are tagged with the aws:dlm:expirationTime system tag, which indicates the date
and time at which the snapshot is scheduled to be archived.
The following considerations apply to excluding root volumes and data (non-root) volumes:
• If you choose to exclude boot volumes and you specify tags that consequently exclude all of the
additional data volumes attached to an instance, then Amazon Data Lifecycle Manager will not create
any snapshots for the affected instance, and it will emit a SnapshotsCreateFailed CloudWatch
metric. For more information, see Monitor your policies using CloudWatch.
The following considerations apply to deleting volumes or terminating instances targeted by snapshot
lifecycle policies:
• If you delete a volume or terminate an instance targeted by a policy with a count-based retention
schedule, Amazon Data Lifecycle Manager no longer manages snapshots in the standard tier and
archive tier that were created from the deleted volume or instance. You must manually delete those
earlier snapshots if they are no longer needed.
• If you delete a volume or terminate an instance targeted by a policy with an age-based retention
schedule, the policy continues to delete snapshots from the standard tier and archive tier that were
created from the deleted volume or instance on the defined schedule, up to, but not including, the last
snapshot. You must manually delete the last snapshot if it is no longer needed.
The following considerations apply to snapshot lifecycle policies and fast snapshot restore (p. 1745):
• Amazon Data Lifecycle Manager can enable fast snapshot restore only for snapshots with a size of 16
TiB or less. For more information, see Amazon EBS fast snapshot restore (p. 1745).
• A snapshot that is enabled for fast snapshot restore remains enabled even if you delete or disable the
policy, disable fast snapshot restore for the policy, or disable fast snapshot restore for the Availability
Zone. You must disable fast snapshot restore for these snapshots manually.
• If you enable fast snapshot restore for a policy and you exceed the maximum number of snapshots
that can be enabled for fast snapshot restore, Amazon Data Lifecycle Manager creates snapshots as
scheduled but does not enable them for fast snapshot restore. After a snapshot that is enabled for fast
snapshot restore is deleted, the next snapshot that Amazon Data Lifecycle Manager creates is enabled
for fast snapshot restore.
• When fast snapshot restore is enabled for a snapshot, it takes 60 minutes per TiB to optimize the
snapshot. We recommend that you configure your schedules so that each snapshot is fully optimized
before Amazon Data Lifecycle Manager creates the next snapshot.
• If you enable fast snapshot restore for a policy that targets instances, Amazon Data Lifecycle Manager
enables fast snapshot restore for each snapshot in the multi-volume snapshot set individually. If
Amazon Data Lifecycle Manager fails to enable fast snapshot restore for one of the snapshots in the
multi-volume snapshot set, it will still attempt to enable fast snapshot restore for the remaining
snapshots in the snapshot set.
• You are billed for each minute that fast snapshot restore is enabled for a snapshot in a particular
Availability Zone. Charges are pro-rated with a minimum of one hour. For more information, see
Pricing and Billing (p. 1749).
1684
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Note
Depending on the configuration of your lifecycle policies, you could have multiple snapshots
enabled for fast snapshot restore in multiple Availability Zones simultaneously.
• You can only share snapshots that are unencrypted or that are encrypted using a customer managed
key.
• You can't share snapshots that are encrypted with the default EBS encryption KMS key.
• If you share encrypted snapshots, you must also share the KMS key that was used to encrypt the
source volume with the target accounts. For more information, see Allowing users in other accounts to
use a KMS key in the AWS Key Management Service Developer Guide.
The following considerations apply to snapshots policies and snapshot archiving (p. 1597):
• If you manually archive a snapshot that was created by a policy, and that snapshot is in the archive
tier when the policy’s retention threshold is reached, Amazon Data Lifecycle Manager will not delete
the snapshot. Amazon Data Lifecycle Manager does not manage snapshots while they are stored in
the archive tier. If you no longer need snapshots that are stored in the archive tier, you must manually
delete them.
The following considerations apply to snapshot policies and Recycle Bin (p. 1854):
• If Amazon Data Lifecycle Manager deletes a snapshot and sends it to the Recycle Bin when the policy's
retention threshold is reached, and you manually restore the snapshot from the Recycle Bin, you must
manually delete that snapshot when it is no longer needed. Amazon Data Lifecycle Manager will no
longer manage the snapshot.
• If you manually delete a snapshot that was created by a policy, and that snapshot is in the Recycle Bin
when the policy’s retention threshold is reached, Amazon Data Lifecycle Manager will not delete the
snapshot. Amazon Data Lifecycle Manager does not manage the snapshots while they are stored in the
Recycle Bin.
If the snapshot is restored from the Recycle Bin before the policy's retention threshold is reached,
Amazon Data Lifecycle Manager will delete the snapshot when the policy's retention threshold is
reached.
If the snapshot is restored from the Recycle Bin after the policy's retention threshold is reached,
Amazon Data Lifecycle Manager will no longer delete the snapshot. You must manually delete the
snapshot when it is no longer needed.
The following considerations apply to snapshot lifecycle policies that are in the error state:
• For policies with age-based retention schedules, snapshots that are set to expire while the policy is
in the error state are retained indefinitely. You must delete the snapshots manually. When you re-
enable the policy, Amazon Data Lifecycle Manager resumes deleting snapshots as their retention
periods expire.
• For policies with count-based retention schedules, the policy stops creating and deleting snapshots
while it is in the error state. When you re-enable the policy, Amazon Data Lifecycle Manager resumes
creating snapshots, and it resumes deleting snapshots as the retention threshold is met.
1685
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Additional resources
For more information, see the Automating Amazon EBS snapshot and AMI management using Amazon
Data Lifecycle Manager AWS storage blog.
Topics
• Create an AMI lifecycle policy (p. 1686)
• Considerations for AMI lifecycle policies (p. 1690)
• Additional resources (p. 1692)
Console
1686
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
ii. For Frequency and the related fields, configure the interval between policy runs. You
can configure policy runs on a daily, weekly, monthly, or yearly schedule. Alternatively,
choose Custom cron expression to specify an interval of up to one year. For more
information, see Cron expressions in the Amazon CloudWatch Events User Guide.
iii. For Starting at, specify the time to start the policy runs. The first policy run starts
within an hour after the time that you schedule. You must enter the time in the hh:mm
UTC format.
iv. For Retention type, specify the retention policy for AMIs created by the schedule. You
can retain AMIs based on either their total count or their age.
For count-based retention, the range is 1 to 1000. After the maximum count is reached,
the oldest AMI is deregistered when a new one is created.
For age-based retention, the range is 1 day to 100 years. After the retention period of
each AMI expires, it is deregistered.
Note
All schedules must have the same retention type. You can specify the retention
type for Schedule 1 only. Schedules 2, 3, and 4 inherit the retention type from
Schedule 1. Each schedule can have its own retention count or period.
b. In the Tagging section, do the following:
i. To copy all of the user-defined tags from the source instance to the AMIs created by the
schedule, select Copy tags from source.
ii. By default, AMIs created by the schedule are automatically tagged with the ID of the
source instance. To prevent this automatic tagging from happening, for Variable tags,
remove the instance-id:$(instance-id) tile.
iii. To specify additional tags to assign to AMIs created by this schedule, choose Add tags.
c. To deprecate AMIs when they should no longer be used, in the AMI deprecation section,
select Enable AMI deprecation for this schedule and then specify the AMI deprecation rule.
The AMI deprecation rule specifies when AMIs are to be deprecated.
If the schedule uses count-based AMI retention, you must specify the number of oldest
AMIs to deprecate. The deprecation count must be less than or equal to the schedule's
AMI retention count, and it can't be greater than 1000. For example, if the schedule is
configured to retain a maximum of 5 AMIs, then you can configure the scheduled to
deprecate up to old 5 oldest AMIs.
If the schedule uses age-based AMI retention, you must specify the period after which AMIs
are to be deprecated. The deprecation count must be less than or equal to the schedule's
AMI retention period, and it can't be greater than 10 years (120 months, 520 weeks, or
3650 days). For example, if the schedule is configured to retain AMIs for 10 days, then you
can configure the scheduled to deprecate AMIs after periods up to 10 days after creation.
d. To copy AMIs created by the schedule to different Regions, in the Cross-Region copy
section, select Enable cross-Region copy. You can copy AMIs to up to three additional
Regions in your account. You must specify a separate cross-Region copy rule for each
destination Region.
• A retention policy for the AMI copy. When the retention period expires, the copy in the
destination Region is automatically deregistered.
• Encryption status for the AMI copy. If the source AMI is encrypted, or if encryption
by default is enabled, the copied AMIs are always encrypted. If the source AMI is
unencrypted and encryption by default is disabled, you can optionally enable encryption.
If you do not specify a KMS key, the AMIs are encrypted using the default KMS key for
1687
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
EBS encryption in each destination Region. If you specify a KMS key for the destination
Region, then the selected IAM role must have access to the KMS key.
• A deprecation rule for the AMI copy. When the deprecation period expires, the AMI copy is
automatically deprecated. The deprecation period must be less than or equal to the copy
retention period, and it can't be greater than 10 years.
• Whether to copy all tags or no tags from the source AMI.
Note
Do not exceed the number of concurrent AMI copies per Region.
e. To add additional schedules, choose Add another schedule, which is located at the top of
the screen. For each additional schedule, complete the fields as described previously in this
topic.
f. After you have added the required schedules, choose Review policy.
12. Review the policy summary, and then choose Create policy.
Command line
Use the create-lifecycle-policy command to create an AMI lifecycle policy. For PolicyType, specify
IMAGE_MANAGEMENT.
Note
To simplify the syntax, the following examples use a JSON file, policyDetails.json,
that includes the policy details.
This example creates an AMI lifecycle policy that creates AMIs of all instances that have a tag key of
purpose with a value of production without rebooting the targeted instances. The policy includes
one schedule that creates an AMI every day at 01:00 UTC. The policy retains AMIs for 2 days and
deprecates them after 1 day. It also copies the tags from the source instance to the AMIs that it
creates.
{
"PolicyType": "IMAGE_MANAGEMENT",
"ResourceTypes": [
"INSTANCE"
],
"TargetTags": [{
"Key": "purpose",
"Value": "production"
}],
"Schedules": [{
"Name": "DailyAMIs",
"TagsToAdd": [{
"Key": "type",
"Value": "myDailyAMI"
}],
"CreateRule": {
"Interval": 24,
1688
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"IntervalUnit": "HOURS",
"Times": [
"01:00"
]
},
RetainRule":{
"Interval" : 2,
"IntervalUnit" : "DAYS"
},
DeprecateRule": {
"Interval" : 1,
"IntervalUnit" : "DAYS"
},
"CopyTags": true
}
],
"Parameters" : {
"NoReboot":true
}
}
If the request succeeds, the command returns the ID of the newly created policy. The following is
example output.
{
"PolicyId": "policy-9876543210abcdef0"
}
This example creates an AMI lifecycle policy that creates AMIs of all instances that have a tag key
of purpose with a value of production and reboots the target instances. The policy includes one
schedule that creates an AMI every 6 hours starting at 17:30 UTC. The policy retains 3 AMIs and
automatically deprecates the 2 oldest AMIs. It also has a cross-Region copy rule that copies AMIs to
us-east-1, retains 2 AMI copies, and automatically deprecates the oldest AMI.
{
"PolicyType": "IMAGE_MANAGEMENT",
"ResourceTypes" : [
"INSTANCE"
],
"TargetTags": [{
"Key":"purpose",
"Value":"production"
}],
"Parameters" : {
"NoReboot": true
},
"Schedules" : [{
"Name" : "Schedule1",
"CopyTags": true,
"CreateRule" : {
"Interval": 6,
1689
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"IntervalUnit": "HOURS",
"Times" : ["17:30"]
},
"RetainRule":{
"Count" : 3
},
"DeprecateRule":{
"Count" : 2
},
"CrossRegionCopyRules": [{
"TargetRegion": "us-east-1",
"Encrypted": true,
"RetainRule":{
"IntervalUnit": "DAYS",
"Interval": 2
},
"DeprecateRule":{
"IntervalUnit": "DAYS",
"Interval": 1
},
"CopyTags": true
}]
}]
}
• AMI lifecycle policies target only instances that are in the same Region as the policy.
• The first AMI creation operation starts within one hour after the specified start time. Subsequent AMI
creation operations start within one hour of their scheduled time.
• When Amazon Data Lifecycle Manager deregisters an AMI, it automatically deletes it backing
snapshots.
• Target resource tags are case sensitive.
• If you remove the target tags from an instance that is targeted by a policy, Amazon Data Lifecycle
Manager no longer manages existing AMIs in the standard; you must manually delete them if they are
no longer needed.
• You can create multiple policies to back up an instance. For example, if an instance has two tags, where
tag A is the target for policy A to create an AMI every 12 hours,and tag B is the target for policy B to
create an AMI every 24 hours, Amazon Data Lifecycle Manager creates AMIs according to the schedules
for both policies. Alternatively, you can achieve the same result by creating a single policy that has
multiple schedules. For example, you can create a single policy that targets only tag A, and specify two
schedules — one for every 12 hours and one for every 24 hours.
• New volumes that are attached to a target instance after the policy has been created are automatically
included in the backup at the next policy run. All volumes attached to the instance at the time of the
policy run are included.
• If you create a policy with a custom cron-based schedule that is configured to create only one AMI, the
policy will not automatically deregister that AMI when the retention threshold is reached. You must
manually deregister the AMI if it is no longer needed.
• If you create an age-based policy where the retention period is shorter than the creation frequency,
Amazon Data Lifecycle Manager will always retain the last AMI until the next one is created. For
example, if an age-based policy creates one AMI every month with a retention period of seven days,
Amazon Data Lifecycle Manager will retain each AMI for one month, even though the retention period
is seven days.
• For count-based policies, Amazon Data Lifecycle Manager always creates AMIs according to the
creation frequency before attempting to deregister the oldest AMI according to the retention policy.
1690
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
• It can take several hours to successfully deregister an AMI and to delete its associated backing
snapshots. If Amazon Data Lifecycle Manager creates the next AMI before the previously created AMI
is successfully deregistered, you could temporarily retain a number of AMIs that is greater than your
retention count.
• If you terminate an instance that was targeted by a policy with a count-based retention schedule, the
policy no longer manages the AMIs that it previously created from the terminated instance. You must
manually deregister those earlier AMIs if they are no longer needed.
• If you terminate an instance that was targeted by a policy with an age-based retention schedule, the
policy continues to deregister AMIs that were previously created from the terminated instance on the
defined schedule, up to, but not including, the last AMI. You must manually deregister the last AMI if it
is no longer needed.
• If you increase the AMI deprecation count for a schedule with count-based retention, the change is
applied to all AMIs (existing and new) created by the schedule.
• If you increase the AMI deprecation period for a schedule with age-based retention, the change is
applied to new AMIs only. Existing AMIs are not affected.
• If you remove the AMI deprecation rule from a schedule, Amazon Data Lifecycle Manager will not
cancel deprecation for AMIs that were previously deprecated by that schedule.
• If you decrease the AMI deprecation count or period for a schedule, Amazon Data Lifecycle Manager
will not cancel deprecation for AMIs that were previously deprecated by that schedule.
• If you manually deprecate an AMI that was created by an AMI policy, Amazon Data Lifecycle Manager
will not override the deprecation.
• If you manually cancel deprecation for an AMI that was previously deprecated by an AMI policy,
Amazon Data Lifecycle Manager will not override the cancellation.
• If an AMI is created by multiple conflicting schedules, and one or more of those schedules do not have
an AMI deprecation rule, Amazon Data Lifecycle Manager will not deprecate that AMI.
• If an AMI is created by multiple conflicting schedules, and all of those schedules have an AMI
deprecation rule, Amazon Data Lifecycle Manager will use the deprecation rule that results in the latest
deprecation date.
The following considerations apply to AMI policies and Recycle Bin (p. 1854):
• If Amazon Data Lifecycle Manager deregisters an AMI and sends it to the Recycle Bin when the policy's
retention threshold is reached, and you manually restore that AMI from the Recycle Bin, you must
manually deregister the AMI when it is no longer needed. Amazon Data Lifecycle Manager will no
longer manage the AMI.
• If you manually deregister an AMI that was created by a policy, and that AMI is in the Recycle Bin when
the policy’s retention threshold is reached, Amazon Data Lifecycle Manager will not deregister the AMI.
Amazon Data Lifecycle Manager does not manage AMIs while they are in the Recycle Bin.
If the AMI is restored from the Recycle Bin before the policy's retention threshold is reached, Amazon
Data Lifecycle Manager will deregister the AMI when the policy's retention threshold is reached.
If the AMI is restored from the Recycle Bin after the policy's retention threshold is reached, Amazon
Data Lifecycle Manager will no longer deregister the AMI. You must manually delete it when it is no
longer needed.
The following considerations apply to AMI policies that are in the error state:
1691
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
• For policies with age-based retention schedules, AMIs that are set to expire while the policy is in the
error state are retained indefinitely. You must deregister the AMIs manually. When you re-enable the
policy, Amazon Data Lifecycle Manager resumes deregistering AMIs as their retention periods expire.
• For policies with count-based retention schedules, the policy stops creating and deregistering AMIs
while it is in the error state. When you re-enable the policy, Amazon Data Lifecycle Manager resumes
creating AMIs, and it resumes deregistering AMIs as the retention threshold is met.
Additional resources
For more information, see the Automating Amazon EBS snapshot and AMI management using Amazon
Data Lifecycle Manager AWS storage blog.
• Source account—The source account is the account that creates and shares the snapshots with the
target account. In this account, you must create an EBS snapshot policy that creates snapshots at set
intervals and then shares them with other AWS accounts.
• Target account—The target account is the account with destination account with which the snapshots
are shared, and it is the account that creates copies of the shared snapshots. In this account, you must
create a cross-account copy event policy that automatically copies snapshots that are shared with it by
one or more specified source accounts.
Topics
• Create cross-account snapshot copy policies (p. 1692)
• Specify snapshot description filters (p. 1699)
• Considerations for cross-account snapshot copy policies (p. 1699)
• Additional resources (p. 1700)
Topics
• Step 1: Create the EBS snapshot policy (Source account) (p. 1692)
• Step 2: Share the customer managed key (Source account) (p. 1693)
• Step 3: Create cross-account copy event policy (Target account) (p. 1694)
• Step 4: Allow IAM role to use the required KMS keys (Target account) (p. 1697)
When you create the policy, ensure that you enable cross-account sharing and that you specify the target
AWS accounts with which to share the snapshots. These are the accounts with which the snapshots are
to be shared. If you are sharing encrypted snapshots, then you must give the selected target accounts
1692
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
permission to use the KMS key used to encrypt the source volume. For more information, see Step 2:
Share the customer managed key (Source account) (p. 1693).
Note
You can only share snapshots that are unencrypted or that are encrypted using a customer
managed key. You can't share snapshots that are encrypted with the default EBS encryption
KMS key. If you share encrypted snapshots, then you must also share the KMS key that was used
to encrypt the source volume with the target accounts. For more information, see Allowing
users in other accounts to use a KMS key in the AWS Key Management Service Developer Guide.
For more information about creating an EBS snapshot policy, see Automate snapshot lifecycles (p. 1673).
Use one of the following methods to create the EBS snapshot policy.
Console
Make note of the KMS key ARN, you'll need this later.
4. On the Key policy tab, scroll down to the Key users section. Choose Add, enter the name of the
IAM role that you selected in the previous step, and then choose Add.
5. On the Key policy tab, scroll down to the Other AWS accounts section. Choose Add other AWS
accounts, and then add all of the target AWS accounts that you chose to share the snapshots
with in the previous step.
6. Choose Save changes.
Command line
Use the get-key-policy command to retrieve the key policy that is currently attached to the KMS key.
For example, the following command retrieves the key policy for a KMS key with an ID of
9d5e2b3d-e410-4a27-a958-19e220d83a1e and writes it to a file named snapshotKey.json.
Open the key policy using your preferred text editor. Add the ARN of the IAM role that you specified
when you created the snapshot policy and the ARNs of the target accounts with which to share the
KMS key.
For example, in the following policy, we added the ARN of the default IAM role, and the ARN of the
root account for target account 222222222222.
1693
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant.
Instead, use the kms:GrantIsForAWSResource condition key to allow the user to create
grants on the KMS key only when the grant is created on the user's behalf by an AWS
service, as shown in the following example.
{
"Sid" : "Allow use of the key",
"Effect" : "Allow",
"Principal" : {
"AWS" : [
"arn:aws:iam::111111111111:role/service-role/
AWSDataLifecycleManagerDefaultRole",
"arn:aws:iam::222222222222:root"
]
},
"Action" : [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource" : "*"
},
{
"Sid" : "Allow attachment of persistent resources",
"Effect" : "Allow",
"Principal" : {
"AWS" : [
"arn:aws:iam::111111111111:role/service-role/
AWSDataLifecycleManagerDefaultRole",
"arn:aws:iam::222222222222:root"
]
},
"Action" : [
"kms:CreateGrant",
"kms:ListGrants",
"kms:RevokeGrant"
],
"Resource" : "*",
"Condition" : {
"Bool" : {
"kms:GrantIsForAWSResource" : "true"
}
}
}
Save and close the file. Then use the put-key-policy command to attach the updated key policy to
the KMS key.
In the target account, you must create a cross-account copy event policy that will automatically copy
snapshots that are shared by the required source accounts.
1694
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
This policy runs in the target account only when one of the specified source accounts shares snapshot
with the account.
Use one of the following methods to create the cross-account copy event policy.
Console
a. For Sharing accounts, specify the source AWS accounts from which you want to copy
the shared snapshots. Choose Add account, enter the 12-digit AWS account ID, and then
choose Add.
b. For Filter by description, enter the required snapshot description using a regular
expression. Only snapshots that are shared by the specified source accounts and that have
descriptions that match the specified filter are copied by the policy. For more information,
see Specify snapshot description filters (p. 1699).
7. For IAM role, choose the IAM role that has permissions to perform snapshot copy actions. To use
the default role provided by Amazon Data Lifecycle Manager, choose Default role. Alternatively,
to use a custom IAM role that you previously created, choose Choose another role and then
select the role to use.
If you are copying encrypted snapshots, you must grant the selected IAM role permissions to
use the encryption KMS key used to encrypt the source volume. Similarly, if you are encrypting
the snapshot in the destination Region using a different KMS key, you must grant the IAM role
permission to use the destination KMS key. For more information, see Step 4: Allow IAM role to
use the required KMS keys (Target account) (p. 1697).
8. In the Copy action section, define the snapshot copy actions that the policy should perform
when it is activated. The policy can copy snapshots to up to three Regions. You must specify a
separate copy rule for each destination Region. For each rule that you add, do the following:
1695
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Command line
Use the create-lifecycle-policy command to create a policy. To create a cross-account copy event
policy, for PolicyType, specify EVENT_BASED_POLICY.
For example, the following command creates a cross-account copy event policy in target account
222222222222. The policy copies snapshots that are shared by source account 111111111111.
The policy copies snapshots to sa-east-1 and eu-west-2. Snapshots copied to sa-east-1 are
unencrypted and they are retained for 3 days. Snapshots copied to eu-west-2 are encrypted using
KMS key 8af79514-350d-4c52-bac8-8985e84171c7 and they are retained for 1 month. The
policy uses the default IAM role.
{
"PolicyType" : "EVENT_BASED_POLICY",
"EventSource" : {
"Type" : "MANAGED_CWE",
"Parameters": {
"EventType" : "shareSnapshot",
"SnapshotOwner": ["111111111111"]
}
},
"Actions" : [{
"Name" :"Copy Snapshot to Sao Paulo and London",
"CrossRegionCopy" : [{
"Target" : "sa-east-1",
"EncryptionConfiguration" : {
"Encrypted" : false
},
"RetainRule" : {
"Interval" : 3,
"IntervalUnit" : "DAYS"
}
},
{
"Target" : "eu-west-2",
"EncryptionConfiguration" : {
"Encrypted" : true,
"CmkArn" : "arn:aws:kms:eu-west-2:222222222222:key/8af79514-350d-4c52-
bac8-8985e84171c7"
},
"RetainRule" : {
"Interval" : 1,
"IntervalUnit" : "MONTHS"
}
}]
}]
}
If the request succeeds, the command returns the ID of the newly created policy. The following is
example output.
{
"PolicyId": "policy-9876543210abcdef0"
1696
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Step 4: Allow IAM role to use the required KMS keys (Target account)
If you are copying encrypted snapshots, you must grant the IAM role (that you selected in the previous
step) permissions to use the customer managed key that was used to encrypt the source volume.
Note
Only perform this step if you are copying encrypted snapshots. If you are copying unencrypted
snapshots, skip this step.
Use one of the following methods to add the required policies to the IAM role.
Console
In the following example, the policy grants the IAM role permission to use KMS key
1234abcd-12ab-34cd-56ef-1234567890ab, which was shared by source account
111111111111, and KMS key 4567dcba-23ab-34cd-56ef-0987654321yz, which exists in
target account 222222222222.
Tip
To follow the principle of least privilege, do not allow full access to
kms:CreateGrant. Instead, use the kms:GrantIsForAWSResource condition key to
allow the user to create grants on the KMS key only when the grant is created on the
user's behalf by an AWS service, as shown in the following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kms:RevokeGrant",
"kms:CreateGrant",
"kms:ListGrants"
],
"Resource": [
"arn:aws:kms:us-
east-1:111111111111:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"arn:aws:kms:us-
east-1:222222222222:key/4567dcba-23ab-34cd-56ef-0987654321yz"
],
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": "true"
}
1697
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
}
},
{
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": [
"arn:aws:kms:us-
east-1:111111111111:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"arn:aws:kms:us-
east-1:222222222222:key/4567dcba-23ab-34cd-56ef-0987654321yz"
]
}
]
}
Command line
Using your preferred text editor, create a new JSON file named policyDetails.json. Add the
following policy and specify the ARN of the KMS key that was used to encrypt the source volumes
and that was shared with you by the source account in Step 2.
Note
If you are copying from multiple source accounts, then you must specify the corresponding
KMS key ARN from each source account.
In the following example, the policy grants the IAM role permission to use KMS key
1234abcd-12ab-34cd-56ef-1234567890ab, which was shared by source account
111111111111, and KMS key 4567dcba-23ab-34cd-56ef-0987654321yz, which exists in target
account 222222222222.
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant.
Instead, use the kms:GrantIsForAWSResource condition key to allow the user to create
grants on the KMS key only when the grant is created on the user's behalf by an AWS
service, as shown in the following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kms:RevokeGrant",
"kms:CreateGrant",
"kms:ListGrants"
],
"Resource": [
"arn:aws:kms:us-
east-1:111111111111:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"arn:aws:kms:us-
east-1:222222222222:key/4567dcba-23ab-34cd-56ef-0987654321yz"
],
"Condition": {
"Bool": {
1698
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"kms:GrantIsForAWSResource": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": [
"arn:aws:kms:us-
east-1:111111111111:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"arn:aws:kms:us-
east-1:222222222222:key/4567dcba-23ab-34cd-56ef-0987654321yz"
]
}
]
}
Save and close the file. Then use the put-role-policy command to add the policy to the IAM role.
For example
The snapshot filter description must be specified using a regular expression. It is a mandatory field when
creating cross-account copy event policies using the console and the command line. The following are
example regular expressions that can be used:
• .*—This filter matches all snapshot descriptions. If you use this expression the policy will copy all
snapshots that are shared by one of the specified source accounts.
• Created for policy: policy-0123456789abcdef0.*—This filter matches only snapshots that
are created by a policy with an ID of policy-0123456789abcdef0. If you use an expression like this,
only snapshots that are shared with your account by one of the specified source accounts, and that
have been created by a policy with the specified ID are copied by the policy.
• .*production.*—This filter matches any snapshot that has the word production anywhere in its
description. If you use this expression the policy will copy all snapshots that are shared by one of the
specified source accounts and that have the specified text in their description.
1699
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
• You can only copy snapshots that are unencrypted or that are encrypted using a customer managed
key.
• You can create a cross-account copy event policy to copy snapshots that are shared outside of Amazon
Data Lifecycle Manager.
• If you want to encrypt snapshots in the target account, then the IAM role selected for the cross-
account copy event policy must have permission to use the required KMS key.
Additional resources
For more information, see the Automating copying encrypted Amazon EBS snapshots across AWS
accounts AWS storage blog.
Topics
• View lifecycle policies (p. 1700)
• Modify lifecycle policies (p. 1701)
• Delete lifecycle policies (p. 1703)
Console
Command line
The following is example output. It includes the information that you specified, plus metadata
inserted by AWS.
{
"Policy":{
"Description": "My first policy",
"DateCreated": "2018-05-15T00:16:21+0000",
"State": "ENABLED",
"ExecutionRoleArn":
"arn:aws:iam::210774411744:role/AWSDataLifecycleManagerDefaultRole",
"PolicyId": "policy-0123456789abcdef0",
"DateModified": "2018-05-15T00:16:22+0000",
"PolicyDetails": {
"PolicyType":"EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": [
"VOLUME"
],
1700
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"TargetTags": [
{
"Value": "115",
"Key": "costcenter"
}
],
"Schedules": [
{
"TagsToAdd": [
{
"Value": "myDailySnapshot",
"Key": "type"
}
],
"RetainRule": {
"Count": 5
},
"CopyTags": false,
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"Name": "DailySnapshots"
}
]
}
}
}
• If you modify an AMI or snapshot policy by removing its target tags, the volumes or instances with
those tags are no longer managed by the policy.
• If you modify a schedule name, the snapshots or AMIs created under the old schedule name are no
longer managed by the policy.
• If you modify an age-based retention schedule to use a new time interval, the new interval is used only
for new snapshots or AMIs created after the change. The new schedule does not affect the retention
schedule of snapshots or AMIs created before the change.
• You cannot change the retention schedule of a policy from count-based to age-based after creation. To
make this change, you must create a new policy.
• If you disable a policy with an age-based retention schedule, the snapshots or AMIs that are set
to expire while the policy is disabled are retained indefinitely. You must delete the snapshots or
deregister the AMIs manually. When you re-enable the policy, Amazon Data Lifecycle Manager resumes
deleting snapshots or deregistering AMIs as their retention periods expire.
• If you disable a policy with a count-based retention schedule, the policy stops creating and deleting
snapshots or AMIs. When you re-enable the policy, Amazon Data Lifecycle Manager resumes creating
snapshots and AMIs, and it resumes deleting snapshots or AMIs as the retention threshold is met.
• If you disable a policy that has a snapshot archiving-enabled policy, snapshots that are in the archive
tier at the time of disabling the policy are no longer managed by Amazon Data Lifecycle Manager. You
must manually delete the snapshot if they are no longer needed.
• If you enable snapshot archiving on a count-based schedule, the archiving rule applies to all new
snapshots that are created and archived by the schedule, and also applies to existing snapshots that
were previously created and archived by the schedule.
1701
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
• If you enable snapshot archiving on an age-based schedule, the archiving rule applies only to new
snapshots created after enabling snapshot archiving. Existing snapshots created before enabling
snapshot archiving continue to be deleted from their respective storage tiers, according to the
schedule set when those snapshots were originally created and archived.
• If you disable snapshot archiving for a count-based schedule, the schedule immediately stops archiving
snapshots. Snapshots that were previously archived by the schedule remain in the archive tier and they
will not be deleted by Amazon Data Lifecycle Manager.
• If you disable snapshot archiving for an age-based schedule, the snapshots created by the policy and
that are scheduled to be archived are permanently deleted at the scheduled archive date and time, as
indicated by the aws:dlm:expirationTime system tag.
• If you disable snapshot archiving for a schedule, the schedule immediately stops archiving snapshots.
Snapshots that were previously archived by the schedule remain in the archive tier and they will not be
deleted by Amazon Data Lifecycle Manager.
• If you modify the archive retention count for a count-based schedule, the new retention count includes
existing snapshots that were previously archived by the schedule.
• If you modify the archive retention period for an age-based schedule, the new retention period applies
only to snapshots that are archived after modifying the retention rule.
Console
Command line
Use the update-lifecycle-policy command to modify the information in a lifecycle policy. To simplify
the syntax, this example references a JSON file, policyDetailsUpdated.json, that includes the
policy details.
{
"ResourceTypes":[
"VOLUME"
],
"TargetTags":[
{
"Key": "costcenter",
"Value": "120"
}
1702
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
],
"Schedules":[
{
"Name": "DailySnapshots",
"TagsToAdd": [
{
"Key": "type",
"Value": "myDailySnapshot"
}
],
"CreateRule": {
"Interval": 12,
"IntervalUnit": "HOURS",
"Times": [
"15:00"
]
},
"RetainRule": {
"Count" :5
},
"CopyTags": false
}
]
}
To view the updated policy, use the get-lifecycle-policy command. You can see that the state,
the value of the tag, the snapshot interval, and the snapshot start time were changed.
• If you delete a policy, the snapshots or AMIs created by that policy are not automatically deleted. If
you no longer need the snapshots or AMIs, you must delete them manually.
• If you delete a policy that has a snapshot archiving-enabled policy, snapshots that are in the archive
tier at the time of deleting the policy are no longer managed by Amazon Data Lifecycle Manager. You
must manually delete the snapshot if they are no longer needed.
• If you delete a policy with an archive-enabled, age-based schedule, the snapshots created by the policy
and that are scheduled to be archived are permanently deleted at the scheduled archive date and time,
as indicated by the aws:dlm:expirationtime system tag.
Console
Command line
Use the delete-lifecycle-policy command to delete a lifecycle policy and free up the target tags
specified in the policy for reuse.
1703
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Note
You can delete snapshots created only by Amazon Data Lifecycle Manager.
The Amazon Data Lifecycle Manager API Reference provides descriptions and syntax for each of the
actions and data types for the Amazon Data Lifecycle Manager Query API.
Alternatively, you can use one of the AWS SDKs to access the API in a way that's tailored to the
programming language or platform that you're using. For more information, see AWS SDKs.
Topics
• AWS managed policies (p. 1704)
• IAM service roles (p. 1707)
• Permissions for users (p. 1710)
• Permissions for encryption (p. 1711)
However, you can't change the permissions defined in AWS managed policies. AWS occasionally updates
the permissions defined in an AWS managed policy. When this occurs, the update affects all principal
entities (users, groups, and roles) that the policy is attached to.
Amazon Data Lifecycle Manager provides two AWS managed policies for common use cases. These
policies make it more efficient to define the appropriate permissions and control access to your
resources. The AWS managed policies provided by Amazon Data Lifecycle Manager are designed to be
attached to roles that you pass to Amazon Data Lifecycle Manager.
The following are the AWS managed policies that Amazon Data Lifecycle Manager provides. You can also
find these AWS managed policies in the Policies section of the IAM console.
AWSDataLifecycleManagerServiceRole
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
1704
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
"ec2:EnableFastSnapshotRestores",
"ec2:DescribeFastSnapshotRestores",
"ec2:DisableFastSnapshotRestores",
"ec2:CopySnapshot",
"ec2:ModifySnapshotAttribute",
"ec2:DescribeSnapshotAttribute",
"ec2:ModifySnapshotTier",
"ec2:DescribeSnapshotTierStatus"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:*::snapshot/*"
},
{
"Effect": "Allow",
"Action": [
"events:PutRule",
"events:DeleteRule",
"events:DescribeRule",
"events:EnableRule",
"events:DisableRule",
"events:ListTargetsByRule",
"events:PutTargets",
"events:RemoveTargets"
],
"Resource": "arn:aws:events:*:*:rule/AwsDataLifecycleRule.managed-cwe.*"
}
]
}
AWSDataLifecycleManagerServiceRoleForAMIManagement
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": [
"arn:aws:ec2:*::snapshot/*",
"arn:aws:ec2:*::image/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeInstances",
"ec2:DescribeImageAttribute",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots"
1705
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "ec2:DeleteSnapshot",
"Resource": "arn:aws:ec2:*::snapshot/*"
},
{
"Effect": "Allow",
"Action": [
"ec2:ResetImageAttribute",
"ec2:DeregisterImage",
"ec2:CreateImage",
"ec2:CopyImage",
"ec2:ModifyImageAttribute"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:EnableImageDeprecation",
"ec2:DisableImageDeprecation"
],
"Resource": "arn:aws:ec2:*::image/*"
}
]
}
AWS services maintain and update AWS managed policies. You can't change the permissions in AWS
managed policies. Services occasionally add additional permissions to an AWS managed policy to
support new features. This type of update affects all identities (users, groups, and roles) where the policy
is attached. Services are most likely to update an AWS managed policy when a new feature is launched
or when new operations become available. Services do not remove permissions from an AWS managed
policy, so policy updates won't break your existing permissions.
The following table provides details about updates to AWS managed policies for Amazon Data Lifecycle
Manager since this service began tracking these changes. For automatic alerts about changes to this
page, subscribe to the RSS feed on the Document history (p. 2050).
AWSDataLifecycleManagerServiceRole
Amazon Data September 30, 2022
— Added Lifecycle Manager
permissions to added the
support snapshot ec2:ModifySnapshotTier
archiving. and
ec2:DescribeSnapshotTierStatus
actions to the
grant snapshot
policies permission
to archive
snapshots and
to check the
archive status for
snapshots.
1706
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
AWSDataLifecycleManagerServiceRoleForAMIManagement
Amazon Data August 23, 2021
— Added Lifecycle Manager
permissions to added the
support AMI ec2:EnableImageDeprecation
deprecation. and
ec2:DisableImageDeprecation
actions to grant
EBS-backed AMI
policies permission
to enable and
disable AMI
deprecation.
The role that you pass to Amazon Data Lifecycle Manager must have an IAM policy with the permissions
that enable Amazon Data Lifecycle Manager to perform actions associated with policy operations, such
as creating snapshots and AMIs, copying snapshots and AMIs, deleting snapshots, and deregistering
AMIs. Different permissions are required for each of the Amazon Data Lifecycle Manager policy types.
The role must also have Amazon Data Lifecycle Manager listed as a trusted entity, which enables Amazon
Data Lifecycle Manager to assume the role.
Topics
• Default service roles for Amazon Data Lifecycle Manager (p. 1707)
• Custom service roles for Amazon Data Lifecycle Manager (p. 1708)
Amazon Data Lifecycle Manager uses the following default service roles:
1707
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
If you are using the Amazon Data Lifecycle Manager console, Amazon Data Lifecycle Manager
automatically creates the AWSDataLifecycleManagerDefaultRole service role the first time
you create a snapshot or cross-account snapshot copy policy, and it automatically creates the
AWSDataLifecycleManagerDefaultRoleForAMIManagement service role the first time you create an
EBS-backed AMI policy.
If you are not using the console, you can manually create the service roles using the create-default-role
command. For --resource-type, specify snapshot to create AWSDataLifecycleManagerDefaultRole,
or image to create AWSDataLifecycleManagerDefaultRoleForAMIManagement.
If you delete the default service roles, and then need to create them again, you can use the same process
to recreate them in your account.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
"ec2:EnableFastSnapshotRestores",
"ec2:DescribeFastSnapshotRestores",
"ec2:DisableFastSnapshotRestores",
"ec2:CopySnapshot",
"ec2:ModifySnapshotAttribute",
"ec2:DescribeSnapshotAttribute",
"ec2:ModifySnapshotTier",
"ec2:DescribeSnapshotTierStatus"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
1708
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:*::snapshot/*"
},
{
"Effect": "Allow",
"Action": [
"events:PutRule",
"events:DeleteRule",
"events:DescribeRule",
"events:EnableRule",
"events:DisableRule",
"events:ListTargetsByRule",
"events:PutTargets",
"events:RemoveTargets"
],
"Resource": "arn:aws:events:*:*:rule/AwsDataLifecycleRule.managed-cwe.*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": [
"arn:aws:ec2:*::snapshot/*",
"arn:aws:ec2:*::image/*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeInstances",
"ec2:DescribeImageAttribute",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "ec2:DeleteSnapshot",
"Resource": "arn:aws:ec2:*::snapshot/*"
},
{
"Effect": "Allow",
"Action": [
"ec2:ResetImageAttribute",
"ec2:DeregisterImage",
"ec2:CreateImage",
"ec2:CopyImage",
"ec2:ModifyImageAttribute"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:EnableImageDeprecation",
1709
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
"ec2:DisableImageDeprecation"
],
"Resource": "arn:aws:ec2:*::image/*"
}
]
}
For more information, see Creating a Role in the IAM User Guide.
2. Add a trust relationship to the roles.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Service": "dlm.amazonaws.com"
},
"Action": "sts:AssumeRole"
}]
}
We recommend that you use the aws:SourceAccount and aws:SourceArn condition keys
to protect yourself against the confused deputy problem. For example, you could add the
following condition block to the previous trust policy. The aws:SourceAccount is the owner
of the lifecycle policy and the aws:SourceArn is the ARN of the lifecycle policy. If you don't
know the lifecycle policy ID, you can replace that portion of the ARN with a wildcard (*) and
then update the trust policy after you create the lifecycle policy.
"Condition": {
"StringEquals": {
"aws:SourceAccount": "account_id"
},
"ArnLike": {
"aws:SourceArn": "arn:partition:dlm:region:account_id:policy/policy_id"
}
}
1710
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "dlm:*",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": [
"arn:aws:iam::accound_id:role/service-role/
AWSDataLifecycleManagerDefaultRole",
"arn:aws:iam::accound_id:role/service-role/
AWSDataLifecycleManagerDefaultRoleForAMIManagement"
]
},
{
"Effect": "Allow",
"Action": "iam:ListRoles",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeAvailabilityZones",
"ec2:DescribeRegions",
"kms:ListAliases",
"kms:DescribeKey"
],
"Resource": "*"
}
]
}
For more information, see Changing permissions for a user in the IAM User Guide.
• If the source volume is encrypted, ensure that the Amazon Data Lifecycle
Manager default roles (AWSDataLifecycleManagerDefaultRole and
AWSDataLifecycleManagerDefaultRoleForAMIManagement) have permission to use the KMS keys
used to encrypt the volume.
• If you enable Cross Region copy for unencrypted snapshots or AMIs backed by unencrypted snapshots,
and choose to enable encryption in the destination Region, ensure that the default roles have
permission to use the KMS key needed to perform the encryption in the destination Region.
• If you enable Cross Region copy for encrypted snapshots or AMIs backed by encrypted snapshots,
ensure that the default roles have permission to use both the source and destination KMS keys.
• If you enable snapshot archiving for encrypted snapshots, ensure that the Amazon Data Lifecycle
Manager default role (AWSDataLifecycleManagerDefaultRole has permission to use the KMS key used
to encrypt the snapshot.
1711
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
For more information, see Allowing users in other accounts to use a KMS key in the AWS Key
Management Service Developer Guide.
Features
• Console and AWS CLI (p. 1712)
• AWS CloudTrail (p. 1712)
• Monitor your policies using CloudWatch Events (p. 1712)
• Monitor your policies using Amazon CloudWatch (p. 1713)
AWS CloudTrail
With AWS CloudTrail, you can track user activity and API usage to demonstrate compliance with internal
policies and regulatory standards. For more information, see the AWS CloudTrail User Guide.
• createSnapshot—An Amazon EBS event emitted when a CreateSnapshot action succeeds or fails.
For more information, see EventBridge for Amazon EBS (p. 1794).
• DLM Policy State Change—An Amazon Data Lifecycle Manager event emitted when a lifecycle
policy enters an error state. The event contains a description of what caused the error. The following is
an example of an event when the permissions granted by the IAM role are insufficient.
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "DLM Policy State Change",
source": "aws.dlm",
"account": "123456789012",
"time": "2018-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
],
"detail": {
"state": "ERROR",
1712
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "DLM Policy State Change",
"source": "aws.dlm",
"account": "123456789012",
"time": "2018-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
],
"detail":{
"state": "ERROR",
"cause": "Maximum allowed active snapshot limit exceeded",
"policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
}
}
Metrics are kept for a period of 15 months, so that you can access historical information and gain a
better understanding of how your lifecycle policies perform over an extended period.
For more information about Amazon CloudWatch, see the Amazon CloudWatch User Guide.
Topics
• Supported metrics (p. 1713)
• View CloudWatch metrics for your policies (p. 1716)
• Graph metrics for your policies (p. 1717)
• Create a CloudWatch alarm for a policy (p. 1718)
• Example use cases (p. 166)
• Managing policies that report failed actions (p. 1720)
Supported metrics
The Data Lifecycle Manager namespace includes the following metrics for Amazon Data Lifecycle
Manager lifecycle policies. The supported metrics differ by policy type.
All metrics can be measured on the DLMPolicyId dimension. The most useful statistics are sum and
average, and the unit of measure is count.
1713
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Metric Description
This metric includes snapshots that are deleted when an EBS-backed AMI
policy deregisters AMIs.
This metric includes snapshots that are deleted when an EBS-backed AMI
policy deregisters AMIs.
The number of archived snapshots that could not be deleted from the
snapshotsArchiveDeletionFailed
archive tier by a snapshot policy.
1714
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Metric Description
Metric Description
This metric includes snapshots that are deleted when an EBS-backed AMI
policy deregisters AMIs.
This metric includes snapshots that are deleted when an EBS-backed AMI
policy deregisters AMIs.
ImagesCreateFailed The number of AMIs that could not be created by an EBS-backed AMI
policy.
1715
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
Metric Description
The number of AMIs that could not be marked for deprecation by an EBS-
EnableImageDeprecationFailed
backed AMI policy.
The number of cross-Region AMI copies that could not be marked for
EnableCopiedImageDeprecationFailed
deprecation by an EBS-backed AMI policy.
The following metrics can be used with cross-account copy event policies:
Metric Description
The number of snapshots that could not be copied from another account
SnapshotsCopiedAccountFailed
by a cross-account copy event policy. This includes unsuccessful retries
within 24 hours of the scheduled time.
You can use the AWS Management Console or the command line tools to list the metrics that Amazon
Data Lifecycle Manager sends to Amazon CloudWatch.
1716
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
3. Select a policy in the grid and then choose the Monitoring tab.
CloudWatch console
AWS CLI
To list all the available metrics for Amazon Data Lifecycle Manager
After you create a policy, you can open the Amazon EC2 console and view the monitoring graphs for the
policy on the Monitoring tab. Each graph is based on one of the available Amazon EC2 metrics.
1717
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
You can create a CloudWatch alarm that monitors CloudWatch metrics for your policies. CloudWatch
will automatically send you a notification when the metric reaches a threshold that you specify. You can
create a CloudWatch alarm using the CloudWatch console.
For more information about creating alarms using the CloudWatch console, see the following topic in the
Amazon CloudWatch User Guide.
Topics
• Example 1: ResourcesTargeted metric (p. 1719)
• Example 2: SnapshotDeleteFailed metric (p. 1719)
• Example 3: SnapshotsCopiedRegionFailed metric (p. 1719)
1718
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon Data Lifecycle Manager
For example, if you expect your daily policy to create backups of no more than 50 volumes, you can
create an alarm that sends an email notification when the sum for ResourcesTargeted is greater than
50 over a 1 hour period. In this way, you can ensure that no snapshots have been unexpectedly created
from volumes that have been incorrectly tagged.
For example, if you've created a policy that should automatically delete snapshots every
twelve hours, you can create an alarm that notifies your engineering team when the sum of
SnapshotDeletionFailed is greater than 0 over a 1 hour period. This could help to investigate
improper snapshot retention and to ensure that your storage costs are not increased by unnecessary
snapshots.
For example, if your policy copies snapshots across Regions daily, you can create an alarm that sends an
SMS to your engineering team when the sum of SnapshotCrossRegionCopyFailed is greater than 0
over a 1 hour period. This can be useful for verifying whether subsequent snapshots in the lineage were
successfully copied by the policy.
1719
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
For more information about what to do when one of your policies reports an unexpected non-zero value
for a failed action metric, see the What should I do if Amazon Data Lifecycle Manager reports failed
actions in CloudWatch metrics? AWS Knowledge Center article.
Data services
• Amazon EBS Elastic Volumes (p. 1720)
• Amazon EBS encryption (p. 1732)
• Amazon EBS fast snapshot restore (p. 1745)
There is no charge to modify the configuration of a volume. You are charged for the new volume
configuration after volume modification starts. For more information, see the Amazon EBS Pricing page.
Contents
• Requirements when modifying volumes (p. 1720)
• Request modifications to your EBS volumes (p. 1722)
• Monitor the progress of volume modifications (p. 1725)
• Extend a Windows file system after resizing a volume (p. 1728)
Topics
• Supported instance types (p. 1721)
1720
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
If your instance type does not support Elastic Volumes, see Modify an EBS volume if Elastic Volumes is
not supported (p. 1725).
By default, Windows initializes volumes with a Master Boot Record (MBR) partition table. Because
MBR supports only volumes smaller than 2 TiB (2,048 GiB), Windows prevents you from resizing MBR
volumes beyond this limit. In such a case, the Extend Volume option is disabled in the Windows Disk
Management utility. If you use the AWS Management Console or AWS CLI to create an MBR-partitioned
volume that exceeds the size limit, Windows cannot detect or use the additional space. For requirements
affecting Linux volumes, see Requirements for Linux volumes in the Amazon EC2 User Guide for Linux
Instances.
To overcome this limitation, you can create a new, larger volume with a GUID partition table (GPT) and
copy over the data from the original MBR volume.
1. Create a new, empty volume of the desired size in the Availability Zone of the EC2 instance and
attach it to your instance.
Note
The new volume must not be a volume restored from a snapshot.
2. Log in to your Windows system and open Disk Management (diskmgmt.exe).
3. Open the context (right-click) menu for the new disk and choose Online.
4. In the Initialize Disk window, select the new disk and choose GPT (GUID Partition Table), OK.
5. When initialization is complete, copy the data from the original volume to the new volume, using a
tool such as robocopy or teracopy.
6. In Disk Management, change the drive letters to appropriate values and take the old volume offline.
7. In the Amazon EC2 console, detach the old volume from the instance, reboot the instance to verify
that it functions properly, and delete the old volume.
Limitations
• There are limits to the maximum aggregated storage that can be requested across volume
modifications. For more information, see Amazon EBS service quotas in the Amazon Web Services
General Reference.
• After modifying a volume, you must wait at least six hours and ensure that the volume is in the in-
use or available state before you can modify the same volume. This is sometimes referred to as a
cooldown period.
• If the volume was attached before November 3, 2016 23:40 UTC, you must initialize Elastic Volumes
support. For more information, see Initializing Elastic Volumes Support (p. 1724).
• If you encounter an error message while attempting to modify an EBS volume, or if you are modifying
an EBS volume attached to a previous-generation instance type, take one of the following steps:
1721
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
• For a non-root volume, detach the volume from the instance, apply the modifications, and then re-
attach the volume.
• For a root volume, stop the instance, apply the modifications, and then restart the instance.
• Modification time is increased for volumes that are not fully initialized. For more information see
Initialize Amazon EBS volumes (p. 1779).
• The new volume size can't exceed the supported capacity of its file system and partitioning scheme.
For more information, see Constraints on the size and configuration of an EBS volume (p. 1536).
• If you modify the volume type of a volume, the size and performance must be within the limits of the
target volume type. For more information, see Amazon EBS volume types (p. 1520)
• You can't decrease the size of an EBS volume. However, you can create a smaller volume and then
migrate your data to it using an application-level tool such as robocopy.
• After provisioning over 32,000 IOPS on an existing io1 or io2 volume, you might need to detach and
re-attach the volume, or restart the instance to see the full performance improvements.
• For io2 volumes, you can't increase the size beyond 16 TiB or the IOPS beyond 64,000 while the
volume is attached to an instance type that does not support io2 Block Express volumes. For more
information, see io2 Block Express volumes (p. 1528).
• You can't modify the volume type of Multi-Attach enabled io2 volumes.
• You can't modify the volume type, size, or Provisioned IOPS of Multi-Attach enabled io1 volumes.
• A root volume of type io1, io2, gp2, gp3, or standard can't be modified to an st1 or sc1 volume,
even if it is detached from the instance.
• While m3.medium instances fully support volume modification, m3.large, m3.xlarge, and
m3.2xlarge instances might not support all volume modification features.
1. (Optional) Before modifying a volume that contains valuable data, it is a best practice to create a
snapshot of the volume in case you need to roll back your changes. For more information, see Create
Amazon EBS snapshots (p. 1574).
2. Request the volume modification.
3. Monitor the progress of the volume modification. For more information, see Monitor the progress of
volume modifications (p. 1725).
4. If the size of the volume was modified, extend the volume's file system to take advantage of the
increased storage capacity. For more information, see Extend a Windows file system after resizing a
volume (p. 1728).
Contents
• Modify an EBS volume using Elastic Volumes (p. 1722)
• Initialize Elastic Volumes support (if needed) (p. 1724)
• Modify an EBS volume if Elastic Volumes is not supported (p. 1725)
Considerations
1722
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
• You can't cancel a volume modification request after it has been submitted.
• You can only increase volume size. You can't decrease volume size.
• You can increase or decrease volume performance.
• If you are not changing the volume type, then volume size and performance modifications must be
within the limits of the current volume type. If you are changing the volume type, then volume size
and performance modifications must be within the limits of the target volume type
• If you change the volume type from gp2 to gp3, and you do not specify IOPS or throughput
performance, Amazon EBS automatically provisions either equivalent performance to that of the
source gp2 volume, or the baseline gp3 performance, whichever is higher.
For example, if you modify a 500 GiB gp2 volume with 250 MiB/s throughput and 1500 IOPS to
gp3 without specifying IOPS or throughput performance, Amazon EBS automatically provisions the
gp3 volume with 3000 IOPS (baseline gp3 IOPS) and 250 MiB/s (to match the source gp2 volume
throughput).
Console
AWS CLI
Use the modify-volume command to modify one or more configuration settings for a volume. For
example, if you have a volume of type gp2 with a size of 100 GiB, the following command changes
its configuration to a volume of type io1 with 10,000 IOPS and a size of 200 GiB.
aws ec2 modify-volume --volume-type io1 --iops 10000 --size 200 --volume-
id vol-11111111111111111
1723
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
{
"VolumeModification": {
"TargetSize": 200,
"TargetVolumeType": "io1",
"ModificationState": "modifying",
"VolumeId": "vol-11111111111111111",
"TargetIops": 10000,
"StartTime": "2017-01-19T22:21:02.959Z",
"Progress": 0,
"OriginalVolumeType": "gp2",
"OriginalIops": 300,
"OriginalSize": 100
}
}
Important
If you've increased the size of your volume, then you must also extend the volume's
partition to make use of the additional storage capacity. For more information, see Extend a
Windows file system after resizing a volume (p. 1728).
Before you can modify a volume that was attached to an instance before November 3, 2016 23:40 UTC,
you must initialize volume modification support using one of the following actions:
Use one of the following procedures to determine whether your instances are ready for volume
modification.
Console
AWS CLI
Use the following describe-instances command to determine whether the volume was attached
before November 3, 2016 23:40 UTC.
1724
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
The first line of the output for each instance shows its ID and whether it was started before the
cutoff date (True or False). The first line is followed by one or more lines that show whether each
EBS volume was attached before the cutoff date (True or False). In the following example output,
you must initialize volume modification for the first instance because it was started before the cutoff
date and its root volume was attached before the cutoff date. The other instances are ready because
they were started after the cutoff date.
i-e905622e True
True
i-719f99a8 False
True
i-006b02c1b78381e57 False
False
False
i-e3d172ed False
True
If you are using a supported instance type, you can use Elastic Volumes to dynamically modify the size,
performance, and volume type of your Amazon EBS volumes without detaching them.
If you cannot use Elastic Volumes but you need to modify the root (boot) volume, you must stop the
instance, modify the volume, and then restart the instance.
After the instance has started, you can check the file system size to see if your instance recognizes the
larger volume space.
If the size does not reflect your newly expanded volume, you must extend the file system of your device
so that your instance can use the new space. For more information, see Extend a Windows file system
after resizing a volume (p. 1728).
You may have to bring the volume online in order to use it. For more information, see Make an Amazon
EBS volume available for use on Windows (p. 1543). You do not need to reformat the volume.
While the volume is in the optimizing state, your volume performance is in between the source and
target configuration specifications. Transitional volume performance will be no less than the source
volume performance. If you are downgrading IOPS, transitional volume performance is no less than the
target volume performance.
• Size changes usually take a few seconds to complete and take effect after the volume has transitioned
to the Optimizing state.
• Performance (IOPS) changes can take from a few minutes to a few hours to complete and are
dependent on the configuration change being made.
1725
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
• In some cases, it can take more than 24 hours for a new configuration to take effect, such as when
the volume has not been fully initialized. Typically, a fully used 1-TiB volume takes about 6 hours to
migrate to a new performance configuration.
To monitor the progress of a volume modification, use one of the following methods.
Console
The possible volume states are creating, available, in-use, deleting, deleted, and
error.
AWS CLI
Use the describe-volumes-modifications command to view the progress of one or more volume
modifications. The following example describes the volume modifications for two volumes.
In the following example output, the volume modifications are still in the modifying state.
Progress is reported as a percentage.
{
"VolumesModifications": [
{
"TargetSize": 200,
"TargetVolumeType": "io1",
"ModificationState": "modifying",
"VolumeId": "vol-11111111111111111",
"TargetIops": 10000,
"StartTime": "2017-01-19T22:21:02.959Z",
"Progress": 0,
"OriginalVolumeType": "gp2",
"OriginalIops": 300,
"OriginalSize": 100
},
{
"TargetSize": 2000,
"TargetVolumeType": "sc1",
"ModificationState": "modifying",
"VolumeId": "vol-22222222222222222",
"StartTime": "2017-01-19T22:23:22.158Z",
"Progress": 0,
"OriginalVolumeType": "gp2",
"OriginalIops": 300,
1726
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
"OriginalSize": 1000
}
]
}
The next example describes all volumes with a modification state of either optimizing or
completed, and then filters and formats the results to show only modifications that were initiated
on or after February 1, 2017:
[
{
"STATE": "optimizing",
"ID": "vol-06397e7a0eEXAMPLE"
},
{
"STATE": "completed",
"ID": "vol-ba74e18c2aEXAMPLE"
}
]
With CloudWatch Events, you can create a notification rule for volume modification events. You can
use your rule to generate a notification message using Amazon SNS or to invoke a Lambda function
in response to matching events. Events are emitted on a best effort basis.
{
"source": [
"aws.ec2"
],
"detail-type": [
"EBS Volume Notification"
],
"detail": {
"event": [
"modifyVolume"
]
}
}
{
"version": "0",
1727
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "2017-01-12T21:09:07Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:012345678901:volume/vol-03a55cf56513fa1b6"
],
"detail": {
"result": "optimizing",
"cause": "",
"event": "modifyVolume",
"request-id": "01234567-0123-0123-0123-0123456789ab"
}
}
For more information about extending a file system on Linux, see Extend a Linux file system after
resizing a volume in the Amazon EC2 User Guide for Linux Instances.
Contents
• Extend a Windows file system using the Disk Management utility (p. 1728)
• Extend a Windows file system using PowerShell (p. 1730)
Use the following procedure to extend a Windows file system using Disk Management.
1. Before extending a file system that contains valuable data, it is a best practice to create a snapshot
of the volume that contains it in case you need to roll back your changes. For more information, see
Create Amazon EBS snapshots (p. 1574).
2. Log in to your Windows instance using Remote Desktop.
3. In the Run dialog, enter diskmgmt.msc and press Enter. The Disk Management utility opens.
1728
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
• The unallocated space is not adjacent to the drive. The unallocated space must be
adjacent to the right side of the drive you want to extend.
• The volume uses the Master Boot Record (MBR) partition style and it is already 2TB in
size. Volumes that use MBR cannot exceed 2TB in size.
1729
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
6. In the Extend Volume wizard, choose Next. For Select the amount of space in MB, enter the
number of megabytes by which to extend the volume. Generally, you specify the maximum available
space. The highlighted text under Selected is the amount of space that is added, not the final size
the volume will have. Complete the wizard.
7. If you increase the size of an NVMe volume on an instance that does not have the AWS NVMe driver,
you must reboot the instance to enable Windows to see the new volume size. For more information
about installing the AWS NVMe driver, see AWS NVMe drivers for Windows instances (p. 758).
Use the following procedure to extend a Windows file system using PowerShell.
1. Before extending a file system that contains valuable data, it is a best practice to create a snapshot
of the volume that contains it in case you need to roll back your changes. For more information, see
Create Amazon EBS snapshots (p. 1574).
2. Log in to your Windows instance using Remote Desktop.
3. Run PowerShell as an administrator.
4. Run the Get-Partition command. PowerShell returns the corresponding partition number for
each partition, the drive letter, offset, size, and type. Note the drive letter of the partition to extend.
5. Run the following command to rescan the disk.
"rescan" | diskpart
1730
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
6. Run the following command, using the drive letter you noted in step 4 in place of <drive-
letter>. PowerShell returns the minimum and maximum size of the partition allowed, in bytes.
7. To extend the partition to a specified amount, run the following command, entering the new size of
the volume in place of <size>. You can enter the size in KB, MB, and GB; for example, 50GB.
To extend the partition to the maximum available size, run the following command.
The following PowerShell commands show the complete command and response flow for extending
a file system to a specific size.
The following PowerShell commands show the complete command and response flow for extending
a file system to the maximum available size.
1731
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
Encryption operations occur on the servers that host EC2 instances, ensuring the security of both data-
at-rest and data-in-transit between an instance and its attached EBS storage.
You can attach both encrypted and unencrypted volumes to an instance simultaneously.
Contents
• How EBS encryption works (p. 1733)
• Requirements (p. 1734)
• Default KMS key for EBS encryption (p. 1735)
• Encryption by default (p. 1735)
• Encrypt EBS resources (p. 1738)
• Rotating AWS KMS keys (p. 1739)
1732
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
When you create an encrypted EBS volume and attach it to a supported instance type, the following
types of data are encrypted:
Amazon EBS encrypts your volume with a data key using industry-standard AES-256 data encryption.
The data key is generated by AWS KMS and then encrypted by AWS KMS with your AWS KMS key prior
to being stored with your volume information. All snapshots, and any subsequent volumes created from
those snapshots using the same AWS KMS key share the same data key. For more information, see Data
keys in the AWS Key Management Service Developer Guide.
Amazon EC2 works with AWS KMS to encrypt and decrypt your EBS volumes in slightly different ways
depending on whether the snapshot from which you create an encrypted volume is encrypted or
unencrypted.
When you create an encrypted volume from an encrypted snapshot that you own, Amazon EC2 works
with AWS KMS to encrypt and decrypt your EBS volumes as follows:
1. Amazon EC2 sends a GenerateDataKeyWithoutPlaintext request to AWS KMS, specifying the KMS key
that you chose for volume encryption.
2. If the volume is encrypted using the same KMS key as the snapshot, AWS KMS uses the same data key
as the snapshot and encrypts it under that same KMS key. If the volume is encrypted using a different
KMS key, AWS KMS generates a new data key and encrypts it under the KMS key that you specified.
The encrypted data key is sent to Amazon EBS to be stored with the volume metadata.
3. When you attach the encrypted volume to an instance, Amazon EC2 sends a CreateGrant request to
AWS KMS so that it can decrypt the data key.
4. AWS KMS decrypts the encrypted data key and sends the decrypted data key to Amazon EC2.
5. Amazon EC2 uses the plaintext data key in hypervisor memory to encrypt disk I/O to the volume. The
plaintext data key persists in memory as long as the volume is attached to the instance.
When you create an encrypted volume from unencrypted snapshot, Amazon EC2 works with AWS KMS to
encrypt and decrypt your EBS volumes as follows:
1. Amazon EC2 sends a CreateGrant request to AWS KMS, so that it can encrypt the volume that is
created from the snapshot.
2. Amazon EC2 sends a GenerateDataKeyWithoutPlaintext request to AWS KMS, specifying the KMS key
that you chose for volume encryption.
3. AWS KMS generates a new data key, encrypts it under the KMS key that you chose for volume
encryption, and sends the encrypted data key to Amazon EBS to be stored with the volume metadata.
1733
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
4. Amazon EC2 sends a Decrypt request to AWS KMS to get the encryption key to encrypt the volume
data.
5. When you attach the encrypted volume to an instance, Amazon EC2 sends a CreateGrant request to
AWS KMS, so that it can decrypt the data key.
6. When you attach the encrypted volume to an instance, Amazon EC2 sends a Decrypt request to AWS
KMS, specifying the encrypted data key.
7. AWS KMS decrypts the encrypted data key and sends the decrypted data key to Amazon EC2.
8. Amazon EC2 uses the plaintext data key in hypervisor memory to encrypt disk I/O to the volume. The
plaintext data key persists in memory as long as the volume is attached to the instance.
For more information, see How Amazon Elastic Block Store (Amazon EBS) uses AWS KMS and Amazon
EC2 example two in the AWS Key Management Service Developer Guide.
Requirements
Before you begin, verify that the following requirements are met.
Encryption is supported by all EBS volume types. You can expect the same IOPS performance on
encrypted volumes as on unencrypted volumes, with a minimal effect on latency. You can access
encrypted volumes the same way that you access unencrypted volumes. Encryption and decryption are
handled transparently, and they require no additional action from you or your applications.
Amazon EBS encryption is available on all current generation (p. 204) and previous generation (p. 209)
instance types.
When you configure a KMS key as the default key for EBS encryption, the default KMS key policy
allows any user with access to the required KMS actions to use this KMS key to encrypt or decrypt EBS
resources. You must grant users permission to call the following actions in order to use EBS encryption:
• kms:CreateGrant
• kms:Decrypt
• kms:DescribeKey
• kms:GenerateDataKeyWithoutPlainText
• kms:ReEncrypt
Tip
To follow the principle of least privilege, do not allow full access to kms:CreateGrant. Instead,
use the kms:GrantIsForAWSResource condition key to allow the user to create grants on the
KMS key only when the grant is created on the user's behalf by an AWS service, as shown in the
following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "kms:CreateGrant",
"Resource": [
"arn:aws:kms:us-east-2:123456789012:key/abcd1234-a123-456d-a12b-
a123b4cd56ef"
1734
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
],
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": true
}
}
}
]
}
For more information, see Allows access to the AWS account and enables IAM policies in the Default key
policy section in the AWS Key Management Service Developer Guide.
New console
To configure the default KMS key for EBS encryption for a Region
Old console
To configure the default KMS key for EBS encryption for a Region
Encryption by default
You can configure your AWS account to enforce the encryption of the new EBS volumes and snapshot
copies that you create. For example, Amazon EBS encrypts the EBS volumes created when you launch an
instance and the snapshots that you copy from an unencrypted snapshot. For examples of transitioning
from unencrypted to encrypted EBS resources, see Encrypt unencrypted resources (p. 1738).
1735
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
Considerations
• Encryption by default is a Region-specific setting. If you enable it for a Region, you cannot disable it
for individual volumes or snapshots in that Region.
• Amazon EBS encryption by default is supported on all current generation (p. 204) and previous
generation (p. 209) instance types.
• If you copy a snapshot and encrypt it to a new KMS key, a complete (non-incremental) copy is created.
This results in additional storage costs.
• When migrating servers using AWS Server Migration Service (SMS), do not turn on encryption by
default. If encryption by default is already on and you are experiencing delta replication failures, turn
off encryption by default. Instead, enable AMI encryption when you create the replication job.
AWS CLI
1736
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
PowerShell
1737
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
You cannot change the KMS key that is associated with an existing snapshot or encrypted volume.
However, you can associate a different KMS key during a snapshot copy operation so that the resulting
copied snapshot is encrypted by the new KMS key.
When you encrypt a volume, you can specify the symmetric encryption KMS key to use to encrypt
the volume. If you do not specify a KMS key, the KMS key that is used for encryption depends on the
encryption state of the source snapshot and its ownership. For more information, see the encryption
outcomes table (p. 1743).
Note
If you are using the API or AWS CLI to specify a KMS key, be aware that AWS authenticates the
KMS key asynchronously. If you specify a KMS key ID, an alias, or an ARN that is not valid, the
action can appear to complete, but it eventually fails.
You cannot change the KMS key that is associated with an existing snapshot or volume. However, you can
associate a different KMS key during a snapshot copy operation so that the resulting copied snapshot is
encrypted by the new KMS key.
When you create a new, empty EBS volume, you can encrypt it by enabling encryption for the specific
volume creation operation. If you enabled EBS encryption by default, the volume is automatically
encrypted using your default KMS key for EBS encryption. Alternatively, you can specify a different
symmetric encryption KMS key for the specific volume creation operation. The volume is encrypted
by the time it is first available, so your data is always secured. For detailed procedures, see Create an
Amazon EBS volume (p. 1539).
By default, the KMS key that you selected when creating a volume encrypts the snapshots that you
make from the volume and the volumes that you restore from those encrypted snapshots. You cannot
remove encryption from an encrypted volume or snapshot, which means that a volume restored from an
encrypted snapshot, or a copy of an encrypted snapshot, is always encrypted.
Public snapshots of encrypted volumes are not supported, but you can share an encrypted snapshot with
specific accounts. For detailed directions, see Share an Amazon EBS snapshot (p. 1621).
You cannot directly encrypt existing unencrypted volumes or snapshots. However, you can create
encrypted volumes or snapshots from unencrypted volumes or snapshots. If you enable encryption
by default, Amazon EBS automatically encrypts new volumes and snapshots using your default KMS
key for EBS encryption. Otherwise, you can enable encryption when you create an individual volume
or snapshot, using either the default KMS key for Amazon EBS encryption or a symmetric customer
managed encryption key. For more information, see Create an Amazon EBS volume (p. 1539) and Copy
an Amazon EBS snapshot (p. 1593).
To encrypt the snapshot copy to a customer managed key, you must both enable encryption and specify
the KMS key, as shown in Copy an unencrypted snapshot (encryption by default not enabled) (p. 1740).
1738
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
Important
Amazon EBS does not support asymmetric encryption KMS keys. For more information, see
Using Symmetric and Asymmetric encryption KMS keys in the AWS Key Management Service
Developer Guide.
You can also apply new encryption states when launching an instance from an EBS-backed AMI. This is
because EBS-backed AMIs include snapshots of EBS volumes that can be encrypted as described. For
more information, see Use encryption with EBS-backed AMIs (p. 185).
When you enable automatic key rotation for a KMS key, AWS KMS generates new cryptographic material
for the KMS key every year. AWS KMS saves all previous versions of the cryptographic material so you
can decrypt any data encrypted with that KMS key. AWS KMS does not delete any rotated key material
until you delete the KMS key.
When you use a rotated KMS key to encrypt data, AWS KMS uses the current key material. When you use
the rotated KMS key to decrypt data, AWS KMS uses the version of the key material that was used to
encrypt it. You can safely use a rotated KMS key in applications and AWS services without code changes.
Note
Automatic key rotation is supported only for symmetric customer managed keys with key
material that AWS KMS creates. AWS KMS automatically rotates AWS managed keys every year.
You can't enable or disable key rotation for AWS managed keys.
For more information, see Rotating KMS key in the AWS Key Management Service Developer Guide.
Encryption scenarios
When you create an encrypted EBS resource, it is encrypted by your account's default KMS key for EBS
encryption unless you specify a different customer managed key in the volume creation parameters or
the block device mapping for the AMI or instance. For more information, see Default KMS key for EBS
encryption (p. 1735).
The following examples illustrate how you can manage the encryption state of your volumes and
snapshots. For a full list of encryption cases, see the encryption outcomes table (p. 1743).
Examples
• Restore an unencrypted volume (encryption by default not enabled) (p. 1739)
• Restore an unencrypted volume (encryption by default enabled) (p. 1740)
• Copy an unencrypted snapshot (encryption by default not enabled) (p. 1740)
• Copy an unencrypted snapshot (encryption by default enabled) (p. 1741)
• Re-encrypt an encrypted volume (p. 1741)
• Re-encrypt an encrypted snapshot (p. 1742)
• Migrate data between encrypted and unencrypted volumes (p. 1742)
• Encryption outcomes (p. 1743)
Without encryption by default enabled, a volume restored from an unencrypted snapshot is unencrypted
by default. However, you can encrypt the resulting volume by setting the Encrypted parameter and,
optionally, the KmsKeyId parameter. The following diagram illustrates the process.
1739
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
If you leave out the KmsKeyId parameter, the resulting volume is encrypted using your default KMS key
for EBS encryption. You must specify a KMS key ID to encrypt the volume to a different KMS key.
For more information, see Create a volume from a snapshot (p. 1541).
When you have enabled encryption by default, encryption is mandatory for volumes restored from
unencrypted snapshots, and no encryption parameters are required for your default KMS key to be used.
The following diagram shows this simple default case:
If you want to encrypt the restored volume to a symmetric customer managed encryption key, you must
supply both the Encrypted and KmsKeyId parameters as shown in Restore an unencrypted volume
(encryption by default not enabled) (p. 1739).
1740
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
You can encrypt an EBS volume by copying an unencrypted snapshot to an encrypted snapshot and
then creating a volume from the encrypted snapshot. For more information, see Copy an Amazon EBS
snapshot (p. 1593).
When you have enabled encryption by default, encryption is mandatory for copies of unencrypted
snapshots, and no encryption parameters are required if your default KMS key is used. The following
diagram illustrates this default case:
When the CreateVolume action operates on an encrypted snapshot, you have the option of re-
encrypting it with a different KMS key. The following diagram illustrates the process. In this example,
you own two KMS keys, KMS key A and KMS key B. The source snapshot is encrypted by KMS key A.
During volume creation, with the KMS key ID of KMS key B specified as a parameter, the source data is
automatically decrypted, then re-encrypted by KMS key B.
1741
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
For more information, see Create a volume from a snapshot (p. 1541).
The ability to encrypt a snapshot during copying allows you to apply a new symmetric encryption KMS
key to an already-encrypted snapshot that you own. Volumes restored from the resulting copy are only
accessible using the new KMS key. The following diagram illustrates the process. In this example, you
own two KMS keys, KMS key A and KMS key B. The source snapshot is encrypted by KMS key A. During
copy, with the KMS key ID of KMS key B specified as a parameter, the source data is automatically re-
encrypted by KMS key B.
In a related scenario, you can choose to apply new encryption parameters to a copy of a snapshot that
has been shared with you. By default, the copy is encrypted with a KMS key shared by the snapshot's
owner. However, we recommend that you create a copy of the shared snapshot using a different KMS
key that you control. This protects your access to the volume if the original KMS key is compromised, or
if the owner revokes the KMS key for any reason. For more information, see Encryption and snapshot
copying (p. 1595).
When you have access to both an encrypted and unencrypted volume, you can freely transfer data
between them. EC2 carries out the encryption and decryption operations transparently.
For example, use the robocopy command to copy the data. In the following command, the source data is
located in D:\ and the destination volume is mounted at E:\.
1742
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
We recommend using folders rather than copying an entire volume, as this avoids potential problems
with hidden folders.
Encryption outcomes
The following table describes the encryption outcome for each possible combination of settings.
1743
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
* This is the default customer managed key used for EBS encryption for the AWS account and Region. By
default this is a unique AWS managed key for EBS, or you can specify a customer managed key. For more
information, see Default KMS key for EBS encryption (p. 1735).
** This is a customer managed key specified for the volume at launch time. This customer managed key is
used instead of the default customer managed key for the AWS account and Region.
1744
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
To get started, enable fast snapshot restore for specific snapshots in specific Availability Zones. Each
snapshot and Availability Zone pair refers to one fast snapshot restore. When you create a volume
from one of these snapshots in one of its enabled Availability Zones, the volume is restored using fast
snapshot restore.
Fast snapshot restore must be explicitly enabled on a per-snapshot basis. If you create a new snapshot
from a volume that was restored from a fast snapshot restore-enabled snapshot, the new snapshot is not
automatically enabled for fast snapshot restore. You must explicitly enable it for the new snapshot.
The number of volumes that you can restore with the full performance benefit of fast snapshot restore
is determined by volume creation credits for the snapshot. For more information see Volume creation
credits (p. 1745).
You can enable fast snapshot restore for snapshots that you own and for public and private snapshots
that are shared with you.
Contents
• Considerations (p. 1745)
• Volume creation credits (p. 1745)
• Manage fast snapshot restore (p. 1746)
• Monitor fast snapshot restore (p. 1749)
• Fast snapshot restore quotas (p. 1749)
• Pricing and Billing (p. 1749)
Considerations
• Fast snapshot restore is not supported with AWS Outposts, Local Zones, and Wavelength Zones.
• Fast snapshot restore can be enabled on snapshots with a size of 16 TiB or less.
• Volumes provisioned with performance up to 64,000 IOPS and 1,000 MiB/s throughput receive the full
performance benefit of fast snapshot restore. For volumes provisioned with performance greater than
64,000 IOPS or 1,000 MiB/s throughput, we recommend that you initialize the volume (p. 1779) to
receive its full performance.
1745
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
volume from the snapshot. If you create a volume but there is less than one credit in the bucket, the
volume is created without benefit of fast snapshot restore.
When you enable fast snapshot restore for a snapshot that is shared with you, you get a separate credit
bucket for the shared snapshot in your account. If you create volumes from the shared snapshot, the
credits are consumed from your credit bucket; they are not consumed from the snapshot owner's credit
bucket.
The size of a credit bucket and the rate at which it refills depends on the size of the snapshot, not the
size of the volumes created from the snapshot.
When you enable fast snapshot restore for a snapshot, the credit bucket starts with zero credits, and it
gets filled at a set rate until it reaches its maximum credit capacity. Also, as you consume credits, the
credit bucket is refilled over time until it reaches its maximum credit capacity.
For example, if you enable fast snapshot restore for a snapshot with a size of 128 GiB, the fill rate is
0.1333 credits per minute.
In this example, when you enable fast snapshot restore, the credit bucket starts with zero credits. After
8 minutes, the credit bucket has enough credits to create one initialized volume (0.1333 credits ×
8 minutes = 1.066 credits). When the credit bucket is full, you can create 8 initialized volumes
simultaneously (8 credits). When the bucket is below its maximum capacity, it refills with 0.1333 credits
per minute.
You can use Cloudwatch metrics to monitor the size of your credit buckets and the number of credits
available in each bucket. For more information, see Fast snapshot restore metrics (p. 1793).
After you create a volume from a snapshot with fast snapshot restore enabled, you can describe the
volume using describe-volumes and check the fastRestored field in the output to determine whether
the volume was created as an initialized volume using fast snapshot restore.
1746
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
Fast snapshot restore is disabled for a snapshot by default. You can enable or disable fast snapshot
restore for snapshots that you own and for snapshots that are shared with you. When you enable or
disable fast snapshot restore for a snapshot, the changes apply to your account only.
Note
When you enable fast snapshot restore for a snapshot, your account is billed for each minute
that fast snapshot restore is enabled in a particular Availability Zone. Charges are pro-rated and
have a minimum of one hour.
When you delete a snapshot that you own, fast snapshot restore is automatically disabled for that
snapshot in your account. If you enabled fast snapshot restore for a snapshot that is shared with you,
and the snapshot owner deletes or unshares it, fast snapshot restore is automatically disabled for the
shared snapshot in your account.
If you enabled fast snapshot restore for a snapshot that is shared with you, and it has been encrypted
using a custom CMK, fast snapshot restore is not automatically disabled for the snapshot when the
snapshot owner revokes your access to the custom CMK. You must manually disable fast snapshot
restore for that snapshot.
Use one of the following methods to enable or disable fast snapshot restore for a snapshot that you own
or for a snapshot that is shared with you.
Console
To enable fast snapshot restore in a zone where it is currently disabled, select the zone, choose
Enable, and then to confirm, choose Enable.
To disable fast snapshot restore in a zone where it is currently enabled, select the zone, and
then choose Disable.
5. After you have made the required changes, choose Close.
AWS CLI
• enable-fast-snapshot-restores
• disable-fast-snapshot-restores
• describe-fast-snapshot-restores
Note
After you enable fast snapshot restore for a snapshot, it enters the optimizing state.
Snapshots that are in the optimizing state provide some performance benefits when using
1747
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
them to restore volumes. They start to provide the full performance benefits of fast snapshot
restore only after they enter the enabled state.
Fast snapshot restore for a snapshot can be in one of the following states.
Use one of the following methods to view the state of fast snapshot restore for a snapshot that you own
or for a snapshot that is shared with you.
Console
AWS CLI
To view snapshots with fast snapshot restore enabled using the AWS CLI
Use the describe-fast-snapshot-restores command to describe the snapshots that are enabled for
fast snapshot restore.
{
"FastSnapshotRestores": [
{
"SnapshotId": "snap-0e946653493cb0447",
"AvailabilityZone": "us-east-2a",
"State": "enabled",
"StateTransitionReason": "Client.UserInitiated - Lifecycle state
transition",
"OwnerId": "123456789012",
"EnablingTime": "2020-01-25T23:57:49.596Z",
"OptimizingTime": "2020-01-25T23:58:25.573Z",
"EnabledTime": "2020-01-25T23:59:29.852Z"
},
{
"SnapshotId": "snap-0e946653493cb0447",
"AvailabilityZone": "us-east-2b",
"State": "enabled",
1748
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS data services
When you create a volume from a snapshot that is enabled for fast snapshot restore in the Availability
Zone for the volume, it is restored using fast snapshot restore.
Use the describe-volumes command to view volumes that were created from a snapshot that is enabled
for fast snapshot restore.
{
"Volumes": [
{
"Attachments": [],
"AvailabilityZone": "us-east-2a",
"CreateTime": "2020-01-26T00:34:11.093Z",
"Encrypted": true,
"KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/8c5b2c63-b9bc-45a3-
a87a-5513e232e843",
"Size": 20,
"SnapshotId": "snap-0e946653493cb0447",
"State": "available",
"VolumeId": "vol-0d371921d4ca797b0",
"Iops": 100,
"VolumeType": "gp2",
"FastRestored": true
}
]
}
1749
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes and NVMe
For example, if you enable fast snapshot restore for one snapshot in US-East-1a for one month (30
days), you are billed $540 (1 snapshot x 1 AZ x 720 hours x $0.75 per hour). If you enable fast snapshot
restore for two snapshots in us-east-1a, us-east-1b, and us-east-1c for the same period, you are
billed $3240 (2 snapshots x 3 AZs x 720 hours x $0.75 per hour).
If you enable fast snapshot restore for a public or private snapshot that is shared with you, your account
is billed; the snapshot owner is not billed. When a snapshot that is shared with you is deleted or
unshared by the snapshot owner, fast snapshot restore is disabled for the snapshot in your account and
billing is stopped.
The EBS performance guarantees stated in Amazon EBS Product Details are valid regardless of the block-
device interface.
For information about EBS volumes and NVME on Linux instances, see the User Guide for Linux Instances.
Contents
• Install or upgrade the NVMe driver (p. 1750)
• Identify the EBS device (p. 1750)
• Work with NVMe EBS volumes (p. 1751)
• I/O operation timeout (p. 1751)
• Abort command (p. 1751)
You can also download ebsnvme-id.zip and extract the contents to your Amazon EC2 instance to get
access to ebsnvme-id.exe.
1750
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS volumes and NVMe
PS C:\Users\Administrator\Desktop> ebsnvme-id.exe
Disk Number: 0
Volume ID: vol-0d6d7ee9f6e471a7f
Device Name: sda1
Disk Number: 1
Volume ID: vol-03a26248ff39b57cf
Device Name: xvdd
Disk Number: 2
Volume ID: vol-038bd1c629aa125e6
Device Name: xvde
Disk Number: 3
Volume ID: vol-034f9d29ec0b64c89
Device Name: xvdb
Disk Number: 4
Volume ID: vol-03e2dbe464b66f0a1
Device Name: xvdc
PS C:\Users\Administrator\Desktop> ebsnvme-id.exe 4
Disk Number: 4
Volume ID: vol-03e2dbe464b66f0a1
Device Name: xvdc
Abort command
The Abort command is an NVMe Admin command that is issued to abort a specific command that was
previously submitted to the controller. This command is typically issued by the device driver to storage
devices that have exceeded the I/O operation timeout threshold. Amazon EC2 instance types that
support the Abort command by default will abort a specific command that was previously submitted to
the controller of the attached Amazon EBS device to which an Abort command is issued.
The following instance types support the Abort command for all attached Amazon EBS volumes by
default: R5b, R6i, M6i, M6a, C6gn, C6i, X2gd, X2iezn, Im4gn, Is4gen.
Other instance types take no action when Abort commands are issued to attached Amazon EBS
volumes.
Amazon EBS devices with NVMe device version 1.4 or higher support the Abort command.
For more information, see section 5.1 Abort command of the NVM Express Base Specification.
1751
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
EBS–optimized instances deliver dedicated bandwidth to Amazon EBS. When attached to an EBS–
optimized instance, General Purpose SSD (gp2 and gp3) volumes are designed to deliver at least 90%
of their provisioned IOPS performance 99% of the time in a given year, and Provisioned IOPS SSD (io1
and io2) volumes are designed to deliver at least 90% of their provisioned IOPS performance 99.9% of
the time in a given year. Both Throughput Optimized HDD (st1) and Cold HDD (sc1) deliver at least 90%
of their expected throughput performance 99% of the time in a given year. Non-compliant periods are
approximately uniformly distributed, targeting 99% of expected total throughput each hour. For more
information, see Amazon EBS volume types (p. 1520).
Contents
• Supported instance types (p. 1752)
• Get maximum performance (p. 1771)
• View instances types that support EBS optimization (p. 1772)
• Enable EBS optimization at launch (p. 1773)
• Enable EBS optimization for an existing instance (p. 1773)
Choose an EBS–optimized instance that provides more dedicated Amazon EBS throughput than your
application needs; otherwise, the connection between Amazon EBS and Amazon EC2 can become a
performance bottleneck.
Topics
• EBS optimized by default (p. 1752)
• EBS optimization supported (p. 1770)
Topics
• General purpose (p. 1753)
• Compute optimized (p. 1758)
• Memory optimized (p. 1761)
• Storage optimized (p. 1767)
• Accelerated computing (p. 1769)
1752
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
General purpose
Important
Instances indicated with an asterisk (*) can support maximum performance for 30 minutes at
least once every 24 hours, after which they revert to their baseline performance.
Instances not indicated with an asterisk can sustain the maximum performance indefinitely. If
your workload requires sustained maximum performance for longer than 30 minutes, use one of
these instances.
1753
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1754
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1755
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1756
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1757
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
Compute optimized
Important
Instances indicated with an asterisk (*) can support maximum performance for 30 minutes at
least once every 24 hours, after which they revert to their baseline performance.
Instances not indicated with an asterisk can sustain the maximum performance indefinitely. If
your workload requires sustained maximum performance for longer than 30 minutes, use one of
these instances.
1758
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1759
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1760
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
Memory optimized
Important
Instances indicated with an asterisk (*) can support maximum performance for 30 minutes at
least once every 24 hours, after which they revert to their baseline performance.
Instances not indicated with an asterisk can sustain the maximum performance indefinitely. If
your workload requires sustained maximum performance for longer than 30 minutes, use one of
these instances.
1761
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1762
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1763
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1764
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1765
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
u-6tb1.112xlarge
38000 4750.0 160000
u-9tb1.112xlarge
38000 4750.0 160000
u-12tb1.112xlarge
38000 4750.0 160000
1766
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
Storage optimized
Important
Instances indicated with an asterisk (*) can support maximum performance for 30 minutes at
least once every 24 hours, after which they revert to their baseline performance.
Instances not indicated with an asterisk can sustain the maximum performance indefinitely. If
your workload requires sustained maximum performance for longer than 30 minutes, use one of
these instances.
1767
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1768
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
Accelerated computing
Important
Instances indicated with an asterisk (*) can support maximum performance for 30 minutes at
least once every 24 hours, after which they revert to their baseline performance.
Instances not indicated with an asterisk can sustain the maximum performance indefinitely. If
your workload requires sustained maximum performance for longer than 30 minutes, use one of
these instances.
1769
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
1770
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
Note
You can also view this information programatically using the AWS CLI. For more information, see
View instances types that support EBS optimization (p. 1772).
Instance size Maximum bandwidth Maximum throughput Maximum IOPS (16 KiB
(Mbps) (MB/s, 128 KiB I/O) I/O)
The i2.8xlarge, c3.8xlarge, and r3.8xlarge instances do not have dedicated EBS bandwidth and
therefore do not offer EBS optimization. On these instances, network traffic and Amazon EBS traffic
share the same 10-gigabit network interface.
The high memory instances are designed to run large in-memory databases, including production
deployments of the SAP HANA in-memory database, in the cloud. To maximize EBS performance,
use high memory instances with an even number of io1 or io2 volumes with identical provisioned
performance. For example, for IOPS heavy workloads, use four io1 or io2 volumes with 40,000
provisioned IOPS to get the maximum 160,000 instance IOPS. Similarly, for throughput heavy workloads,
1771
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
use six io1 or io2 volumes with 48,000 provisioned IOPS to get the maximum 4,750 MB/s throughput.
For additional recommendations, see Storage Configuration for SAP HANA.
Considerations
• G4dn, I3en, M5a, M5ad, R5a, R5ad, T3, T3a, and Z1d instances launched after February 26, 2020
provide the maximum performance listed in the table above. To get the maximum performance from
an instance launched before February 26, 2020, stop and start it.
• C5, C5d, C5n, M5, M5d, M5n, M5dn, R5, R5d, R5n, R5dn, and P3dn instances launched after
December 3, 2019 provide the maximum performance listed in the table above. To get the maximum
performance from an instance launched before December 3, 2019, stop and start it.
• u-6tb1.metal, u-9tb1.metal, and u-12tb1.metal instances launched after March 12, 2020
provide the performance in the table above. Instances of these types launched before March 12, 2020
might provide lower performance. To get the maximum performance from an instance launched
before March 12, 2020, contact your account team to upgrade the instance at no additional cost.
To view the instance types that support EBS optimization and that have it enabled by default
-----------------------------------------------------------------------------------------------
| DescribeInstanceTypes
|
+--------------+--------------------+---------------------+-----------
+-----------------------+
| EBSOptimized | InstanceType | MaxBandwidth(Mb/s) | MaxIOPS | MaxThroughput(MB/
s) |
+--------------+--------------------+---------------------+-----------
+-----------------------+
| default | m5dn.8xlarge | 6800 | 30000 | 850.0
|
| default | m6gd.xlarge | 4750 | 20000 | 593.75
|
| default | c4.4xlarge | 2000 | 16000 | 250.0
|
| default | r4.16xlarge | 14000 | 75000 | 1750.0
|
| default | m5ad.large | 2880 | 16000 | 360.0
|
...
To view the instance types that support EBS optimization but do not have it enabled by default
1772
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS optimization
--query "InstanceTypes[].{InstanceType:InstanceType,\"MaxBandwidth(Mb/
s)\":EbsInfo.EbsOptimizedInfo.MaximumBandwidthInMbps,MaxIOPS:EbsInfo.EbsOptimizedInfo.MaximumIops,
\"MaxThroughput(MB/s)\":EbsInfo.EbsOptimizedInfo.MaximumThroughputInMBps}" ^
--filters Name=ebs-info.ebs-optimized-support,Values=supported --output=table
------------------------------------------------------------------------------------------
| DescribeInstanceTypes |
+--------------+---------------+----------------------+----------+-----------------------+
| EBSOptimized | InstanceType | MaxBandwidth(Mb/s) | MaxIOPS | MaxThroughput(MB/s) |
+--------------+---------------+----------------------+----------+-----------------------+
| supported | m2.4xlarge | 1000 | 8000 | 125.0 |
| supported | i2.2xlarge | 1000 | 8000 | 125.0 |
| supported | r3.4xlarge | 2000 | 16000 | 250.0 |
| supported | m3.xlarge | 500 | 4000 | 62.5 |
| supported | r3.2xlarge | 1000 | 8000 | 125.0 |
...
To enable Amazon EBS optimization when launching an instance using the console
To enable EBS optimization when launching an instance using the command line
You can use one of the following commands with the corresponding option. For more information about
these command line interfaces, see Access Amazon EC2 (p. 3).
1773
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
To enable EBS optimization for an existing instance using the command line
1. If the instance is running, use one of the following commands to stop it:
AWS updates to the performance of EBS volume types might not immediately take effect on your
existing volumes. To see full performance on an older volume, you might first need to perform a
ModifyVolume action on it. For more information, see Modifying the Size, IOPS, or Type of an EBS
Volume on Windows.
Contents
• Amazon EBS performance tips (p. 1775)
• I/O characteristics and monitoring (p. 1776)
• Initialize Amazon EBS volumes (p. 1779)
• RAID configuration on Windows (p. 1781)
• Benchmark EBS volumes (p. 1785)
1774
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
• Access each block prior to putting the volume into production. This process is called initialization
(formerly known as pre-warming). For more information, see Initialize Amazon EBS volumes (p. 1779).
• Enable fast snapshot restore on a snapshot to ensure that the EBS volumes created from it are fully-
initialized at creation and instantly deliver all of their provisioned performance. For more information,
see Amazon EBS fast snapshot restore (p. 1745).
Your performance can also be impacted if your application isn’t sending enough I/O requests. This can
be monitored by looking at your volume’s queue length and I/O size. The queue length is the number
of pending I/O requests from your application to your volume. For maximum consistency, HDD-backed
volumes must maintain a queue length (rounded to the nearest whole number) of 4 or more when
performing 1 MiB sequential I/O. For more information about ensuring consistent performance of your
volumes, see I/O characteristics and monitoring (p. 1776)
1775
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
Topics
• IOPS (p. 1776)
• Volume queue length and latency (p. 1777)
• I/O size and volume throughput limits (p. 1777)
• Monitor I/O characteristics using CloudWatch (p. 1778)
• Related resources (p. 1779)
IOPS
IOPS are a unit of measure representing input/output operations per second. The operations are
measured in KiB, and the underlying drive technology determines the maximum amount of data that a
volume type counts as a single I/O. I/O size is capped at 256 KiB for SSD volumes and 1,024 KiB for HDD
volumes because SSD volumes handle small or random I/O much more efficiently than HDD volumes.
When small I/O operations are physically sequential, Amazon EBS attempts to merge them into a single
I/O operation up to the maximum I/O size. Similarly, when I/O operations are larger than the maximum
I/O size, Amazon EBS attempts to split them into smaller I/O operations. The following table shows
some examples.
SSD 256 KiB 1 x 1024 KiB I/O 4 (1,024÷256=4) Amazon EBS splits
operation the 1,024 I/O
operation into four
smaller 256 KiB
operations.
1776
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
Consequently, when you create an SSD-backed volume supporting 3,000 IOPS (either by provisioning a
Provisioned IOPS SSD volume at 3,000 IOPS or by sizing a General Purpose SSD volume at 1,000 GiB),
and you attach it to an EBS-optimized instance that can provide sufficient bandwidth, you can transfer
up to 3,000 I/Os of data per second, with throughput determined by I/O size.
Optimal queue length varies for each workload, depending on your particular application's sensitivity to
IOPS and latency. If your workload is not delivering enough I/O requests to fully use the performance
available to your EBS volume, then your volume might not deliver the IOPS or throughput that you have
provisioned.
Transaction-intensive applications are sensitive to increased I/O latency and are well-suited for SSD-
backed volumes. You can maintain high IOPS while keeping latency down by maintaining a low queue
length and a high number of IOPS available to the volume. Consistently driving more IOPS to a volume
than it has available can cause increased I/O latency.
Throughput-intensive applications are less sensitive to increased I/O latency, and are well-suited for
HDD-backed volumes. You can maintain high throughput to HDD-backed volumes by maintaining a high
queue length when performing large, sequential I/O.
1777
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
3,000 IOPS because the throughput is well below 250 MiB/s. (These examples assume that your volume's
I/O is not hitting the throughput limits of the instance.) For more information about the throughput
limits for each EBS volume type, see Amazon EBS volume types (p. 1520).
For smaller I/O operations, you may see a higher-than-provisioned IOPS value as measured from inside
your instance. This happens when the instance operating system merges small I/O operations into a
larger operation before passing them to Amazon EBS.
If your workload uses sequential I/Os on HDD-backed st1 and sc1 volumes, you may experience a
higher than expected number of IOPS as measured from inside your instance. This happens when the
instance operating system merges sequential I/Os and counts them in 1,024 KiB-sized units. If your
workload uses small or random I/Os, you may experience a lower throughput than you expect. This is
because we count each random, non-sequential I/O toward the total IOPS count, which can cause you to
hit the volume's IOPS limit sooner than expected.
Important
Whatever your EBS volume type, if you are not experiencing the IOPS or throughput you expect
in your configuration, ensure that your EC2 instance bandwidth is not the limiting factor. You
should always use a current-generation, EBS-optimized instance (or one that includes 10 Gb/
s network connectivity) for optimal performance. For more information, see Amazon EBS–
optimized instances (p. 1752). Another possible cause for not experiencing the expected IOPS is
that you are not driving enough I/O to the EBS volumes.
• BurstBalance
• VolumeReadBytes
• VolumeWriteBytes
• VolumeReadOps
• VolumeWriteOps
• VolumeQueueLength
BurstBalance displays the burst bucket balance for gp2, st1, and sc1 volumes as a percentage of
the remaining balance. When your burst bucket is depleted, volume I/O (for gp2 volumes) or volume
throughput (for st1 and sc1 volumes) is throttled to the baseline. Check the BurstBalance value to
determine whether your volume is being throttled for this reason. For a complete list of the available
Amazon EBS metrics, see Amazon EBS metrics (p. 1788) and Amazon EBS metrics for Nitro-based
instances (p. 1144).
HDD-backed st1 and sc1 volumes are designed to perform best with workloads that take
advantage of the 1,024 KiB maximum I/O size. To determine your volume's average I/O size, divide
VolumeWriteBytes by VolumeWriteOps. The same calculation applies to read operations. If average
I/O size is below 64 KiB, increasing the size of the I/O operations sent to an st1 or sc1 volume should
improve performance.
Note
If average I/O size is at or near 44 KiB, you might be using an instance or kernel without support
for indirect descriptors. Any Linux kernel 3.8 and above has this support, as well as any current-
generation instance.
If your I/O latency is higher than you require, check VolumeQueueLength to make sure your application
is not trying to drive more IOPS than you have provisioned. If your application requires a greater number
of IOPS than your volume can provide, you should consider using one of the following:
1778
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
Related resources
For more information about Amazon EBS I/O characteristics, see the following re:Invent presentation:
Amazon EBS: Designing for Performance.
For volumes that were created from snapshots, the storage blocks must be pulled down from Amazon
S3 and written to the volume before you can access them. This preliminary action takes time and can
cause a significant increase in the latency of I/O operations the first time each block is accessed. Volume
performance is achieved after all blocks have been downloaded and written to the volume.
Important
While initializing Provisioned IOPS SSD volumes that were created from snapshots, the
performance of the volume may drop below 50 percent of its expected level, which causes the
volume to display a warning state in the I/O Performance status check. This is expected, and
you can ignore the warning state on Provisioned IOPS SSD volumes while you are initializing
them. For more information, see EBS volume status checks (p. 1559).
For most applications, amortizing the initialization cost over the lifetime of the volume is acceptable. To
avoid this initial performance hit in a production environment, you can use one of the following options:
• Force the immediate initialization of the entire volume. For more information, see Initialize Amazon
EBS volumes on Windows (p. 1779).
• Enable fast snapshot restore on a snapshot to ensure that the EBS volumes created from it are fully-
initialized at creation and instantly deliver all of their provisioned performance. For more information,
see Amazon EBS fast snapshot restore (p. 1745).
For information about initializing Amazon EBS volumes on Linux, see Initializing Amazon EBS volumes on
Linux.
Before using either tool, gather information about the disks on your system as follows:
1. Use the wmic command to list the available disks on your system:
DeviceID Size
\\.\PHYSICALDRIVE2 80517265920
1779
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
\\.\PHYSICALDRIVE1 80517265920
\\.\PHYSICALDRIVE0 128849011200
\\.\PHYSICALDRIVE3 107372805120
2. Identify the disk to initialize using dd or fio. The C: drive is on \\.\PHYSICALDRIVE0. You can use
the diskmgmt.msc utility to compare drive letters to disk drive numbers if you are not sure which
drive number to use.
Use dd
Important considerations
• Initializing a volume takes from several minutes up to several hours, depending on your EC2 instance
bandwidth, the IOPS provisioned for the volume, and the size of the volume.
• Incorrect use of dd can easily destroy a volume's data. Be sure to follow this procedure precisely.
The dd for Windows program provides a similar experience to the dd program that is commonly
available for Linux and Unix systems, and it enables you to initialize Amazon EBS volumes that have been
created from snapshots. The most recent beta versions support the /dev/null virtual device. If you
install an earlier version, you can use the nul virtual device instead. Full documentation is available at
http://www.chrysocome.net/dd.
1. Download the most recent binary version of dd for Windows from http://www.chrysocome.net/dd.
2. (Optional) Create a folder for command line utilities that is easy to locate and remember, such as
C:\bin. If you already have a designated folder for command line utilities, you can use that folder
instead in the following step.
3. Unzip the binary package and copy the dd.exe file to your command line utilities folder (for
example, C:\bin).
4. Add the command line utilities folder to your Path environment variable so you can run the
programs in that folder from anywhere.
a. Choose Start, open the context (right-click) menu for Computer, and then choose Properties.
b. Choose Advanced system settings, Environment Variables.
c. For System Variables, select the variable Path and choose Edit.
d. For Variable value, append a semicolon and the location of your command line utility folder
(;C:\bin\) to the end of the existing value.
e. Choose OK to close the Edit System Variable window.
5. Open a new command prompt window. The previous step doesn't update the environment variables
in your current command prompt windows. The command prompt windows that you open now that
you completed the previous step are updated.
Run the following command to read all blocks on the specified device (and send the output to the /dev/
null virtual device). This command safely initializes your existing data.
You might get an error if dd attempts to read beyond the end of the volume. You can safely ignore this
error.
1780
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
If you used an earlier version of the dd command, it does not support the /dev/null device. Instead,
you can use the nul device as follows.
Use fio
Complete the following procedures to install and use fio to initialize a volume.
1. Download the fio MSI installer by expanding Assets for the latest release and selecting the MSI
installer.
2. Install fio.
2. When the operation completes, you are ready to use your new volume. For more information, see
Make an Amazon EBS volume available for use on Windows (p. 1543).
Amazon EBS volume data is replicated across multiple servers in an Availability Zone to prevent the loss
of data from the failure of any single component. This replication makes Amazon EBS volumes ten times
more reliable than typical commodity disk drives. For more information, see Amazon EBS Availability and
Durability in the Amazon EBS product detail pages.
Note
You should avoid booting from a RAID volume. If one of the devices fails, you may be unable to
boot the operating system.
If you need to create a RAID array on a Linux instance, see RAID configuration on Linux in the Amazon
EC2 User Guide for Linux Instances.
Contents
• RAID configuration options (p. 1781)
• Create a RAID 0 array on Windows (p. 1782)
• Create snapshots of volumes in a RAID array (p. 1785)
1781
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
importance. With RAID 0, I/O is distributed across the volumes in a stripe. If you add a volume, you get
the straight addition of throughput and IOPS. However, keep in mind that performance of the stripe is
limited to the worst performing volume in the set, and that the loss of a single volume in the set results
in a complete data loss for the array.
The resulting size of a RAID 0 array is the sum of the sizes of the volumes within it, and the bandwidth
is the sum of the available bandwidth of the volumes within it. For example, two 500 GiB io1 volumes
with 4,000 provisioned IOPS each create a 1000 GiB RAID 0 array with an available bandwidth of 8,000
IOPS and 1,000 MiB/s of throughput.
Important
RAID 5 and RAID 6 are not recommended for Amazon EBS because the parity write operations
of these RAID modes consume some of the IOPS available to your volumes. Depending on the
configuration of your RAID array, these RAID modes provide 20-30% fewer usable IOPS than
a RAID 0 configuration. Increased cost is a factor with these RAID modes as well; when using
identical volume sizes and speeds, a 2-volume RAID 0 array can outperform a 4-volume RAID 6
array that costs twice as much.
RAID 1 is also not recommended for use with Amazon EBS. RAID 1 requires more Amazon
EC2 to Amazon EBS bandwidth than non-RAID configurations because the data is written to
multiple volumes simultaneously. In addition, RAID 1 does not provide any write performance
improvement.
Before you perform this procedure, you need to decide how large your RAID 0 array should be and how
many IOPS you want to provision.
Use the following procedure to create the RAID 0 array. Note that you can get directions for Linux
instances from Create a RAID 0 array on Linux in the Amazon EC2 User Guide for Linux Instances.
1. Create the Amazon EBS volumes for your array. For more information, see Create an Amazon EBS
volume (p. 1539).
Important
Create volumes with identical size and IOPS performance values for your array. Make sure
you do not create an array that exceeds the available bandwidth of your EC2 instance.
2. Attach the Amazon EBS volumes to the instance that you want to host the array. For more
information, see Attach an Amazon EBS volume to an instance (p. 1542).
3. Connect to your Windows instance. For more information, see Connect to your Windows
instance (p. 610).
4. Open a command prompt and type the diskpart command.
diskpart
5. At the DISKPART prompt, list the available disks with the following command.
1782
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
Disk 1 Online 8 GB 0 B
Disk 2 Online 8 GB 0 B
Identify the disks you want to use in your array and take note of their disk numbers.
6. Each disk you want to use in your array must be an online dynamic disk that does not contain any
existing volumes. Use the following steps to convert basic disks to dynamic disks and to delete any
existing volumes.
a. Select a disk you want to use in your array with the following command, substituting n with
your disk number.
b. If the selected disk is listed as Offline, bring it online by running the online disk command.
c. If the selected disk does not have an asterisk in the Dyn column in the previous list disk
command output, you need to convert it to a dynamic disk.
Note
If you receive an error that the disk is write protected, you can clear the read-only flag
with the ATTRIBUTE DISK CLEAR READONLY command and then try the dynamic disk
conversion again.
d. Use the detail disk command to check for existing volumes on the selected disk.
Note any volume numbers on the disk. In this example, the volume number is 2. If there are no
volumes, you can skip the next step.
e. (Only required if volumes were identified in the previous step) Select and delete any existing
volumes on the disk that you identified in the previous step.
Warning
This destroys any existing data on the volume.
1783
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
iii. Repeat these substeps for each volume you need to delete on the selected disk.
f. Repeat Step 6 (p. 1783) for each disk you want to use in your array.
7. Verify that the disks you want to use are now dynamic. In this case, we're using disks 1 and 2 for the
RAID volume.
8. Create your raid array. On Windows, a RAID 0 volume is referred to as a striped volume.
To create a striped volume array on disks 1 and 2, use the following command (note the stripe
option to stripe the array):
Note that the Type column now indicates that Volume 1 is a stripe volume.
10. Select and format your volume so that you can begin using it.
a. Select the volume you want to format, substituting n with your volume number.
1784
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
To create a consistent set of snapshots for your RAID array, use EBS multi-volume snapshots. Multi-
volume snapshots allow you to take point-in-time, data coordinated, and crash-consistent snapshots
across multiple EBS volumes attached to an EC2 instance. You do not have to stop your instance to
coordinate between volumes to ensure consistency because snapshots are automatically taken across
multiple EBS volumes. For more information, see the steps for creating multi-volume snapshots under
Creating Amazon EBS snapshots.
Important
Some of the procedures result in the destruction of existing data on the EBS volumes you
benchmark. The benchmarking procedures are intended for use on volumes specially created for
testing purposes, not production volumes.
To create an EBS-optimized instance, choose Launch as an EBS-Optimized instance when launching the
instance using the Amazon EC2 console, or specify --ebs-optimized when using the command line. Be
1785
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
sure that you launch a current-generation instance that supports this option. For more information, see
Amazon EBS–optimized instances (p. 1752).
Tool Description
DiskSpd DiskSpd is a storage performance tool from the Windows, Windows Server, and
Cloud Server Infrastructure engineering teams at Microsoft. It is available for
download at https://github.com/Microsoft/diskspd/releases.
After you download the diskspd.exe executable file, open a command prompt
with administrative rights (by choosing "Run as Administrator"), and then
navigate to the directory where you copied the diskspd.exe file.
Copy the desired diskspd.exe executable file from the appropriate executable
folder (amd64fre, armfre or x86fre) to a short, simple path like C:\DiskSpd.
In most cases you will want the 64-bit version of DiskSpd from the amd64fre
folder.
These benchmarking tools support a wide variety of test parameters. You should use commands that
approximate the workloads your volumes will support. These commands provided below are intended as
examples to help you get started.
1786
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS performance
and the provisioned amount for Provisioned IOPS SSD volumes). Then you can monitor your application
performance and tune that value based on your application requirements.
Increasing the queue length is beneficial until you achieve the provisioned IOPS, throughput or optimal
system queue length value, which is currently set to 32. For example, a volume with 3,000 provisioned
IOPS should target a queue length of 3. You should experiment with tuning these values up or down to
see what performs best for your application.
To determine the optimal queue length for your workload on HDD-backed volumes, we recommend that
you target a queue length of at least 4 while performing 1MiB sequential I/Os. Then you can monitor
your application performance and tune that value based on your application requirements. For example,
a 2 TiB st1 volume with burst throughput of 500 MiB/s and IOPS of 500 should target a queue length
of 4, 8, or 16 while performing 1,024 KiB, 512 KiB, or 256 KiB sequential I/Os respectively. You should
experiment with tuning these values value up or down to see what performs best for your application.
Disable C-states
Before you run benchmarking, you should disable processor C-states. Temporarily idle cores in a
supported CPU can enter a C-state to save power. When the core is called on to resume processing, a
certain amount of time passes until the core is again fully operational. This latency can interfere with
processor benchmarking routines. For more information about C-states and which EC2 instance types
support them, see Processor state control for your EC2 instance.
5. Disable C-states by setting the value of the index to 1. A value of 0 indicates that C-states are
disabled.
powercfg /
setacvalueindex <power_scheme_guid> <power_setting_subgroup_guid> <power_setting_guid>
1
1787
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
Perform benchmarking
The following procedures describe benchmarking commands for various EBS volume types.
Run the following commands on an EBS-optimized instance with attached EBS volumes. If the EBS
volumes were created from snapshots, be sure to initialize them before benchmarking. For more
information, see Initialize Amazon EBS volumes (p. 1779).
When you are finished testing your volumes, see the following topics for help cleaning up: Delete an
Amazon EBS volume (p. 1567) and Terminate your instance (p. 600).
The following command will run a 30 second random I/O test using a 20GB test file located on the C:
drive, with a 25% write and 75% read ratio, and an 8K block size. It will use eight worker threads, each
with four outstanding I/Os, and a write entropy value seed of 1GB. The results of the test will be saved to
a text file called DiskSpeedResults.txt. These parameters simulate a SQL Server OLTP workload.
diskspd -b8K -d30 -o4 -t8 -h -r -w25 -L -Z1G -c20G C:\iotest.dat > DiskSpeedResults.txt
For more information about interpreting the results, see this tutorial: Inspecting disk IO performance
with DiskSPd.
When you get data from CloudWatch, you can include a Period request parameter to specify the
granularity of the returned data. This is different than the period that we use when we collect the data
(1-minute periods). We recommend that you specify a period in your request that is equal to or greater
than the collection period to ensure that the returned data is valid.
You can get the data using either the CloudWatch API or the Amazon EC2 console. The console takes the
raw data from the CloudWatch API and displays a series of graphs based on the data. Depending on your
needs, you might prefer to use either the data from the API or the graphs in the console.
Topics
• Amazon EBS metrics (p. 1788)
• Dimensions for Amazon EBS metrics (p. 1793)
• Graphs in the Amazon EC2 console (p. 1793)
Metrics
• Volume metrics for volumes attached to all instance types (p. 1789)
• Volume metrics for volumes attached to Nitro-based instance types (p. 1792)
1788
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
• Some metrics have differences on instances that are built on the Nitro System. For a list of
these instance types, see Instances built on the Nitro System (p. 210).
• The AWS/EC2 namespace includes additional Amazon EBS metrics for volumes that are
attached to Nitro-based instances that are not bare metal instances. For more information
about these metrics see, Amazon EBS metrics for Nitro-based instances (p. 1144).
Metric Description
Units: Bytes
Units: Bytes
1789
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
Metric Description
To calculate the average read operations per second (read IOPS)
for the period, divide the total read operations in the period by
the number of seconds in that period.
Units: Count
Units: Count
VolumeTotalReadTime Note
This metric is not supported with Multi-Attach enabled
volumes.
Units: Seconds
1790
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
Metric Description
VolumeTotalWriteTime Note
This metric is not supported with Multi-Attach enabled
volumes.
Units: Seconds
VolumeIdleTime Note
This metric is not supported with Multi-Attach enabled
volumes.
Units: Seconds
Units: Count
1791
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
Metric Description
VolumeThroughputPercentage Note
This metric is not supported with Multi-Attach enabled
volumes.
Units: Percent
VolumeConsumedReadWriteOps Used with Provisioned IOPS SSD volumes only. The total amount
of read and write operations (normalized to 256K capacity units)
consumed in a specified period of time.
Units: Count
Units: Percent
1792
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS CloudWatch metrics
Metric Description
For the volume metrics (p. 1789), the supported dimension is the volume ID (VolumeId). All available
statistics are filtered by volume ID.
For the fast snapshot restore metrics (p. 1793), the supported dimensions are the snapshot ID
(SnapshotId) and the Availability Zone (AvailabilityZone).
1793
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
(Sum(VolumeWriteBytes) / Sum(VolumeWriteOps)) /
1024
(Sum(VolumeTotalReadTime) / Sum(VolumeReadOps))
× 1000
(Sum(VolumeTotalWriteTime) /
Sum(VolumeWriteOps)) * 1000
For the average latency graphs and average size graphs, the average is calculated over the total number
of operations (read or write, whichever is applicable to the graph) that completed during the period.
Events in EventBridge are represented as JSON objects. The fields that are unique to the event are
contained in the "detail" section of the JSON object. The "event" field contains the event name. The
"result" field contains the completed status of the action that triggered the event. For more information,
see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.
For more information, see What Is Amazon EventBridge? in the Amazon EventBridge User Guide.
Events
1794
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
Events
• Create volume (createVolume) (p. 1795)
• Delete volume (deleteVolume) (p. 1796)
• Volume attach or reattach (attachVolume, reattachVolume) (p. 1797)
Event data
The listing below is an example of a JSON object emitted by EBS for a successful createVolume event.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:012345678901:volume/vol-01234567"
],
"detail": {
"result": "available",
"cause": "",
"event": "createVolume",
"request-id": "01234567-0123-0123-0123-0123456789ab"
}
}
The listing below is an example of a JSON object emitted by EBS after a failed createVolume event.
The cause for the failure was a disabled KMS key.
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
1795
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
"region": "sa-east-1",
"resources": [
"arn:aws:ec2:sa-east-1:0123456789ab:volume/vol-01234567",
],
"detail": {
"event": "createVolume",
"result": "failed",
"cause": "arn:aws:kms:sa-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab
is disabled.",
"request-id": "01234567-0123-0123-0123-0123456789ab",
}
}
The following is an example of a JSON object that is emitted by EBS after a failed createVolume event.
The cause for the failure was a KMS key pending import.
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "sa-east-1",
"resources": [
"arn:aws:ec2:sa-east-1:0123456789ab:volume/vol-01234567",
],
"detail": {
"event": "createVolume",
"result": "failed",
"cause": "arn:aws:kms:sa-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab
is pending import.",
"request-id": "01234567-0123-0123-0123-0123456789ab",
}
}
Event data
The listing below is an example of a JSON object emitted by EBS for a successful deleteVolume event.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:012345678901:volume/vol-01234567"
],
"detail": {
"result": "deleted",
"cause": "",
"event": "deleteVolume",
"request-id": "01234567-0123-0123-0123-0123456789ab"
1796
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
}
}
Event data
The listing below is an example of a JSON object emitted by EBS after a failed attachVolume event.
The cause for the failure was a KMS key pending deletion.
Note
AWS may attempt to reattach to a volume following routine server maintenance.
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:0123456789ab:volume/vol-01234567",
"arn:aws:kms:us-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab"
],
"detail": {
"event": "attachVolume",
"result": "failed",
"cause": "arn:aws:kms:us-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab
is pending deletion.",
"request-id": ""
}
}
The listing below is an example of a JSON object emitted by EBS after a failed reattachVolume event.
The cause for the failure was a KMS key pending deletion.
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:0123456789ab:volume/vol-01234567",
"arn:aws:kms:us-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab"
],
"detail": {
"event": "reattachVolume",
"result": "failed",
"cause": "arn:aws:kms:us-east-1:0123456789ab:key/01234567-0123-0123-0123-0123456789ab
is pending deletion.",
"request-id": ""
}
}
1797
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Volume Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:012345678901:volume/vol-03a55cf56513fa1b6"
],
"detail": {
"result": "optimizing",
"cause": "",
"event": "modifyVolume",
"request-id": "01234567-0123-0123-0123-0123456789ab"
}
}
Events
• Create snapshot (createSnapshot) (p. 1798)
• Create snapshots (createSnapshots) (p. 1799)
• Copy snapshot (copySnapshot) (p. 1800)
• Share snapshot (shareSnapshot) (p. 1801)
Event data
The listing below is an example of a JSON object emitted by EBS for a successful createSnapshot
event. In the detail section, the source field contains the ARN of the source volume. The startTime
and endTime fields indicate when creation of the snapshot started and completed.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-west-2:snapshot/snap-01234567"
],
"detail": {
1798
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
"event": "createSnapshot",
"result": "succeeded",
"cause": "",
"request-id": "",
"snapshot_id": "arn:aws:ec2::us-west-2:snapshot/snap-01234567",
"source": "arn:aws:ec2::us-west-2:volume/vol-01234567",
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ" }
}
Event data
The listing below is an example of a JSON object emitted by EBS for a successful createSnapshots
event. In the detail section, the source field contains the ARNs of the source volumes of the multi-
volume snapshot set. The startTime and endTime fields indicate when creation of the snapshot
started and completed.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Multi-Volume Snapshots Completion Status",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-east-1:snapshot/snap-01234567",
"arn:aws:ec2::us-east-1:snapshot/snap-012345678"
],
"detail": {
"event": "createSnapshots",
"result": "succeeded",
"cause": "",
"request-id": "",
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ",
"snapshots": [
{
"snapshot_id": "arn:aws:ec2::us-east-1:snapshot/snap-01234567",
"source": "arn:aws:ec2::us-east-1:volume/vol-01234567",
"status": "completed"
},
{
"snapshot_id": "arn:aws:ec2::us-east-1:snapshot/snap-012345678",
"source": "arn:aws:ec2::us-east-1:volume/vol-012345678",
"status": "completed"
}
]
}
}
The listing below is an example of a JSON object emitted by EBS after a failed createSnapshots
event. The cause for the failure was one or more snapshots for the multi-volume snapshot set failed to
complete. The values of snapshot_id are the ARNs of the failed snapshots. startTime and endTime
represent when the create-snapshots action started and ended.
1799
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Multi-Volume Snapshots Completion Status",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-east-1:snapshot/snap-01234567",
"arn:aws:ec2::us-east-1:snapshot/snap-012345678"
],
"detail": {
"event": "createSnapshots",
"result": "failed",
"cause": "Snapshot snap-01234567 is in status error",
"request-id": "",
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ",
"snapshots": [
{
"snapshot_id": "arn:aws:ec2::us-east-1:snapshot/snap-01234567",
"source": "arn:aws:ec2::us-east-1:volume/vol-01234567",
"status": "error"
},
{
"snapshot_id": "arn:aws:ec2::us-east-1:snapshot/snap-012345678",
"source": "arn:aws:ec2::us-east-1:volume/vol-012345678",
"status": "error"
}
]
}
}
Event data
The listing below is an example of a JSON object emitted by EBS after a successful copySnapshot
event. The value of snapshot_id is the ARN of the newly created snapshot. In the detail section, the
value of source is the ARN of the source snapshot. startTime and endTime represent when the copy-
snapshot action started and ended.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-west-2:snapshot/snap-01234567"
],
"detail": {
"event": "copySnapshot",
"result": "succeeded",
"cause": "",
"request-id": "",
"snapshot_id": "arn:aws:ec2::us-west-2:snapshot/snap-01234567",
1800
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
"source": "arn:aws:ec2::eu-west-1:snapshot/snap-76543210",
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ",
"Incremental": "true"
}
}
The listing below is an example of a JSON object emitted by EBS after a failed copySnapshot event.
The cause for the failure was an invalid source snapshot ID. The value of snapshot_id is the ARN of
the failed snapshot. In the detail section, the value of source is the ARN of the source snapshot.
startTime and endTime represent when the copy-snapshot action started and ended.
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-west-2:snapshot/snap-01234567"
],
"detail": {
"event": "copySnapshot",
"result": "failed",
"cause": "Source snapshot ID is not valid",
"request-id": "",
"snapshot_id": "arn:aws:ec2::us-west-2:snapshot/snap-01234567",
"source": "arn:aws:ec2::eu-west-1:snapshot/snap-76543210",
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ"
}
}
Event data
The following is an example of a JSON object emitted by EBS after a completed shareSnapshot event.
In the detail section, the value of source is the AWS account number of the user that shared the
snapshot with you. startTime and endTime represent when the share-snapshot action started and
ended. The shareSnapshot event is emitted only when a private snapshot is shared with another user.
Sharing a public snapshot does not trigger the event.
{
"version": "0",
"id": "01234567-01234-0123-0123-012345678901",
"detail-type": "EBS Snapshot Notification",
"source": "aws.ec2",
"account": "012345678901",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2::us-west-2:snapshot/snap-01234567"
],
"detail": {
"event": "shareSnapshot",
"result": "succeeded",
1801
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
"cause": "",
"request-id": "",
"snapshot_id": "arn:aws:ec2::us-west-2:snapshot/snap-01234567",
"source": 012345678901,
"startTime": "yyyy-mm-ddThh:mm:ssZ",
"endTime": "yyyy-mm-ddThh:mm:ssZ"
}
}
{
"version": "0",
"id": "01234567-0123-0123-0123-012345678901",
"detail-type": "EBS Fast Snapshot Restore State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1::snapshot/snap-03a55cf56513fa1b6"
],
"detail": {
"snapshot-id": "snap-1234567890abcdef0",
"state": "optimizing",
"zone": "us-east-1a",
"message": "Client.UserInitiated - Lifecycle state transition",
}
}
The possible values for state are enabling, optimizing, enabled, disabling, and disabled.
A request to enable fast snapshot restore failed and the state transitioned to disabling or
disabled. Fast snapshot restore cannot be enabled for this snapshot.
Client.UserInitiated
A request to enable fast snapshot restore failed due to insufficient capacity, and the state
transitioned to disabling or disabled. Wait and then try again.
1802
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
A request to enable fast snapshot restore failed due to an internal error, and the state transitioned
to disabling or disabled. Wait and then try again.
Client.InvalidSnapshot.InvalidState - The requested snapshot was deleted or
access permissions were revoked
The fast snapshot restore state for the snapshot has transitioned to disabling or disabled
because the snapshot was deleted or unshared by the snapshot owner. Fast snapshot restore cannot
be enabled for a snapshot that has been deleted or is no longer shared with you.
The following procedure uses the createSnapshot event to automatically copy a completed snapshot
to another Region for disaster recovery.
1. Create an IAM policy, such as the one shown in the following example, to provide permissions to use
the CopySnapshot action and write to the EventBridge log. Assign the policy to the user that will
handle the EventBridge event.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CopySnapshot"
],
"Resource": "*"
}
]
}
2. Define a function in Lambda that will be available from the EventBridge console. The sample
Lambda function below, written in Node.js, is invoked by EventBridge when a matching
createSnapshot event is emitted by Amazon EBS (signifying that a snapshot was completed).
When invoked, the function copies the snapshot from us-east-2 to us-east-1.
// define variables
var destinationRegion = 'us-east-1';
1803
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS EventBridge events
//main function
exports.handler = (event, context, callback) => {
// Load EC2 class and update the configuration to use destination Region to
initiate the snapshot.
AWS.config.update({region: destinationRegion});
var ec2 = new AWS.EC2();
To ensure that your Lambda function is available from the EventBridge console, create it in the
Region where the EventBridge event will occur. For more information, see the AWS Lambda
Developer Guide.
3. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/.
4. In the navigation pane, choose Rules, and then choose Create rule.
5. For Step 1: Define rule detail, do the following:
1804
Amazon Elastic Compute Cloud
User Guide for Windows Instances
EBS quotas
c. For Event type, select EBS Snapshot Notification, select Specific event(s), and then choose
createSnapshot.
d. Select Specific result(s) and then choose succeeded.
e. Choose Next.
7. For Step 3: Select targets, do the following:
Your rule should now appear on the Rules tab. In the example shown, the event that you configured
should be emitted by EBS the next time you copy a snapshot.
For a list of Amazon EBS service quotas, see Amazon Elastic Block Store service quotas in the AWS
General Reference.
An instance store consists of one or more instance store volumes exposed as block devices. The size of
an instance store as well as the number of devices available varies by instance type and instance size. For
more information, see Instance store volumes (p. 1808).
The virtual devices for instance store volumes are ephemeral[0-23]. Instance types that support
one instance store volume have ephemeral0. Instance types that support two or more instance store
volumes have ephemeral0, ephemeral1, and so on.
1805
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volume and data lifetime
Instance store volumes are included as part of the instance's usage cost.
Contents
• Instance store volume and data lifetime (p. 1806)
• Instance store volumes (p. 1808)
• Add instance store volumes to your EC2 instance (p. 1818)
• SSD instance store volumes (p. 1821)
Instance store volumes are attached only at instance launch. You can't attach instance store volumes
after launch. You can’t detach an instance store volume from one instance and attach it to a different
instance.
An instance store volume exists only during the lifetime of the instance to which it is attached. You can’t
configure an instance store volume to persist beyond the lifetime of its associated instance.
The data on an instance store volume persists even if the instance is rebooted. However, the data
does not persist if the instance is stopped, hibernated, or terminated. When the instance is stopped,
hibernated, or terminated, every block of the instance store volume is cryptographically erased.
Therefore, do not rely on instance store volumes for valuable, long-term data. If you need to retain
the data stored on an instance store volume beyond the lifetime of the instance, you need to manually
copy that data to more persistent storage, such as an Amazon EBS volume, an Amazon S3 bucket, or an
Amazon EFS file system.
1806
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volume and data lifetime
There are some events that can result in your data not persisting throughout the lifetime of the instance.
The following table indicates whether data on instance store volumes is persisted during specific events,
for both virtualized and bare metal instances.
The instance is stopped (p. 580) The data does not persist
The instance is hibernated (p. 586) The data does not persist
The instance is terminated (p. 600) The data does not persist
The instance type is changed (p. 331) The data does not persist *
A Windows AMI is created from the instance The data does not persist in the created AMI **
An EBS-backed AMI is created from the instance The data does not persist in the created AMI **
An instance store-backed AMI is created from the The data persists in the AMI bundle uploaded to
instance Amazon S3 ***
User-initiated OS events
Unplanned events
Simplified automatic recovery (p. 607) The data does not persist
CloudWatch action based recovery (p. 609) The data does not persist
The underlying disk fails The data on the failed disk does not persist
* If the new instance type supports instance store, the instance gets the number of instance store
volumes supported by the new instance type, but the data does not transfer to the new instance. If the
new instance type does not support instance store, the instance does not get the instance store volumes.
** The data is not included in the EBS-backed AMI, and it is not included on instance store volumes
attached to instances launched from that AMI.
*** The data is included in the AMI bundle that is uploaded to Amazon S3. When you launch an instance
from that AMI, the instance gets the instance store volumes bundled in the AMI with the data they
contained at the time the AMI was created.
1807
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
† Termination protection and stop protection do not protect instances against instance stops or
terminations as a result of shutdowns initiated through the operating system on the instance. Data
stored on instance store volumes does not persist in both instance stop and termination events.
For instance types with NVMe instance store volumes, all of the supported instance store volumes are
automatically attached to the instance at launch. For instance types with non-NVMe instance store
volumes, such as C1, C3, M1, M2, M3, R3, D2, H1, I2, G2, X1, and X1e, you must manually specify the
block device mappings for the instance store volumes that you want to attach at launch. Then, after
the instance has launched, you must format and mount the attached instance store volumes (p. 1820)
before you can use them. You can't attach an instance store volume after you launch the instance.
Some instance types use NVMe or SATA-based solid state drives (SSD), while others use SATA-based
hard disk drives (HDD). SSDs deliver high random I/O performance with very low latency, but you don't
need the data to persist when the instance terminates or you can take advantage of fault-tolerant
architectures. For more information, see SSD instance store volumes (p. 1821).
The data on NVMe instance store volumes and some HDD instance store volumes is encrypted at rest. For
more information, see Data protection in Amazon EC2 (p. 1396).
The following table provides the quantity, size, type, and performance optimizations of instance store
volumes available on each supported instance type.
Topics
• General purpose (p. 1808)
• Compute optimized (p. 1810)
• Memory optimized (p. 1812)
• Storage optimized (p. 1814)
• Accelerated computing (p. 1816)
General purpose
1808
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
m3.medium 1 x 4 GB SSD ✔
m3.large 1 x 32 GB SSD ✔
m3.xlarge 2 x 40 GB SSD ✔
m3.2xlarge 2 x 80 GB SSD ✔
1809
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
Compute optimized
c3.large 2 x 16 GB SSD ✔
c3.xlarge 2 x 40 GB SSD ✔
1810
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
c3.2xlarge 2 x 80 GB SSD ✔
1811
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
Memory optimized
r3.large 1 x 32 GB SSD ✔
r3.xlarge 1 x 80 GB SSD ✔
1812
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
1813
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
Storage optimized
1814
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
1815
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
Accelerated computing
g2.2xlarge 1 x 60 GB SSD ✔
1816
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance store volumes
** For more information, see Instance store volume TRIM support (p. 1822).
The following documentation describes the I/O performance of the instance store volumes.
You can use the describe-instance-types AWS CLI command to display information about an instance
type, such as its instance store volumes. The following example displays the total size of instance storage
for all R5 instances with instance store volumes.
1817
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add instance store volumes
Example output
---------------------------
| DescribeInstanceTypes |
+----------------+--------+
| r5ad.24xlarge | 3600 |
| r5ad.12xlarge | 1800 |
| r5dn.8xlarge | 1200 |
| r5ad.8xlarge | 1200 |
| r5ad.large | 75 |
| r5d.4xlarge | 600 |
. . .
| r5dn.2xlarge | 300 |
| r5d.12xlarge | 1800 |
+----------------+--------+
The following example displays the complete instance storage details for the specified instance type.
The example output shows that this instance type has two 300 GB NVMe SSD volumes, for a total of 600
GB of instance storage.
[
{
"TotalSizeInGB": 600,
"Disks": [
{
"SizeInGB": 300,
"Count": 2,
"Type": "ssd"
}
],
"NvmeSupport": "required"
}
]
For instance types with non-NVMe instance store volumes, such as C1, C3, M1, M2, M3, R3, D2, H1, I2,
G2, X1, and X1e, you must manually specify the block device mappings for the instance store volumes
that you want to attach at launch. Block device mappings can be specified in the instance launch request
or in the AMI used to launch the instance. The block device mapping includes a device name and the
volume that it maps to. For more information, see Block device mappings (p. 1834)
Important
Instance store volumes can be attached to an instance only when you launch it. You can't attach
instance store volumes to an instance after you've launched it.
After you launch an instance, you must ensure that the instance store volumes for your instance are
formatted and mounted before you can use them. The root volume of an instance store-backed instance
is mounted automatically.
1818
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add instance store volumes
A block device mapping always specifies the root volume for the instance. The root volume is mounted
automatically. For Windows instances, the root volume must be an Amazon EBS volume; instance store is
not supported for the root volume.
Contents
• Add instance store volumes to an AMI (p. 1819)
• Add non-NVME instance store volumes to an instance (p. 1820)
• Make instance store volumes available on your instance (p. 1820)
If you launch an instance that supports non-NVMe instance store volumes using an AMI that specifies
instance store volume block device mappings, the instance includes the instance store volumes. If the
number of instance store volume block device mappings in the AMI exceeds the number of instance
store volumes available to the instance, the additional instance store volume block device mappings are
ignored.
If you launch an instance that supports NVMe instance store volumes using an AMI that specifies
instance store volume block device mappings, the instance store volume block device mappings are
ignored. Instances that support NVMe instance store volumes get all of their supported instance store
volumes, regardless of the block device mappings specified in the instance launch request and the AMI.
Considerations
• For M3 instances, specify instance store volumes in the block device mapping of the instance, not the
AMI. Amazon EC2 might ignore instance store volume block device mappings in the AMI.
• When you launch an instance, you can omit non-NVMe instance store volumes specified in the AMI
block device mapping or add instance store volumes.
New console
To add instance store volumes to an Amazon EBS-backed AMI using the console
AWS CLI
1819
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Add instance store volumes
If the AMI includes block device mappings for the instance store volumes, you do not need to specify
block device mappings in the instance launch request, unless you need more instance store volumes than
is included in the AMI.
If the AMI does not include block device mappings for instance store volumes, then you must specify the
block device mappings in the instance launch request.
Considerations
• For M3 instances, you might receive instance store volumes even if you do not specify them in the
block device mapping for the instance.
• For HS1 instances, no matter how many instance store volumes you specify in the block device
mapping of an AMI, the block device mapping for an instance launched from the AMI automatically
includes the maximum number of supported instance store volumes. You must explicitly remove the
instance store volumes that you don't want from the block device mapping for the instance before you
launch it.
To specify block device mappings in the instance launch request, use one of the following methods.
Command line
You can use one of the following options commands with the corresponding option.
1820
Amazon Elastic Compute Cloud
User Guide for Windows Instances
SSD instance store volumes
Many instance store volumes are pre-formatted with the ext3 file system. SSD-based instance store
volumes that support TRIM instruction are not pre-formatted with any file system. However, you can
format volumes with the file system of your choice after you launch your instance. For more information,
see Instance store volume TRIM support (p. 1822). For Windows instances, the EC2Config service
reformats the instance store volumes with the NTFS file system.
You can confirm that the instance store devices are available from within the instance itself using
instance metadata. For more information, see View the instance block device mapping for instance store
volumes (p. 1842).
For Windows instances, you can also view the instance store volumes using Windows Disk Management.
For more information, see List disks using Disk Management (p. 1848).
• To mount the volume with a drive letter, choose Assign the following drive letter and then
choose the drive letter to use.
• To mount the volume as a folder, choose Mount in the following empty NTFS folder and then
choose Browse to create or select the folder to use.
• To mount the volume without a drive letter or path, choose Do not assign a drive letter or drive
path.
8. On the Format Partition screen, specify whether or not to format the volume. If you choose to
format the volume, choose the required file system and unit size, and specify a volume label.
9. Choose Next, Finish.
The latest AWS Windows AMIs for the following operating systems contain the AWS NVMe drivers
used to interact with SSD instance store volumes that are exposed as NVMe block devices for better
performance:
1821
Amazon Elastic Compute Cloud
User Guide for Windows Instances
File storage
After you connect to your instance, you can verify that you see the NVMe volumes in Disk Manager. On
the taskbar, open the context (right-click) menu for the Windows logo and choose Disk Management.
On Windows Server 2008 R2, choose Start, Administrative Tools, Computer Management, Disk
Management.
The AWS Windows AMIs provided by Amazon include the AWS NVMe driver. If you are not using the
latest AWS Windows AMIs, you can install the current AWS NVMe driver (p. 758).
The data on NVMe instance storage is encrypted using an XTS-AES-256 block cipher implemented in a
hardware module on the instance. The encryption keys are generated using the hardware module and
are unique to each NVMe instance storage device. All encryption keys are destroyed when the instance
is stopped or terminated and cannot be recovered. You cannot disable this encryption and you cannot
provide your own encryption key.
Instances running Windows Server 2012 R2 support TRIM as of AWS PV Driver version 7.3.0. Instances
running earlier versions of Windows Server do not support TRIM.
Instance store volumes that support TRIM are fully trimmed before they are allocated to your instance.
These volumes are not formatted with a file system when an instance launches, so you must format
them before they can be mounted and used. For faster access to these volumes, you should skip the
TRIM operation when you format them. On Windows, to temporarily disable TRIM support during initial
formatting, use the fsutil behavior set DisableDeleteNotify 1 command. After formatting is
complete, re-enable TRIM support by using fsutil behavior set DisableDeleteNotify 0.
With instance store volumes that support TRIM, you can use the TRIM command to notify the SSD
controller when you no longer need data that you've written. This provides the controller with more free
space, which can reduce write amplification and increase performance. On Windows, use the fsutil
behavior set DisableDeleteNotify 0 command to ensure TRIM support is enabled during
normal operation.
File storage
Cloud file storage is a method for storing data in the cloud that provides servers and applications access
to data through shared file systems. This compatibility makes cloud file storage ideal for workloads that
rely on shared file systems and provides simple integration without code changes.
There are many file storage solutions that exist, ranging from a single node file server on a compute
instance using block storage as the underpinnings with no scalability or few redundancies to protect
the data, to a do-it-yourself clustered solution, to a fully-managed solution. The following content
introduces some of the storage services provided by AWS for use with Windows.
Contents
1822
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon S3
Amazon EC2 uses Amazon S3 for storing Amazon Machine Images (AMIs). You use AMIs for launching
EC2 instances. In case of instance failure, you can use the stored AMI to immediately launch another
instance, thereby allowing for fast recovery and business continuity.
Amazon EC2 also uses Amazon S3 to store snapshots (backup copies) of the data volumes. You can use
snapshots for recovering data quickly and reliably in case of application or system failures. You can
also use snapshots as a baseline to create multiple new data volumes, expand the size of an existing
data volume, or move data volumes across multiple Availability Zones, thereby making your data usage
highly scalable. For more information about using data volumes and snapshots, see Amazon Elastic Block
Store (p. 1515).
Objects are the fundamental entities stored in Amazon S3. Every object stored in Amazon S3 is
contained in a bucket. Buckets organize the Amazon S3 namespace at the highest level and identify
the account responsible for that storage. Amazon S3 buckets are similar to internet domain names.
Objects stored in the buckets have a unique key value and are retrieved using a URL. For example, if an
object with a key value /photos/mygarden.jpg is stored in the DOC-EXAMPLE-BUCKET1 bucket, then
it is addressable using the URL https://DOC-EXAMPLE-BUCKET1.s3.amazonaws.com/photos/
mygarden.jpg.
For more information about the features of Amazon S3, see the Amazon S3 product page.
Usage examples
Note
We require TLS 1.2 and recommend TLS 1.3. Your client must meet this requirement to
download from Amazon Simple Storage Service (Amazon S3). For more information, see TLS 1.2
to become the minimum TLS protocol level for all AWS API endpoints.
Given the benefits of Amazon S3 for storage, you might decide to use this service to store files and data
sets for use with EC2 instances. There are several ways to move data to and from Amazon S3 to your
instances. In addition to the examples discussed below, there are a variety of tools that people have
written that you can use to access your data in Amazon S3 from your computer or your instance. Some of
the common ones are discussed in the AWS forums.
If you have permission, you can copy a file to or from Amazon S3 and your instance using one of the
following methods.
Windows instances have the benefit of a graphical browser that you can use to access the Amazon S3
console directly; however, for scripting purposes, Windows users can also use the AWS Tools for Windows
PowerShell to move objects to and from Amazon S3.
Use the following command to copy an Amazon S3 object to your Windows instance.
1823
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon EFS
The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. The AWS
CLI enables users to authenticate themselves and download restricted items from Amazon S3 and also
to upload items. For more information, such as how to install and configure the tools, see the AWS
Command Line Interface detail page.
The aws s3 cp command is similar to the Unix cp command. You can copy files from Amazon S3 to your
instance, copy files from your instance to Amazon S3, and copy files from one Amazon S3 location to
another.
Use the following command to copy an object from Amazon S3 to your instance.
Use the following command to copy an object from your instance back into Amazon S3.
The aws s3 sync command can synchronize an entire Amazon S3 bucket to a local directory location. This
can be helpful for downloading a data set and keeping the local copy up-to-date with the remote set. If
you have the proper permissions on the Amazon S3 bucket, you can push your local directory back up to
the cloud when you are finished by reversing the source and destination locations in the command.
Use the following command to download an entire Amazon S3 bucket to a local directory on your
instance.
Amazon S3 API
If you are a developer, you can use an API to access data in Amazon S3. For more information, see the
Amazon Simple Storage Service User Guide. You can use this API and its examples to help develop your
application and integrate it with other APIs and SDKs, such as the boto Python interface.
• Amazon FSx for NetApp ONTAP provides fully managed shared storage in the AWS Cloud with the
popular data access and management capabilities of NetApp ONTAP.
1824
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon FSx
• Amazon FSx for OpenZFS provides fully managed cost-effective shared storage powered by the
popular OpenZFS file system.
Note
• This functionality is available in the new launch instance wizard only. For more information,
see Launch an instance using the new launch instance wizard (p. 539)
• Amazon FSx for Windows File Server and Amazon FSx for Lustre file systems can't be
mounted at launch. You must mount these file systems manually after launch.
You can choose to mount an existing file system that you created previously, or you can create a new file
system to mount to an instance at launch.
Topics
• Security groups and user data script (p. 1825)
• Mount an Amazon FSx file system at launch (p. 1827)
Topics
• Security groups (p. 1825)
• User data script (p. 1827)
Security groups
If you choose to automatically create the security groups that are needed to enable access to the file
system, the launch instance wizard creates and attaches two security groups - one security group is
attached to the instance, and the other is attached to the file system. For more information about the
security group requirements, see FSx for ONTAP file system access control with Amazon VPC and FSx for
OpenZFS file system access control with Amazon VPC.
We add the tag Name=instance-sg-1 to the security group that is created and attached to the
instance. The value in the tag is automatically incremented each time the launch instance wizard creates
a security group for Amazon FSx file systems.
The security group includes the following output rules, but no inbound rules.
Outbound rules
1825
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon FSx
The security group that is created and attached to the file system is tagged with Name=fsx-sg-1. The
value in the tag is automatically incremented each time the launch instance wizard creates a security
group for Amazon FSx file systems.
Inbound rules
Outbound rules
1826
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Amazon FSx
#cloud-config
package_update: true
package_upgrade: true
runcmd:
- yum install -y nfs-utils
- apt-get -y install nfs-common
- svm_id_1=svm_id
- file_system_id_1=file_system_id
- vol_path_1=/vol1
- fsx_mount_point_1=/mnt/fsx/fs1
- mkdir -p "${fsx_mount_point_1}"
- if [ -z "$svm_id_1" ]; then printf "\n${file_system_id_1}.fsx.eu-
north-1.amazonaws.com:/${vol_path_1} ${fsx_mount_point_1} nfs4
nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev
0 0\n" >> /etc/fstab; else printf "\n${svm_id_1}.${file_system_id_1}.fsx.eu-
north-1.amazonaws.com:/${vol_path_1} ${fsx_mount_point_1} nfs4
nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0\n"
>> /etc/fstab; fi
- retryCnt=15; waitTime=30; while true; do mount -a -t nfs4 defaults; if [ $? = 0 ] ||
[ $retryCnt -lt 1 ]; then echo File system mounted successfully; break; fi; echo File
system not available, retrying to mount.; ((retryCnt--)); sleep $waitTime; done;
a. Choose Edit.
b. If you want to mount an existing file system, for Subnet, choose the file system's preferred
subnet. We recommend that you launch the instance into the same Availability Zone as the file
system's preferred subnet to optimize performance.
If you want to create a new file system to mount to an instance, for Subnet, choose the subnet
into which to launch the instance.
Important
You must select a subnet to enable the Amazon FSx functionality in the new launch
instance wizard. If you do not select a subnet, you will not be able to mount an existing
file system or create a new one.
7. In the Storage section, do the following:
1827
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance volume limits
Contents
• Nitro System volume limits (p. 1828)
• Windows-specific volume limits (p. 1829)
• Bandwidth versus capacity (p. 1829)
Most of these instances support a maximum of 28 attachments. For example, if you have no additional
network interface attachments on an EBS-only instance, you can attach up to 27 EBS volumes to it. If
you have one additional network interface on an instance with 2 NVMe instance store volumes, you can
attach 24 EBS volumes to it.
1828
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Windows-specific volume limits
AWS PV 26
Citrix PV 26
Red Hat PV 17
We do not recommend that you give a Windows instance more than 26 volumes with AWS PV or Citrix
PV drivers, as it is likely to cause performance issues.
To determine which PV drivers your instance is using, or to upgrade your Windows instance from Red Hat
to Citrix PV drivers, see Upgrade PV drivers on Windows instances (p. 745).
For more information about how device names related to volumes, see Map disks to volumes on your
Windows instance (p. 1843).
Topics
• Configure the root volume to persist (p. 1829)
• Confirm that a root volume is configured to persist (p. 1831)
• Change the initial size of the root volume (p. 1832)
1829
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Configure the root volume to persist
Topics
• Configure the root volume to persist during instance launch (p. 1830)
• Configure the root volume to persist for an existing instance (p. 1831)
Console
To configure the root volume to persist when you launch an instance using the console
AWS CLI
To configure the root volume to persist when you launch an instance using the AWS CLI
Use the run-instances command and include a block device mapping that sets the
DeleteOnTermination attribute to false.
[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": false
}
}
]
To configure the root volume to persist when you launch an instance using the Tools for
Windows PowerShell
Use the New-EC2Instance command and include a block device mapping that sets the
DeleteOnTermination attribute to false.
1830
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Confirm that a root volume is configured to persist
AWS CLI
To configure the root volume to persist for an existing instance using the AWS CLI
Use the modify-instance-attribute command with a block device mapping that sets the
DeleteOnTermination attribute to false.
[
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": false
}
}
]
To configure the root volume to persist for an existing instance using the AWS Tools for Windows
PowerShell
Use the Edit-EC2InstanceAttribute command with a block device mapping that sets the
DeleteOnTermination attribute to false.
New console
To confirm that a root volume is configured to persist using the Amazon EC2 console
1831
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Change the initial size of the root volume
Old console
To confirm that a root volume is configured to persist using the Amazon EC2 console
AWS CLI
To confirm that a root volume is configured to persist using the AWS CLI
Use the describe-instances command and verify that the DeleteOnTermination attribute in the
BlockDeviceMappings response element is set to false.
...
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"Status": "attached",
"DeleteOnTermination": false,
"VolumeId": "vol-1234567890abcdef0",
"AttachTime": "2013-07-19T02:42:39.000Z"
}
}
...
To confirm that a root volume is configured to persist using the AWS Tools for Windows
PowerShell
Use the Get-EC2Instance and verify that the DeleteOnTermination attribute in the
BlockDeviceMappings response element is set to false.
1. Determine the device name of the root volume specified in the AMI, as described in View the EBS
volumes in an AMI block device mapping (p. 1839).
2. Confirm the size of the snapshot specified in the AMI block device mapping, as described in View
Amazon EBS snapshot information (p. 1620).
3. Override the size of the root volume using the instance block device mapping, as described in Update
the block device mapping when launching an instance (p. 1840), specifying a volume size that is
larger than the snapshot size.
1832
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Device names
For example, the following entry for the instance block device mapping increases the size of the root
volume, /dev/xvda, to 100 GiB. You can omit the snapshot ID in the instance block device mapping
because the snapshot ID is already specified in the AMI block device mapping.
{
"DeviceName": "/dev/xvda",
"Ebs": {
"VolumeSize": 100
}
}
The number of volumes that your instance can support is determined by the operating system. For more
information, see Instance volume limits (p. 1828).
Contents
• Available device names (p. 1833)
• Device name considerations (p. 1834)
For information about device names on Linux instances, see Device naming on Linux instances in the
Amazon EC2 User Guide for Linux Instances.
The following table lists the available device names that you can specify in a block device mapping or
when attaching an EBS volume.
xvd[b-c][a-z] xvd[a-e]
/dev/sda1 **
/dev/sd[b-e]
xvd[b-c][a-z] xvd[a-e]
/dev/sda1
/dev/sd[b-e]
1833
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Device name considerations
* For Citrix PV and Red Hat PV, if you map an EBS volume with the name xvda, Windows does not
recognize the volume (the volume is visible for AWS PV or AWS NVMe).
** NVMe instance store volumes are automatically enumerated and assigned a Windows drive letter.
For more information about instance store volumes, see Amazon EC2 instance store (p. 1805). For more
information about NVMe EBS volumes (Nitro-based instances), including how to identify the EBS device,
see Amazon EBS and NVMe on Windows instances (p. 1750).
• Although you can attach your EBS volumes using the device names used to attach instance store
volumes, we strongly recommend that you don't because the behavior can be unpredictable.
• The number of NVMe instance store volumes for an instance depends on the size of the instance.
NVMe instance store volumes are automatically enumerated and assigned a Windows drive letter.
• AWS Windows AMIs come with additional software that prepares an instance when it first boots up.
This is either the EC2Config service (Windows AMIs prior to Windows Server 2016) or EC2Launch
(Windows Server 2016 and later). After the devices have been mapped to drives, they are initialized
and mounted. The root drive is initialized and mounted as C:\. By default, when an EBS volume is
attached to a Windows instance, it can show up as any drive letter on the instance. You can change the
settings to set the drive letters of the volumes per your specifications. For instance store volumes, the
default depends on the driver. AWS PV drivers and Citrix PV drivers assign instance store volumes drive
letters going from Z: to A:. Red Hat drivers assign instance store volumes drive letters going from D:
to Z:. For more information, see Configure a Windows instance using the EC2Config service (p. 712),
Configure a Windows instance using EC2Launch (p. 702), and Map disks to volumes on your Windows
instance (p. 1843).
For more information about root device volumes, see Amazon EC2 instance root device
volume (p. 1829).
Contents
• Block device mapping concepts (p. 1834)
• AMI block device mapping (p. 1837)
• Instance block device mapping (p. 1840)
1834
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Block device mapping concepts
• Instance store volumes (virtual devices whose underlying hardware is physically attached to the host
computer for the instance)
• EBS volumes (remote storage devices)
A block device mapping defines the block devices (instance store volumes and EBS volumes) to attach
to an instance. You can specify a block device mapping as part of creating an AMI so that the mapping
is used by all instances launched from the AMI. Alternatively, you can specify a block device mapping
when you launch an instance, so this mapping overrides the one specified in the AMI from which you
launched the instance. Note that all NVMe instance store volumes supported by an instance type are
automatically enumerated and assigned a device name on instance launch; including them in your block
device mapping has no effect.
Contents
• Block device mapping entries (p. 1835)
• Block device mapping instance store caveats (p. 1836)
• Example block device mapping (p. 1836)
• How devices are made available in the operating system (p. 1837)
• The device name used within Amazon EC2. The block device driver for the instance assigns the actual
volume name when mounting the volume. The name assigned can be different from the name that
Amazon EC2 recommends. For more information, see Device names on Windows instances (p. 1833).
For Instance store volumes, you also specify the following information:
• The virtual device: ephemeral[0-23]. Note that the number and size of available instance store
volumes for your instance varies by instance type.
For NVMe instance store volumes, the following information also applies:
• These volumes are automatically enumerated and assigned a device name; including them in your
block device mapping has no effect.
• The ID of the snapshot to use to create the block device (snap-xxxxxxxx). This value is optional as long
as you specify a volume size.
• The size of the volume, in GiB. The specified size must be greater than or equal to the size of the
specified snapshot.
• Whether to delete the volume on instance termination (true or false). The default value is true
for the root device volume and false for attached volumes. When you create an AMI, its block device
mapping inherits this setting from the instance. When you launch an instance, it inherits this setting
from the AMI.
• The volume type, which can be gp2 and gp3 for General Purpose SSD, io1 and io2 for Provisioned
IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic. The
default value is gp2.
• The number of input/output operations per second (IOPS) that the volume supports. (Used only with
io1 and io2 volumes.)
1835
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Block device mapping concepts
• Some instance types include more instance store volumes than others, and some instance types
contain no instance store volumes at all. If your instance type supports one instance store volume, and
your AMI has mappings for two instance store volumes, then the instance launches with one instance
store volume.
• Instance store volumes can only be mapped at launch time. You cannot stop an instance without
instance store volumes (such as the t2.micro), change the instance to a type that supports instance
store volumes, and then restart the instance with instance store volumes. However, you can create an
AMI from the instance and launch it on an instance type that supports instance store volumes, and
map those instance store volumes to the instance.
• If you launch an instance with instance store volumes mapped, and then stop the instance and change
it to an instance type with fewer instance store volumes and restart it, the instance store volume
mappings from the initial launch still show up in the instance metadata. However, only the maximum
number of supported instance store volumes for that instance type are available to the instance.
Note
When an instance is stopped, all data on the instance store volumes is lost.
• Depending on instance store capacity at launch time, M3 instances may ignore AMI instance store
block device mappings at launch unless they are specified at launch. You should specify instance
store block device mappings at launch time, even if the AMI you are launching has the instance store
volumes mapped in the AMI, to ensure that the instance store volumes are available when the instance
launches.
1836
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI block device mapping
Note that this example block device mapping is used in the example commands and APIs in this
topic. You can find example commands and APIs that create block device mappings in Specify a
block device mapping for an AMI (p. 1838) and Update the block device mapping when launching an
instance (p. 1840).
With a Windows instance, the device names specified in the block device mapping are mapped to their
corresponding block devices when the instance first boots, and then the Ec2Config service initializes and
mounts the drives. The root device volume is mounted as C:\. The instance store volumes are mounted
as Z:\, Y:\, and so on. When an EBS volume is mounted, it can be mounted using any available drive
letter. However, you can configure how the Ec2Config Service assigns drive letters to EBS volumes; for
more information, see Configure a Windows instance using the EC2Config service (p. 712).
Contents
1837
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI block device mapping
For an EBS-backed AMI, you can add EBS volumes and instance store volumes using a block device
mapping. For an instance store-backed AMI, you can add instance store volumes only by modifying the
block device mapping entries in the image manifest file when registering the image.
Note
For M3 instances, you must specify instance store volumes in the block device mapping for the
instance when you launch it. When you launch an M3 instance, instance store volumes specified
in the block device mapping for the AMI may be ignored if they are not specified as part of the
instance block device mapping.
Use the create-image AWS CLI command to specify a block device mapping for an EBS-backed AMI. Use
the register-image AWS CLI command to specify a block device mapping for an instance store-backed
AMI.
Specify the block device mapping using the --block-device-mappings parameter. Arguments
encoded in JSON can be supplied either directly on the command line or by reference to a file:
{
"DeviceName": "xvdb",
"VirtualName": "ephemeral0"
}
To add an empty 100 GiB gp2 volume, use the following mapping.
1838
Amazon Elastic Compute Cloud
User Guide for Windows Instances
AMI block device mapping
{
"DeviceName": "xvdg",
"Ebs": {
"VolumeSize": 100
}
}
{
"DeviceName": "xvdh",
"Ebs": {
"SnapshotId": "snap-xxxxxxxx"
}
}
{
"DeviceName": "xvdj",
"NoDevice": ""
}
Alternatively, you can use the -BlockDeviceMapping parameter with the following commands (AWS
Tools for Windows PowerShell):
• New-EC2Image
• Register-EC2Image
If the AMI was created with additional EBS volumes using a block device mapping, the Block Devices
field displays the mapping for those additional volumes as well. (This screen doesn't display instance
store volumes.)
To view the EBS volumes for an AMI using the command line
Use the describe-images (AWS CLI) command or Get-EC2Image (AWS Tools for Windows PowerShell)
command to enumerate the EBS volumes in the block device mapping for an AMI.
1839
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance block device mapping
Limitations
• For the root volume, you can only modify the following: volume size, volume type, and the Delete on
Termination flag.
• When you modify an EBS volume, you can't decrease its size. Therefore, you must specify a snapshot
whose size is equal to or greater than the size of the snapshot specified in the block device mapping of
the AMI.
Contents
• Update the block device mapping when launching an instance (p. 1840)
• Update the block device mapping of a running instance (p. 1841)
• View the EBS volumes in an instance block device mapping (p. 1842)
• View the instance block device mapping for instance store volumes (p. 1842)
• To change the size of the root volume, locate the Root volume under the Type column, and
change its Size field.
• To suppress an EBS volume specified by the block device mapping of the AMI used to launch the
instance, locate the volume and click its Delete icon.
• To add an EBS volume, choose Add New Volume, choose EBS from the Type list, and fill in the
fields (Device, Snapshot, and so on).
• To suppress an instance store volume specified by the block device mapping of the AMI used to
launch the instance, locate the volume, and choose its Delete icon.
• To add an instance store volume, choose Add New Volume, select Instance Store from the Type
list, and select a device name from Device.
6. Complete the remaining wizard pages, and choose Launch.
Use the run-instances AWS CLI command with the --block-device-mappings option to specify a
block device mapping for an instance at launch.
1840
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance block device mapping
For example, suppose that an EBS-backed AMI specifies the following block device mapping:
• xvdb=ephemeral0
• xvdh=snap-1234567890abcdef0
• xvdj=:100
To prevent xvdj from attaching to an instance launched from this AMI, use the following mapping.
{
"DeviceName": "xvdj",
"NoDevice": ""
}
To increase the size of xvdh to 300 GiB, specify the following mapping. Notice that you don't need to
specify the snapshot ID for xvdh, because specifying the device name is enough to identify the volume.
{
"DeviceName": "xvdh",
"Ebs": {
"VolumeSize": 300
}
}
To increase the size of the root volume at instance launch, first call describe-images with the ID of the
AMI to verify the device name of the root volume. For example, "RootDeviceName": "/dev/xvda".
To override the size of the root volume, specify the device name of the root device used by the AMI and
the new volume size.
{
"DeviceName": "/dev/xvda",
"Ebs": {
"VolumeSize": 100
}
}
To attach an additional instance store volume, xvdc, specify the following mapping. If the instance type
doesn't support multiple instance store volumes, this mapping has no effect. If the instance supports
NVMe instance store volumes, they are automatically enumerated and assigned an NVMe device name.
{
"DeviceName": "xvdc",
"VirtualName": "ephemeral1"
}
To add volumes to an instance using the AWS Tools for Windows PowerShell
Use the -BlockDeviceMapping parameter with the New-EC2Instance command (AWS Tools for
Windows PowerShell).
1841
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Instance block device mapping
For example, to preserve the root volume at instance termination, specify the following in
mapping.json.
[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": false
}
}
]
Alternatively, you can use the -BlockDeviceMapping parameter with the Edit-EC2InstanceAttribute
command (AWS Tools for Windows PowerShell).
If the instance was launched with additional EBS volumes using a block device mapping, they appear
under Block devices. Any instance store volumes do not appear on this tab.
5. To display additional information about an EBS volume, choose its volume ID to go to the volume
page. For more information, see View information about an Amazon EBS volume (p. 1550).
To view the EBS volumes for an instance using the command line
Use the describe-instances (AWS CLI) command or Get-EC2Instance (AWS Tools for Windows PowerShell)
command to enumerate the EBS volumes in the block device mapping for an instance.
1842
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Map disks to volumes
You can use Disk Management or PowerShell to list both EBS and instance store NVMe volumes. For
more information, see the section called “List NVMe volumes” (p. 1844).
You can use instance metadata to query the HDD or SSD instance store volumes in the block device
mapping. NVMe instance store volumes are not included.
The base URI for all requests for instance metadata is http://169.254.169.254/latest/. For more
information, see Instance metadata and user data (p. 817).
First, connect to your running instance. From the instance, use this query to get its block device mapping.
The response includes the names of the block devices for the instance. For example, the output for an
instance store–backed m1.small instance looks like this.
ami
ephemeral0
root
swap
The ami device is the root device as seen by the instance. The instance store volumes are named
ephemeral[0-23]. The swap device is for the page file. If you've also mapped EBS volumes, they
appear as ebs1, ebs2, and so on.
To get details about an individual block device in the block device mapping, append its name to the
previous query, as shown here.
The instance type determines the number of instance store volumes that are available to the instance. If
the number of instance store volumes in a block device mapping exceeds the number of instance store
volumes available to an instance, the additional volumes are ignored. To view the instance store volumes
for your instance, open Windows Disk Management. To learn how many instance store volumes are
supported by each instance type, see Instance store volumes (p. 1808).
Depending on the instance type of your instance, you'll have from 0 to 24 possible instance store
volumes available to the instance. To use any of the instance store volumes that are available to
your instance, you must specify them when you create your AMI or launch your instance. You can
also add EBS volumes when you create your AMI or launch your instance, or attach them while your
instance is running. For more information, see Make an Amazon EBS volume available for use on
Windows (p. 1543).
1843
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List NVMe volumes
When you add a volume to your instance, you specify the device name that Amazon EC2 uses. For
more information, see Device names on Windows instances (p. 1833). AWS Windows Amazon Machine
Images (AMIs) contain a set of drivers that are used by Amazon EC2 to map instance store and EBS
volumes to Windows disks and drive letters. If you launch an instance from a Windows AMI that uses
AWS PV or Citrix PV drivers, you can use the relationships described on this page to map your Windows
disks to your instance store and EBS volumes. If your Windows AMI uses Red Hat PV drivers, you can
update your instance to use the Citrix drivers. For more information, see Upgrade PV drivers on Windows
instances (p. 745).
Contents
• List NVMe volumes (p. 1844)
• List NVMe disks using Disk Management (p. 1844)
• List NVMe disks using PowerShell (p. 1845)
• Map NVMe EBS volumes (p. 1847)
• List volumes (p. 1848)
• List disks using Disk Management (p. 1848)
• Map disk devices to device names (p. 1849)
• Instance store volumes (p. 1849)
• EBS volumes (p. 1850)
• List disks using PowerShell (p. 1851)
1. Log in to your Windows instance using Remote Desktop. For more information, see Connect to your
Windows instance (p. 610).
2. Start the Disk Management utility.
3. Review the disks. The root volume is an EBS volume mounted as C:\. If there are no other disks
shown, then you didn't specify additional volumes when you created the AMI or launched the
instance.
The following is an example that shows the disks that are available if you launch an r5d.4xlarge
instance with two additional EBS volumes.
1844
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List NVMe volumes
Connect to your Windows instance and run the following command to enable PowerShell script
execution.
Set-ExecutionPolicy RemoteSigned
Copy the following script and save it as mapping.ps1 on your Windows instance.
function Get-EC2InstanceMetadata {
param([string]$Path)
(Invoke-WebRequest -Uri "http://169.254.169.254/latest/$Path").Content
}
function GetEBSVolumeId {
param($Path)
$SerialNumber = (Get-Disk -Path $Path).SerialNumber
if($SerialNumber -clike 'vol*'){
1845
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List NVMe volumes
$EbsVolumeId = $SerialNumber.Substring(0,20).Replace("vol","vol-")
}
else {
$EbsVolumeId = $SerialNumber.Substring(0,20).Replace("AWS","AWS-")
}
return $EbsVolumeId
}
function GetDeviceName{
param($EbsVolumeId)
if($EbsVolumeId -clike 'vol*'){
function GetDriveLetter{
param($Path)
$DiskNumber = (Get-Disk -Path $Path).Number
if($DiskNumber -eq 0){
$VirtualDevice = "root"
$DriveLetter = "C"
$PartitionNumber = (Get-Partition -DriveLetter C).PartitionNumber
}
else
{
$VirtualDevice = "N/A"
$DriveLetter = (Get-Partition -DiskNumber $DiskNumber).DriveLetter
if(!$DriveLetter)
{
$DriveLetter = ((Get-Partition -DiskId $Path).AccessPaths).Split(",")[0]
}
$PartitionNumber = (Get-Partition -DiskId $Path).PartitionNumber
}
return $DriveLetter,$VirtualDevice,$PartitionNumber
$Report = @()
foreach($Path in (Get-Disk).Path)
{
$Disk_ID = ( Get-Partition -DiskId $Path).DiskId
$Disk = ( Get-Disk -Path $Path).Number
$EbsVolumeId = GetEBSVolumeId($Path)
$Size =(Get-Disk -Path $Path).Size
$DriveLetter,$VirtualDevice, $Partition = (GetDriveLetter($Path))
$Device,$VolumeName = GetDeviceName($EbsVolumeId)
$Disk = New-Object PSObject -Property @{
Disk = $Disk
Partitions = $Partition
DriveLetter = $DriveLetter
EbsVolumeId = $EbsVolumeId
Device = $Device
VirtualDevice = $VirtualDevice
VolumeName= $VolumeName
}
$Report += $Disk
}
1846
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List NVMe volumes
PS C:\> .\mapping.ps1
The following is example output for an instance with a root volume, two EBS volumes, and two instance
store volumes.
If you did not provide your credentials on the Windows instance, the script cannot get the EBS volume ID
and uses N/A in the EbsVolumeId column.
PS C:\> Get-Disk
Number Friendly Name Serial Number HealthStatus
OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------
----------------- ---------- ----------
3 NVMe Amazo... AWS6AAD8C2AEEE1193F0_00000001. Healthy Online
279.4 GB MBR
4 NVMe Amazo... AWS13E7299C2BD031A28_00000001. Healthy Online
279.4 GB MBR
2 NVMe Amazo... vol0a4064b39e5f534a2_00000001. Healthy Online
8 GB MBR
0 NVMe Amazo... vol03683f1d861744bc7_00000001. Healthy Online
30 GB MBR
1 NVMe Amazo... vol082b07051043174b9_00000001. Healthy Online
8 GB MBR
You can also run the ebsnvme-id command to map NVMe disk numbers to EBS volume IDs and device
names.
PS C:\> C:\PROGRAMDATA\Amazon\Tools\ebsnvme-id.exe
Disk Number: 0
Volume ID: vol-03683f1d861744bc7
Device Name: sda1
Disk Number: 1
Volume ID: vol-082b07051043174b9
Device Name: xvdb
Disk Number: 2
Volume ID: vol-0a4064b39e5f534a2
Device Name: xvdc
1847
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
List volumes
You can find the disks on your Windows instance using Disk Management or Powershell.
1. Log in to your Windows instance using Remote Desktop. For more information, see Connect to your
Windows instance (p. 610).
2. Start the Disk Management utility.
On Windows Server 2012 and later, on the taskbar, right-click the Windows logo, and then choose
Disk Management. On Windows Server 2008, choose Start, Administrative Tools, Computer
Management, Disk Management.
3. Review the disks. The root volume is an EBS volume mounted as C:\. If there are no other disks
shown, then you didn't specify additional volumes when you created the AMI or launched the
instance.
The following is an example that shows the disks that are available if you launch an m3.medium
instance with an instance store volume (Disk 2) and an additional EBS volume (Disk 1).
4. Right-click the gray pane labeled Disk 1, and then select Properties. Note the value of Location and
look it up in the tables in Map disk devices to device names (p. 1849). For example, the following
1848
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
disk has the location Bus Number 0, Target Id 9, LUN 0. According to the table for EBS volumes, the
device name for this location is xvdj.
Mappings
• Instance store volumes (p. 1849)
• EBS volumes (p. 1850)
1849
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
EBS volumes
The following table describes how the Citrix PV and AWS PV drivers map non-NVME EBS volumes to
Windows volumes.
1850
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
Connect to your Windows instance and run the following command to enable PowerShell script
execution.
Set-ExecutionPolicy RemoteSigned
Copy the following script and save it as mapping.ps1 on your Windows instance.
[string[]]$array1 = @()
[string[]]$array2 = @()
[string[]]$array3 = @()
[string[]]$array4 = @()
$i = 0
While ($i -ne ($array2.Count)) {
$array3 += ((Get-Volume -Path $array2[$i] | Get-Partition | Get-Disk).SerialNumber) -
replace "_[^ ]*$" -replace "vol", "vol-"
$array4 += ((Get-Volume -Path $array2[$i] | Get-Partition | Get-Disk).FriendlyName)
$i ++
}
1851
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
Try {
$InstanceId = Get-EC2InstanceMetadata -Category "InstanceId"
$Region = Get-EC2InstanceMetadata -Category "Region" | Select-Object -ExpandProperty
SystemName
}
Catch {
Write-Host "Could not access the instance Metadata using AWS Get-EC2InstanceMetadata
CMDLet.
Verify you have AWSPowershell SDK version '3.1.73.0' or greater installed and Metadata is
enabled for this instance." -ForegroundColor Yellow
}
Try {
$BlockDeviceMappings = (Get-EC2Instance -Region $Region -Instance
$InstanceId).Instances.BlockDeviceMappings
$VirtualDeviceMap = (Get-EC2InstanceMetadata -Category
"BlockDeviceMapping").GetEnumerator() | Where-Object { $_.Key -ne "ami" }
}
Catch {
Write-Host "Could not access the AWS API, therefore, VolumeId is not available.
Verify that you provided your access keys or assigned an IAM role with adequate
permissions." -ForegroundColor Yellow
}
Get-disk | ForEach-Object {
$DriveLetter = $null
$VolumeName = $null
$VirtualDevice = $null
$DeviceName = $_.FriendlyName
$DiskDrive = $_
$Disk = $_.Number
$Partitions = $_.NumberOfPartitions
$EbsVolumeID = $_.SerialNumber -replace "_[^ ]*$" -replace "vol", "vol-"
if ($Partitions -ge 1) {
$PartitionsData = Get-Partition -DiskId $_.Path
$DriveLetter = $PartitionsData.DriveLetter | Where-object { $_ -notin @("", $null) }
$VolumeName = (Get-PSDrive | Where-Object { $_.Name -in @($DriveLetter) }).Description
| Where-object { $_ -notin @("", $null) }
}
If ($DiskDrive.path -like "*PROD_PVDISK*") {
$BlockDeviceName = Convert-SCSITargetIdToDeviceName((Get-WmiObject -Class
Win32_Diskdrive | Where-Object { $_.DeviceID -eq ("\\.\PHYSICALDRIVE" +
$DiskDrive.Number) }).SCSITargetId)
$BlockDeviceName = "/dev/" + $BlockDeviceName
$BlockDevice = $BlockDeviceMappings | Where-Object { $BlockDeviceName -like "*" +
$_.DeviceName + "*" }
$EbsVolumeID = $BlockDevice.Ebs.VolumeId
$VirtualDevice = ($VirtualDeviceMap.GetEnumerator() | Where-Object { $_.Value -eq
$BlockDeviceName }).Key | Select-Object -First 1
}
ElseIf ($DiskDrive.path -like "*PROD_AMAZON_EC2_NVME*") {
$BlockDeviceName = (Get-EC2InstanceMetadata -Category
"BlockDeviceMapping").ephemeral((Get-WmiObject -Class Win32_Diskdrive | Where-Object
{ $_.DeviceID -eq ("\\.\PHYSICALDRIVE" + $DiskDrive.Number) }).SCSIPort - 2)
$BlockDevice = $null
$VirtualDevice = ($VirtualDeviceMap.GetEnumerator() | Where-Object { $_.Value -eq
$BlockDeviceName }).Key | Select-Object -First 1
}
ElseIf ($DiskDrive.path -like "*PROD_AMAZON*") {
if ($DriveLetter -match '[^a-zA-Z0-9]') {
$i = 0
While ($i -ne ($array3.Count)) {
if ($array[2][$i] -eq $EbsVolumeID) {
1852
Amazon Elastic Compute Cloud
User Guide for Windows Instances
List volumes
$DriveLetter = $array[0][$i]
$DeviceName = $array[3][$i]
}
$i ++
}
}
$BlockDevice = ""
$BlockDeviceName = ($BlockDeviceMappings | Where-Object { $_.ebs.VolumeId -eq
$EbsVolumeID }).DeviceName
}
ElseIf ($DiskDrive.path -like "*NETAPP*") {
if ($DriveLetter -match '[^a-zA-Z0-9]') {
$i = 0
While ($i -ne ($array3.Count)) {
if ($array[2][$i] -eq $EbsVolumeID) {
$DriveLetter = $array[0][$i]
$DeviceName = $array[3][$i]
}
$i ++
}
}
$EbsVolumeID = "FSxN Volume"
$BlockDevice = ""
$BlockDeviceName = ($BlockDeviceMappings | Where-Object { $_.ebs.VolumeId -eq
$EbsVolumeID }).DeviceName
}
Else {
$BlockDeviceName = $null
$BlockDevice = $null
}
New-Object PSObject -Property @{
Disk = $Disk;
Partitions = $Partitions;
DriveLetter = If ($DriveLetter -eq $null) { "N/A" } Else { $DriveLetter };
EbsVolumeId = If ($EbsVolumeID -eq $null) { "N/A" } Else { $EbsVolumeID };
Device = If ($BlockDeviceName -eq $null) { "N/A" } Else { $BlockDeviceName };
VirtualDevice = If ($VirtualDevice -eq $null) { "N/A" } Else { $VirtualDevice };
VolumeName = If ($VolumeName -eq $null) { "N/A" } Else { $VolumeName };
DeviceName = If ($DeviceName -eq $null) { "N/A" } Else { $DeviceName };
}
} | Sort-Object Disk | Format-Table -AutoSize -Property Disk, Partitions, DriveLetter,
EbsVolumeId, Device, VirtualDevice, DeviceName, VolumeName
PS C:\> .\mapping.ps1
If you did not provide your credentials on the Windows instance, the script cannot get the EBS volume ID
and uses N/A in the EbsVolumeId column.
1853
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Recycle Bin
Some resources can be tagged with values that you define, to help you organize and identify them.
The following topics describe resources and tags, and how you can work with them.
Contents
• Recycle Bin (p. 1854)
• Resource locations (p. 1884)
• Resource IDs (p. 1885)
• List and filter your resources (p. 1886)
• Tag your Amazon EC2 resources (p. 1894)
• Amazon EC2 service quotas (p. 1909)
• Amazon EC2 usage reports (p. 1911)
Recycle Bin
Recycle Bin is a data recovery feature that enables you to restore accidentally deleted Amazon EBS
snapshots and EBS-backed AMIs. When using Recycle Bin, if your resources are deleted, they are retained
in the Recycle Bin for a time period that you specify before being permanently deleted.
You can restore a resource from the Recycle Bin at any time before its retention period expires. After you
restore a resource from the Recycle Bin, the resource is removed from the Recycle Bin and you can use
it in the same way that you use any other resource of that type in your account. If the retention period
expires and the resource is not restored, the resource is permanently deleted from the Recycle Bin and it
is no longer available for recovery.
Using Recycle Bin helps to ensure business continuity by protecting your business-critical data against
accidental deletion.
Topics
• How does it work? (p. 1854)
• Supported resources (p. 1855)
• Considerations (p. 1855)
• Quotas (p. 1857)
• Related services (p. 1858)
• Pricing (p. 1858)
• Required IAM permissions (p. 1858)
• Work with retention rules (p. 1862)
• Work with resources in the Recycle Bin (p. 1871)
• Monitor Recycle Bin (p. 1872)
1854
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Supported resources
With Recycle Bin, you can create two types of retention rules:
• Tag-level retention rules — A tag-level retention rule uses resource tags to identify the resources
that are to be retained in the Recycle Bin. For each retention rule, you specify one or more tag key
and value pairs. Resources of the specified type that are tagged with at least one of the tag key and
value pairs that are specified in the retention rule are automatically retained in the Recycle Bin upon
deletion. Use this type of retention rule if you want to protect specific resources in your account based
on their tags.
• Region-level retention rules — A Region-level retention rule does not have any resource tags
specified. It applies to all of the resources of the specified type in the Region in which the rule is
created, even if the resources are not tagged. Use this type of retention rule if you want to protect all
resources of a specific type in a specific Region.
While a resource is in the Recycle Bin, you have the ability to restore it for use at any time.
The resource remains in the Recycle Bin until one of the following happens:
• You manually restore it for use. When you restore a resource from the Recycle Bin, the resource is
removed from the Recycle Bin and it immediately becomes available for use. You can use restored
resources in the same way as any other resource of that type in your account.
• The retention period expires. If the retention period expires, and the resource has not been restored
from the Recycle Bin, the resource is permanently deleted from the Recycle Bin and it can no longer be
viewed or restored.
Supported resources
Recycle Bin supports the following resource types:
Considerations
The following considerations apply when working with Recycle Bin and retention rules.
General considerations
• Important
When you create your first retention rule, it can take up to 30 minutes for the rule to
become active and for it to start retaining resources. After you create the first retention rule,
subsequent retention rules become active and start retaining resources almost immediately.
1855
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Considerations
• If a resource matches more than one retention rule upon deletion, then the retention rule with the
longest retention period takes precedence.
• You can't manually delete a resource from the Recycle Bin. The resource will be automatically deleted
when its retention period expires.
• While a resource is in the Recycle Bin, you can only view it, restore it, or modify its tags. To use the
resource in any other way, you must first restore it.
• If any AWS service, such as AWS Backup or Amazon Data Lifecycle Manager, deletes a resource that
matches a retention rule, that resource is automatically retained by Recycle Bin.
• When a resource is sent to the Recycle Bin, the following system-generate tag is assigned to the
resource:
• Tag key — aws:recycle-bin:resource-in-bin
• Tag value — true
You can't manually edit or delete this tag. When the resource is restored from the Recycle Bin, the tag
is automatically removed.
• Important
If you have retention rules for AMIs and for their associated snapshots, make the retention
period for the snapshots the same or longer than the retention period for the AMIs. This
ensures that Recycle Bin does not delete the snapshots associated with an AMI before
deleting the AMI itself, as this would make the AMI unrecoverable.
• If a snapshot is enabled for fast snapshot restore when it is deleted, fast snapshot restore is
automatically disabled shortly after the snapshot is sent to the Recycle Bin.
• If you restore the snapshot before fast snapshot restore is disabled for the snapshot, it remains
enabled.
• If you restore the snapshot, after fast snapshot restore has been disabled, it remains disabled. If
needed, you must manually re-enable fast snapshot restore.
• If a snapshot is shared when it is deleted, it is automatically unshared when it is sent to the Recycle
Bin. If you restore the snapshot, all of the previous sharing permissions are automatically restored.
• If a snapshot that was created by another AWS service, such as AWS Backup is sent to the Recycle Bin
and you later restore that snapshot from the Recycle Bin, it is no longer managed by the AWS service
that created it. You must manually delete the snapshot if it is no longer needed.
1856
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Quotas
• If Amazon Data Lifecycle Manager deletes a snapshot that matches a retention rule, that snapshot is
automatically retained by Recycle Bin.
• If Amazon Data Lifecycle Manager deletes a snapshot and sends it to the Recycle Bin when the policy's
retention threshold is reached, and you manually restore the snapshot from the Recycle Bin, you must
manually delete that snapshot when it is no longer needed. Amazon Data Lifecycle Manager will no
longer manage the snapshot.
• If you manually delete a snapshot that was created by a policy, and that snapshot is in the Recycle Bin
when the policy’s retention threshold is reached, Amazon Data Lifecycle Manager will not delete the
snapshot. Amazon Data Lifecycle Manager does not manage the snapshots while they are stored in the
Recycle Bin.
If the snapshot is restored from the Recycle Bin before the policy's retention threshold is reached,
Amazon Data Lifecycle Manager will delete the snapshot when the policy's retention threshold is
reached.
If the snapshot is restored from the Recycle Bin after the policy's retention threshold is reached,
Amazon Data Lifecycle Manager will no longer delete the snapshot. You must manually delete the
snapshot when it is no longer needed.
• If AWS Backup deletes a snapshot that matches a retention rule, that snapshot is automatically
retained by Recycle Bin.
• Recycle Bin retention rules also apply to archived snapshots in the archive storage tier. If you delete an
archived snapshot that matches a retention rule, that snapshot is retained in the Recycle Bin for the
period defined in the retention rule.
Archived snapshots are billed at the rate for archived snapshots while they are in the Recycle Bin.
If a retention rule deletes an archived snapshot from the Recycle Bin before the minimum archive
period of 90 days, you are billed for the remaining days. For more information, see Pricing and
billing (p. 1599).
To use an archived snapshot that is in the Recycle Bin, you must first recover the snapshot from the
Recycle Bin and then restore it from the archive tier to the standard tier.
Quotas
The following quotas apply to Recycle Bin.
1857
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Related services
Related services
Recycle Bin works with the following services:
• AWS CloudTrail — Enables you to record events that occur in Recycle Bin. For more information, see
Monitor Recycle Bin using AWS CloudTrail (p. 1874).
Pricing
Resources in the Recycle Bin are billed at their standard rates. There are no additional charges for using
Recycle Bin and retention rules. For more information, see Amazon EBS pricing.
Note
Some resources might still appear in the Recycle Bin console or in the AWS CLI and API output
for a short period after their retention periods have expired and they have been permanently
deleted. You are not billed for these resources. Billing stops as soon as the retention period
expires.
You can use the following AWS generated cost allocation tags for cost tracking and allocation purposes
when using AWS Billing and Cost Management.
• Key: aws:recycle-bin:resource-in-bin
• Value: true
For more information, see AWS-generated cost allocation tags in the AWS Billing and Cost Management
User Guide.
Topics
• Permissions for working with Recycle Bin and retention rules (p. 1858)
• Permissions for working with resources in the Recycle Bin (p. 1859)
• Condition keys for Recycle Bin (p. 1860)
• rbin:CreateRule
• rbin:UpdateRule
• rbin:GetRule
• rbin:ListRules
• rbin:DeleteRule
• rbin:TagResource
• rbin:UntagResource
1858
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Required IAM permissions
• rbin:ListTagsForResource
• rbin:LockRule
• rbin:UnlockRule
To use the Recycle Bin console, users need the tag:GetResources permission.
The following is an example IAM policy that includes the tag:GetResources permission for console
users. If some permissions are not needed, you can remove them from the policy.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"rbin:CreateRule",
"rbin:UpdateRule",
"rbin:GetRule",
"rbin:ListRules",
"rbin:DeleteRule",
"rbin:TagResource",
"rbin:UntagResource",
"rbin:ListTagsForResource",
"rbin:LockRule",
"rbin:UnlockRule",
"tag:GetResources"
],
"Resource": "*"
}]
}
• Users and groups in AWS IAM Identity Center (successor to AWS Single Sign-On):
Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity
Center (successor to AWS Single Sign-On) User Guide.
• Users managed in IAM through an identity provider:
Create a role for identity federation. Follow the instructions in Creating a role for a third-party identity
provider (federation) in the IAM User Guide.
• IAM users:
• Create a role that your user can assume. Follow the instructions in Creating a role for an IAM user in
the IAM User Guide.
• (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the
instructions in Adding permissions to a user (console) in the IAM User Guide.
• Permissions for working with snapshots in the Recycle Bin (p. 1625)
• Permissions for working with AMIs in the Recycle Bin (p. 182)
1859
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Required IAM permissions
Topics
• rbin:Request/ResourceType condition key (p. 1860)
• rbin:Attribute/ResourceType condition key (p. 1861)
Example 1 - CreateRule
The following sample IAM policy allows IAM principals to make CreateRule requests only if the value
specified for the ResourceType request parameter is EBS_SNAPSHOT or EC2_IMAGE. This allows the
principal to create new retention rules for snapshots and AMIs only.
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" :[
"rbin:CreateRule"
],
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"rbin:Request/ResourceType" : ["EBS_SNAPSHOT", "EC2_IMAGE"]
}
}
}
]
}
Example 2 - ListRules
The following sample IAM policy allows IAM principals to make ListRules requests only if the value
specified for the ResourceType request parameter is EBS_SNAPSHOT. This allows the principal to
list retention rules for snapshots only, and it prevents them from listing retention rules for any other
resource type.
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" :[
"rbin:ListRules"
],
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"rbin:Request/ResourceType" : "EBS_SNAPSHOT"
1860
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Required IAM permissions
}
}
}
]
}
Example 1 - UpdateRule
The following sample IAM policy allows IAM principals to make UpdateRule requests only if the
ResourceType attribute of the requested retention rule is EBS_SNAPSHOT or EC2_IMAGE. This allows
the principal to update retention rules for snapshots and AMIs only.
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" :[
"rbin:UpdateRule"
],
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"rbin:Attribute/ResourceType" : ["EBS_SNAPSHOT", "EC2_IMAGE"]
}
}
}
]
}
Example 2 - DeleteRule
The following sample IAM policy allows IAM principals to make DeleteRule requests only if the
ResourceType attribute of the requested retention rule is EBS_SNAPSHOT. This allows the principal to
delete retention rules for snapshots only.
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" :[
"rbin:DeleteRule"
],
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"rbin:Attribute/ResourceType" : "EBS_SNAPSHOT"
}
}
}
]
}
1861
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
With Recycle Bin, you can create two types of retention rules:
• Tag-level retention rules — A tag-level retention rule uses resource tags to identify the resources
that are to be retained in the Recycle Bin. For each retention rule, you specify one or more tag key
and value pairs. Resources of the specified type that are tagged with at least one of the tag key and
value pairs that are specified in the retention rule are automatically retained in the Recycle Bin upon
deletion. Use this type of retention rule if you want to protect specific resources in your account based
on their tags.
• Region-level retention rules — A Region-level retention rule does not have any resource tags
specified. It applies to all of the resources of the specified type in the Region in which the rule is
created, even if the resources are not tagged. Use this type of retention rule if you want to protect all
resources of a specific type in a specific Region.
After you create a retention rule, resources that match its criteria are automatically retained in the
Recycle Bin for the specified retention period after they are deleted.
Topics
• Create a retention rule (p. 1862)
• View Recycle Bin retention rules (p. 1865)
• Update retention rules (p. 1865)
• Lock retention rules (p. 1866)
• Unlock retention rules (p. 1868)
• Tag retention rules (p. 1869)
• View retention rule tags (p. 1869)
• Remove tags from retention rules (p. 1870)
• Delete Recycle Bin retention rules (p. 1871)
1862
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
• An optional name for the retention rule. The name can be up to 255 characters long.
• An optional description for the retention rule. The description can be up to 255 characters long.
Note
We recommend that you do not include personally identifying, confidential, or sensitive
information in the retention rule description.
• Optional retention rule tags to help identify and organize your retention rules. You can assign up to 50
tags to each rule.
You can also optionally lock retention rules on creation. If you lock a retention rule on creation, you must
also specify the unlock delay period, which can be 7 to 30 days. Retention rules remain unlocked by
default unless you explicitly lock them.
Retention rules function only in the Regions in which they are created. If you intend to use Recycle Bin in
other Regions, you must create additional retention rules in those Regions.
You can create a Recycle Bin retention rule using one of the following methods.
a. (Optional) For Retention rule name, enter a descriptive name for the retention rule.
b. (Optional) For Retention rule description, enter a brief description for the retention rule.
4. In the Rule settings section, do the following:
a. For Resource type, select choose the type of resource for the retention rule to protect. The
retention rule will retain only resources of this type in the Recycle Bin.
b. Do one of the following:
• To create a Region-level retention rule that matches all deleted resources of the specified
type in the Region, select Apply to all resources. The retention rule will retain all deleted
resources of the specified in the Recycle Bin upon deletion, even if the resources do not
have any tags.
• To create a tag-level retention rule, for Resource tags to match, enter the tag key and
value pairs to use to identify resource of the specified type that are to be retained in the
Recycle Bin. Only resources of the specified type that have at least one of the specified
tag key and value pairs will be retained by the retention rule.
c. For Retention period, enter the number of days for which the retention rule is to retain
resources in the Recycle Bin.
5. (Optional) To lock the retention rule, for Rule lock settings, select Lock, and then for Unlock
delay period, specify the unlock delay period in days. A locked retention rule can't be modified
or deleted. To modify or delete the rule, you must first unlock it and then wait for the unlock
delay period to expire. For more information, see Lock retention rules (p. 1866)
To leave the retention rule unlocked, for Rule lock settings, keep Unlock selected. An unlocked
retention rule can be modified or deleted at any time. For more information, see Unlock
retention rules (p. 1868).
6. (Optional) In the Tags section, do the following:
1863
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
• To tag the rule with custom tags, choose Add tag and then enter the tag key and value pair.
7. Choose Create retention rule.
AWS CLI
Use the create-rule AWS CLI command. For --retention-period, specify the number of days to
retain deleted snapshots in the Recycle Bin. For --resource-type, specify EBS_SNAPSHOT for
snapshots or EC2_IMAGE for AMIs. To create a tag-level retention rule, for --resource-tags,
specify the tags to use to identify the snapshots that are to be retained. To create a Region-level
retention rule, omit --resource-tags. To lock a retention rule, include --lock-configuration,
and specify the unlock delay period in days.
Example 1
The following example command creates an unlocked Region-level retention rule that retains all
deleted snapshots for a period of 7 days.
Example 2
The following example command creates a tag-level rule that retains deleted snapshots that are
tagged with purpose=production for a period of 7 days.
Example 3
The following example command creates a locked Region-level retention rule that retains all deleted
snapshots for a period of 7 days. The retention rule is locked with an unlock delay period of 7 days.
1864
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
AWS CLI
Use the list-rules AWS CLI command, and for --resource-type, specify EBS_SNAPSHOT for
snapshots or EC2_IMAGE for AMIs.
Example
The following example command provides lists all retention rules that retain snapshots.
Example
The following example command provides information about retention rule pwxIkFcvge4.
You can't update a locked retention rule in any way. If you need to modify a locked retention rule, you
must first unlock it and wait for the unlock delay period to expire.
If you need to modify the unlock delay period for a locked retention rule, you must unlock the retention
rule (p. 1868), and wait for the current unlock delay period to expire. When the unlock delay period is
expired, you must relock the retention rule (p. 1866) and specify the new unlock delay period.
1865
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
Note
We recommend that you do not include personally identifying, confidential, or sensitive
information in the retention rule description.
After you update a retention rule, the changes only apply to new resources that it retains. The changes
do not affect resources that it previously sent to the Recycle Bin. For example, if you update a retention
rule's retention period, only snapshots that are deleted after the update are retained for the new
retention period. Snapshots that it sent to the Recycle Bin before the update are still retained for the
previous (old) retention period.
You can update a retention rule using one of the following methods.
AWS CLI
Use the update-rule AWS CLI command. For --identifier, specify the ID of the retention rule to
update For --resource-types, specify EBS_SNAPSHOT for snapshots or EC2_IMAGE for AMIs.
Example
The following example command updates retention rule 6lsJ2Fa9nh9 to retain all snapshots for 7
days and updates its description.
1866
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
A locked retention rule can't be modified or deleted, even by users who have the required IAM
permissions. Lock your retention rules to help protect them against accidental or malicious modifications
and deletions.
When you lock a retention rule, you must specify an unlock delay period. This is the period of time that
you must wait after unlocking the retention rule before you can modify or delete it. You cannot modify
or delete the retention rule during the unlock delay period. You can modify or delete the retention rule
only after the unlock delay period has expired.
You can't change the unlock delay period after the retention rule has been locked. If your account
permissions have been compromised, the unlock delay period gives you additional time to detect and
respond to security threats. The length of this period should be longer than the time it takes for you to
identify and respond to security breaches. To set the right duration, you can review previous security
incidents and the time needed to identify and remediate an account breach.
We recommend that you use Amazon EventBridge rules to notify you of retention rule lock state
changes. For more information, see Monitor Recycle Bin using Amazon EventBridge (p. 1872).
Considerations
You can lock a Region-level retention rule using one of the following methods.
AWS CLI
Use the lock-rule AWS CLI command. For --identifier, specify the ID of the retention rule to lock.
For --lock-configuration, specify the unlock delay period in days.
Example
1867
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
The following example command locks retention rule 6lsJ2Fa9nh9 and sets the unlock delay
period to 15 days.
An unlocked retention rule can be modified and deleted at any time by a user who has the required
IAM permissions. Leaving your retention rules unlocked could expose them to accidental or malicious
modifications and deletions.
Considerations
• You can re-lock a retention rule during the unlock delay period.
• You can re-lock a retention rule after the unlock delay period has expired.
• You can't bypass the unlock delay period.
• You can't change the unlock delay period after the initial lock.
We recommend that you use Amazon EventBridge rules to notify you of retention rule lock state
changes. For more information, see Monitor Recycle Bin using Amazon EventBridge (p. 1872).
You can unlock a locked Region-level retention rule using one of the following methods.
AWS CLI
Use the unlock-rule AWS CLI command. For --identifier, specify the ID of the retention rule to
unlock.
Example
1868
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
You can assign a tag to a retention rule using one of the following methods.
AWS CLI
Use the tag-resource AWS CLI command. For --resource-arn, specify the Amazon Resource Name
(ARN) of the retention rule to tag, and for --tags, specify the tag key and value pair.
Example
1869
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with retention rules
AWS CLI
Use the list-tags-for-resource AWS CLI command. For --resource-arn, specify the ARN of the
retention rule.
Example
The following example command lists the tags for retention rule arn:aws:rbin:us-
east-1:123456789012:rule/nOoSBBtItF3.
AWS CLI
Use the untag-resource AWS CLI command. For --resource-arn, specify the ARN of the retention
rule. For --tagkeys, specify the tags keys of the tags to remove.
Example
The following example command removes tags that have a tag key of purpose from retention rule
arn:aws:rbin:us-east-1:123456789012:rule/nOoSBBtItF3.
1870
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Work with resources in the Recycle Bin
You can delete a retention rule using one of the following methods.
AWS CLI
Use the delete-rule AWS CLI command. For --identifier, specify the ID of the retention rule to
delete.
Example
Topics
• Work with snapshots in the Recycle Bin (p. 1871)
• Work with AMIs in the Recycle Bin (p. 1872)
This section includes links to the topics that explain how to work with the supported resource types.
1871
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
Topics
• Monitor Recycle Bin using Amazon EventBridge (p. 1872)
• Monitor Recycle Bin using AWS CloudTrail (p. 1874)
Events in EventBridge are represented as JSON objects. The fields that are unique to the event are
contained in the detail section of the JSON object. The event field contains the event name. The
result field contains the completed status of the action that initiated the event. For more information,
see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.
For more information about Amazon EventBridge, see What Is Amazon EventBridge? in the Amazon
EventBridge User Guide.
Events
• RuleLocked (p. 1872)
• RuleChangeAttempted (p. 1873)
• RuleUnlockScheduled (p. 1873)
• RuleUnlockingNotice (p. 1874)
• RuleUnlocked (p. 1874)
RuleLocked
The following is an example of an event that Recycle Bin generates when a retention rule is successfully
locked. This event can be generated by CreateRule and LockRule requests. The API that generated the
event is noted in the api-name field.
{
"version": "0",
"id": "exampleb-b491-4cf7-a9f1-bf370example",
"detail-type": "Recycle Bin Rule Locked",
"source": "aws.rbin",
"account": "123456789012",
"time": "2022-08-10T16:37:50Z",
"region": "us-west-2",
"resources": [
"arn:aws:rbin:us-west-2:123456789012:rule/a12345abcde"
],
"detail":
1872
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
{
"detail-version": " 1.0.0",
"rule-id": "a12345abcde",
"rule-description": "locked account level rule",
"unlock-delay-period": "30 days",
"api-name": "CreateRule"
}
}
RuleChangeAttempted
The following is an example of an event that Recycle Bin generates for unsuccessful attempts to modify
or delete a locked rule. This event can be generated by DeleteRule and UpdateRule requests. The API
that generated the event is noted in the api-name field.
{
"version": "0",
"id": "exampleb-b491-4cf7-a9f1-bf370example",
"detail-type": "Recycle Bin Rule Change Attempted",
"source": "aws.rbin",
"account": "123456789012",
"time": "2022-08-10T16:37:50Z",
"region": "us-west-2",
"resources": [
"arn:aws:rbin:us-west-2:123456789012:rule/a12345abcde"
],
"detail":
{
"detail-version": " 1.0.0",
"rule-id": "a12345abcde",
"rule-description": "locked account level rule",
"unlock-delay-period": "30 days",
"api-name": "DeleteRule"
}
}
RuleUnlockScheduled
The following is an example of an event that Recycle Bin generates when a retention rule is unlocked and
it starts its unlock delay period.
{
"version": "0",
"id": "exampleb-b491-4cf7-a9f1-bf370example",
"detail-type": "Recycle Bin Rule Unlock Scheduled",
"source": "aws.rbin",
"account": "123456789012",
"time": "2022-08-10T16:37:50Z",
"region": "us-west-2",
"resources": [
"arn:aws:rbin:us-west-2:123456789012:rule/a12345abcde"
],
"detail":
{
"detail-version": " 1.0.0",
"rule-id": "a12345abcde",
"rule-description": "locked account level rule",
"unlock-delay-period": "30 days",
"scheduled-unlock-time": "2022-09-10T16:37:50Z",
}
}
1873
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
RuleUnlockingNotice
The following is an example of an event that Recycle Bin generates daily while a retention rule is in its
unlock delay period, until the day before the unlock delay period expires.
{
"version": "0",
"id": "exampleb-b491-4cf7-a9f1-bf370example",
"detail-type": "Recycle Bin Rule Unlocking Notice",
"source": "aws.rbin",
"account": "123456789012",
"time": "2022-08-10T16:37:50Z",
"region": "us-west-2",
"resources": [
"arn:aws:rbin:us-west-2:123456789012:rule/a12345abcde"
],
"detail":
{
"detail-version": " 1.0.0",
"rule-id": "a12345abcde",
"rule-description": "locked account level rule",
"unlock-delay-period": "30 days",
"scheduled-unlock-time": "2022-09-10T16:37:50Z"
}
}
RuleUnlocked
The following is an example of an event that Recycle Bin generates when the unlock delay period for a
retention rule expires and the retention rule can be modified or deleted.
{
"version": "0",
"id": "exampleb-b491-4cf7-a9f1-bf370example",
"detail-type": "Recycle Bin Rule Unlocked",
"source": "aws.rbin",
"account": "123456789012",
"time": "2022-08-10T16:37:50Z",
"region": "us-west-2",
"resources": [
"arn:aws:rbin:us-west-2:123456789012:rule/a12345abcde"
],
"detail":
{
"detail-version": " 1.0.0",
"rule-id": "a12345abcde",
"rule-description": "locked account level rule",
"unlock-delay-period": "30 days",
"scheduled-unlock-time": "2022-09-10T16:37:50Z"
}
}
1874
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
For more information about CloudTrail, see the AWS CloudTrail User Guide.
For an ongoing record of events in your AWS account, including events for Recycle Bin, create a trail.
A trail enables CloudTrail to deliver log files to an S3 bucket. By default, when you create a trail in
the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS
partition and delivers the log files to the S3 bucket that you specify. Additionally, you can configure
other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more
information, see Overview for creating a trail in the AWS CloudTrail User Guide.
For Recycle Bin, you can use CloudTrail to log the following API actions as management events.
• CreateRule
• UpdateRule
• GetRules
• ListRule
• DeleteRule
• TagResource
• UntagResource
• ListTagsForResource
• LockRule
• UnlockRule
For more information about logging management events, see Logging management events for trails in
the CloudTrail User Guide.
Identity information
Every event or log entry contains information about who generated the request. The identity
information helps you determine the following:
• Whether the request was made with root user or user credentials.
• Whether the request was made with temporary security credentials for a role or federated user.
• Whether the request was made by another AWS service.
1875
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
CreateRule
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-08-02T21:43:38Z"
}
}
},
"eventTime": "2021-08-02T21:45:22Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "CreateRule",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.9 Python/3.6.14
Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9",
"requestParameters": {
"retentionPeriod": {
"retentionPeriodValue": 7,
"retentionPeriodUnit": "DAYS"
},
"description": "Match all snapshots",
"resourceType": "EBS_SNAPSHOT"
},
"responseElements": {
"identifier": "jkrnexample"
},
"requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample",
"eventID": "714fafex-2eam-42pl-913e-926d4example",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
GetRule
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
1876
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-08-02T21:43:38Z"
}
}
},
"eventTime": "2021-08-02T21:45:33Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "GetRule",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.9 Python/3.6.14
Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9",
"requestParameters": {
"identifier": "jkrnexample"
},
"responseElements": null,
"requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample",
"eventID": "714fafex-2eam-42pl-913e-926d4example",
"readOnly": true,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
ListRules
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-08-02T21:43:38Z"
1877
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
}
}
},
"eventTime": "2021-08-02T21:44:37Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "ListRules",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.9 Python/3.6.14
Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9",
"requestParameters": {
"resourceTags": [
{
"resourceTagKey": "test",
"resourceTagValue": "test"
}
]
},
"responseElements": null,
"requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample",
"eventID": "714fafex-2eam-42pl-913e-926d4example",
"readOnly": true,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
UpdateRule
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-08-02T21:43:38Z"
}
}
},
"eventTime": "2021-08-02T21:46:03Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "UpdateRule",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.9 Python/3.6.14
Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9",
1878
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
"requestParameters": {
"identifier": "jkrnexample",
"retentionPeriod": {
"retentionPeriodValue": 365,
"retentionPeriodUnit": "DAYS"
},
"description": "Match all snapshots",
"resourceType": "EBS_SNAPSHOT"
},
"responseElements": null,
"requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample",
"eventID": "714fafex-2eam-42pl-913e-926d4example",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
DeleteRule
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-08-02T21:43:38Z"
}
}
},
"eventTime": "2021-08-02T21:46:25Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "DeleteRule",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.9 Python/3.6.14
Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9",
"requestParameters": {
"identifier": "jkrnexample"
},
"responseElements": null,
"requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample",
"eventID": "714fafex-2eam-42pl-913e-926d4example",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
1879
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
TagResource
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-10-22T21:38:34Z"
}
}
},
"eventTime": "2021-10-22T21:43:15Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "TagResource",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.26 Python/3.6.14
Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26",
"requestParameters": {
"resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234",
"tags": [
{
"key": "purpose",
"value": "production"
}
]
},
"responseElements": null,
"requestID": "examplee-7962-49ec-8633-795efexample",
"eventID": "example4-6826-4c0a-bdec-0bab1example",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
1880
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
UntagResource
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-10-22T21:38:34Z"
}
}
},
"eventTime": "2021-10-22T21:44:16Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "UntagResource",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.26 Python/3.6.14
Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26",
"requestParameters": {
"resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234",
"tagKeys": [
"purpose"
]
},
"responseElements": null,
"requestID": "example7-6c1e-4f09-9e46-bb957example",
"eventID": "example6-75ff-4c94-a1cd-4d5f5example",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
ListTagsForResource
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
1881
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2021-10-22T21:38:34Z"
}
}
},
"eventTime": "2021-10-22T21:42:31Z",
"eventSource": "rbin.amazonaws.com",
"eventName": "ListTagsForResource",
"awsRegion": "us-west-2",
"sourceIPAddress": "123.123.123.123",
"userAgent": "aws-cli/1.20.26 Python/3.6.14
Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26",
"requestParameters": {
"resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234"
},
"responseElements": null,
"requestID": "example8-10c7-43d4-b147-3d9d9example",
"eventID": "example2-24fc-4da7-a479-c9748example",
"readOnly": true,
"eventType": "AwsApiCall",
"managementEvent": true,
"eventCategory": "Management",
"recipientAccountId": "123456789012",
"tlsDetails": {
"tlsVersion": "TLSv1.2",
"cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com"
}
}
LockRule
{
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:root",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:role/Admin",
"accountId": "123456789012",
"userName": "Admin"
},
"webIdFederationData": {},
"attributes": {
"creationDate": "2022-10-25T00:45:11Z",
"mfaAuthenticated": "false"
}
}
},
"eventTime": "2022-10-25T00:45:19Z",
1882
Amazon Elastic Compute Cloud
User Guide for Windows Instances
Monitor Recycle Bin
"eventSource": "rbin.amazonaw