Data Source: aws_pricing_product

Use this data source to get the pricing information of all products in AWS. This data source is only available in a us-east-1 or ap-south-1 provider.

Example Usage

data "aws_pricing_product" "example" {
    service_code = "AmazonEC2"

    filters = [
        {
        field = "instanceType"
        value = "c5.xlarge"
        },
        {
        field = "operatingSystem"
        value = "Linux"
        },
        {
        field = "location"
        value = "US East (N. Virginia)"
        },
        {
        field = "preInstalledSw"
        value = "NA"
        },
        {
        field = "licenseModel"
        value = "No License required"
        },
        {
        field = "tenancy"
        value = "Shared"
        },
    ]
}
data "aws_pricing_product" "example" {
    service_code = "AmazonRedshift"

    filters = [
        {
        field = "instanceType"
        value = "ds1.xlarge"
        },
        {
        field = "location"
        value = "US East (N. Virginia)"
        },
    ]
}

Argument Reference

  • service_code - (Required) The code of the service. Available service codes can be fetched using the DescribeServices pricing API call.
  • filters - (Required) A list of filters. Passed directly to the API (see GetProducts API reference). These filters must describe a single product, this resource will fail if more than one product is returned by the API.

filters

  • field (Required) The product attribute name that you want to filter on.
  • value (Required) The product attribute value that you want to filter on.

Attributes Reference

  • result - Set to the product returned from the API.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/pricing_product.html