Skip to content

Data Source: awsPricingProduct

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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsPricingProduct.DataAwsPricingProduct(this, "example", {
  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",
    },
    {
      field: "capacitystatus",
      value: "Used",
    },
  ],
  serviceCode: "AmazonEC2",
});
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsPricingProduct.DataAwsPricingProduct(this, "example", {
  filters: [
    {
      field: "instanceType",
      value: "ds1.xlarge",
    },
    {
      field: "location",
      value: "US East (N. Virginia)",
    },
  ],
  serviceCode: "AmazonRedshift",
});

Argument Reference

  • serviceCode - (Required) Code of the service. Available service codes can be fetched using the DescribeServices pricing API call.
  • filters - (Required) 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) Product attribute name that you want to filter on.
  • value (Required) Product attribute value that you want to filter on.

Attributes Reference

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