describeSpotPriceHistory
inline suspend fun Ec2Client.describeSpotPriceHistory(crossinline block: DescribeSpotPriceHistoryRequest.Builder.() -> Unit): DescribeSpotPriceHistoryResponse
Describes the Spot price history. For more information, see Spot Instance pricing history in the Amazon EC2 User Guide.
When you specify a start and end time, the operation returns the prices of the instance types within that time range. It also returns the last price change before the start time, which is the effective price as of the start time.
Samples
import aws.sdk.kotlin.services.ec2.model.InstanceType
fun main() {
//sampleStart
// This example returns the Spot Price history for m1. xlarge, Linux UNIX (Amazon VPC) instances for a
// particular day in January.
val resp = ec2Client.describeSpotPriceHistory {
startTime = "2014-01-06T07:08:09.05Z"
endTime = "2014-01-06T08:09:10.05Z"
instanceTypes = listOf<InstanceType>(
InstanceType.fromValue("m1.xlarge")
)
productDescriptions = listOf<String>(
"Linux/UNIX (Amazon VPC)"
)
}
//sampleEnd
}