AWS AWSEC2 documentation change
Summary
Added detailed PowerShell and AWS CLI examples for Spot Fleet configurations including capacity-optimized allocation and ReplaceUnhealthyInstances parameter
Security assessment
Changes provide example configurations and parameter usage but do not address security vulnerabilities or document security features. The IAM role ARN example update (000000000000→123456789012) is a placeholder standardization.
Diff
diff --git a/AWSEC2/latest/UserGuide/create-spot-fleet.md b/AWSEC2/latest/UserGuide/create-spot-fleet.md index 487638caf..82862a41d 100644 --- a//AWSEC2/latest/UserGuide/create-spot-fleet.md +++ b//AWSEC2/latest/UserGuide/create-spot-fleet.md @@ -208 +208,19 @@ PowerShell -Use the [Request-EC2SpotFleet](https://docs.aws.amazon.com/powershell/latest/reference/items/Request-EC2SpotFleet.html) cmdlet. +Use the [Request-EC2SpotFleet](https://docs.aws.amazon.com/powershell/latest/reference/items/Request-EC2SpotFleet.html) cmdlet. The following example launches Spot Instances in a capacity-optimized fleet. + + + Request-EC2SpotFleet ` + -SpotFleetRequestConfig_TargetCapacity 50 ` + -SpotFleetRequestConfig_AllocationStrategy "CapacityOptimized" ` + -SpotFleetRequestConfig_IamFleetRole "arn:aws:iam::123456789012:role/my-spot-fleet-role" ` + -SpotFleetRequestConfig_LaunchTemplateConfig @($launchConfig) + +Define the launch configuration as follows, setting the launch template and override properties that you need. For example configurations, see [Example CLI configurations Spot Fleet](./spot-fleet-examples.html). + + + $lcSpec = Amazon.EC2.Model.FleetLaunchTemplateSpecification + # To do - Set FleetLaunchTemplateSpecification properties + $lcOverrides = New-Object Amazon.EC2.Model.LaunchTemplateOverrides + # To do - Set LaunchTemplateOverrides properties + $launchConfig = New-Object Amazon.EC2.Model.LaunchTemplateConfig + $launchConfig.LaunchTemplateSpecification $lcSpec + $launchConfig.Overrides @($lcOverrides) @@ -248 +266,11 @@ AWS CLI -Use the [request-spot-fleet](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/request-spot-fleet.html) command. Set `ReplaceUnhealthyInstances` to `true`. +Use the [request-spot-fleet](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/request-spot-fleet.html) command with the `ReplaceUnhealthyInstances` property of `SpotFleetRequestConfig`. + + + { + "SpotFleetRequestConfig": { + "AllocationStrategy": "lowestPrice", + "IamFleetRole": "arn:aws:iam::123456789012:role/aws-ec2-spot-fleet-tagging-role", + "TargetCapacity": 10, + "ReplaceUnhealthyInstances": true + } + } @@ -255 +283,4 @@ PowerShell -Use the [Request-EC2SpotFleet](https://docs.aws.amazon.com/powershell/latest/reference/items/Request-EC2SpotFleet.html) cmdlet. Set the `-SpotFleetRequestConfig_ReplaceUnhealthyInstance` option to `$true`. +Use the [Request-EC2SpotFleet](https://docs.aws.amazon.com/powershell/latest/reference/items/Request-EC2SpotFleet.html) cmdlet with the `-SpotFleetRequestConfig_ReplaceUnhealthyInstance` parameter. + + + -SpotFleetRequestConfig_ReplaceUnhealthyInstance $true