Skip to content

Get Cost Estimate

lightsail_get_cost_estimate R Documentation

Retrieves information about the cost estimate for a specified resource

Description

Retrieves information about the cost estimate for a specified resource. A cost estimate will not generate for a resource that has been deleted.

Usage

lightsail_get_cost_estimate(resourceName, startTime, endTime)

Arguments

resourceName

[required] The resource name.

startTime

[required] The cost estimate start time.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you want to use a start time of October 1, 2018, at 8 PM UTC, specify 1538424000 as the start time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

endTime

[required] The cost estimate end time.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you want to use an end time of October 1, 2018, at 9 PM UTC, specify 1538427600 as the end time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

Value

A list with the following syntax:

list(
  resourcesBudgetEstimate = list(
    list(
      resourceName = "string",
      resourceType = "ContainerService"|"Instance"|"StaticIp"|"KeyPair"|"InstanceSnapshot"|"Domain"|"PeeredVpc"|"LoadBalancer"|"LoadBalancerTlsCertificate"|"Disk"|"DiskSnapshot"|"RelationalDatabase"|"RelationalDatabaseSnapshot"|"ExportSnapshotRecord"|"CloudFormationStackRecord"|"Alarm"|"ContactMethod"|"Distribution"|"Certificate"|"Bucket",
      costEstimates = list(
        list(
          usageType = "string",
          resultsByTime = list(
            list(
              usageCost = 123.0,
              pricingUnit = "GB"|"Hrs"|"GB-Mo"|"Bundles"|"Queries",
              unit = 123.0,
              currency = "USD",
              timePeriod = list(
                start = as.POSIXct(
                  "2015-01-01"
                ),
                end = as.POSIXct(
                  "2015-01-01"
                )
              )
            )
          )
        )
      ),
      startTime = as.POSIXct(
        "2015-01-01"
      ),
      endTime = as.POSIXct(
        "2015-01-01"
      )
    )
  )
)

Request syntax

svc$get_cost_estimate(
  resourceName = "string",
  startTime = as.POSIXct(
    "2015-01-01"
  ),
  endTime = as.POSIXct(
    "2015-01-01"
  )
)