AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Request-EC2SpotFleet-SpotFleetRequestConfig_SpotPrice <String>-SpotFleetRequestConfig_AllocationStrategy <AllocationStrategy>-ClassicLoadBalancersConfig_ClassicLoadBalancer <ClassicLoadBalancer[]>-SpotFleetRequestConfig_ClientToken <String>-SpotFleetRequestConfig_Context <String>-SpotFleetRequestConfig_ExcessCapacityTerminationPolicy <ExcessCapacityTerminationPolicy>-SpotFleetRequestConfig_FulfilledCapacity <Double>-SpotFleetRequestConfig_IamFleetRole <String>-SpotFleetRequestConfig_InstanceInterruptionBehavior <InstanceInterruptionBehavior>-SpotFleetRequestConfig_InstancePoolsToUseCount <Int32>-SpotFleetRequestConfig_LaunchSpecification <SpotFleetLaunchSpecification[]>-SpotFleetRequestConfig_LaunchTemplateConfig <LaunchTemplateConfig[]>-SpotFleetRequestConfig_OnDemandAllocationStrategy <OnDemandAllocationStrategy>-SpotFleetRequestConfig_OnDemandFulfilledCapacity <Double>-SpotFleetRequestConfig_OnDemandMaxTotalPrice <String>-SpotFleetRequestConfig_OnDemandTargetCapacity <Int32>-CapacityRebalance_ReplacementStrategy <ReplacementStrategy>-SpotFleetRequestConfig_ReplaceUnhealthyInstance <Boolean>-SpotFleetRequestConfig_SpotMaxTotalPrice <String>-SpotFleetRequestConfig_TagSpecification <TagSpecification[]>-SpotFleetRequestConfig_TargetCapacity <Int32>-SpotFleetRequestConfig_TargetCapacityUnitType <TargetCapacityUnitType>-TargetGroupsConfig_TargetGroup <TargetGroup[]>-SpotFleetRequestConfig_TerminateInstancesWithExpiration <Boolean>-CapacityRebalance_TerminationDelay <Int32>-SpotFleetRequestConfig_Type <FleetType>-SpotFleetRequestConfig_UtcValidFrom <DateTime>-SpotFleetRequestConfig_UtcValidUntil <DateTime>-SpotFleetRequestConfig_ValidFrom <DateTime>-SpotFleetRequestConfig_ValidUntil <DateTime>-Select <String>-PassThru <SwitchParameter>-Force <SwitchParameter>-ClientConfig <AmazonEC2Config>
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_SpotMaintenanceStrategies_CapacityRebalance_ReplacementStrategy |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_SpotMaintenanceStrategies_CapacityRebalance_TerminationDelay |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_LoadBalancersConfig_ClassicLoadBalancersConfig_ClassicLoadBalancers |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_LaunchSpecifications |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_LaunchTemplateConfigs |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_ReplaceUnhealthyInstances |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_TagSpecifications |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SpotFleetRequestConfig_LoadBalancersConfig_TargetGroupsConfig_TargetGroups |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
$sg = New-Object Amazon.EC2.Model.GroupIdentifier
$sg.GroupId = "sg-12345678"
$lc = New-Object Amazon.EC2.Model.SpotFleetLaunchSpecification
$lc.ImageId = "ami-12345678"
$lc.InstanceType = "m3.medium"
$lc.SecurityGroups.Add($sg)
Request-EC2SpotFleet -SpotFleetRequestConfig_SpotPrice 0.04 `
-SpotFleetRequestConfig_TargetCapacity 2 `
-SpotFleetRequestConfig_IamFleetRole arn:aws:iam::123456789012:role/my-spot-fleet-role `
-SpotFleetRequestConfig_LaunchSpecification $lcThis example creates a Spot fleet request in the Availability Zone with the lowest price for the specified instance type. If your account supports EC2-VPC only, the Spot fleet launches the instances in the lowest-priced Availability Zone that has a default subnet. If your account supports EC2-Classic, the Spot fleet launches the instances in EC2-Classic in the lowest-priced Availability Zone. Note that the price you pay will not exceed the specified Spot price for the request.
AWS Tools for PowerShell: 2.x.y.z