AWS code-library documentation change
Summary
Added PowerShell V5 example for Spot Fleet requests with security group configuration
Security assessment
Includes security group setup but no evidence of security vulnerability remediation
Diff
diff --git a/code-library/latest/ug/ec2_example_ec2_RequestSpotFleet_section.md b/code-library/latest/ug/ec2_example_ec2_RequestSpotFleet_section.md index 494725760..87d2cc920 100644 --- a//code-library/latest/ug/ec2_example_ec2_RequestSpotFleet_section.md +++ b//code-library/latest/ug/ec2_example_ec2_RequestSpotFleet_section.md @@ -204,0 +205,23 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This 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.** + + + $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 $lc + + + * For API details, see [RequestSpotFleet](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +