Module pricing

@pulumi/aws > pricing

function getProduct

getProduct(args: GetProductArgs, opts?: pulumi.InvokeOptions): Promise<GetProductResult>

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.pricing.getProduct({
    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",
        },
    ],
    serviceCode: "AmazonEC2",
}));
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.pricing.getProduct({
    filters: [
        {
            field: "instanceType",
            value: "ds1.xlarge",
        },
        {
            field: "location",
            value: "US East (N. Virginia)",
        },
    ],
    serviceCode: "AmazonRedshift",
}));

interface GetProductArgs

A collection of arguments for invoking getProduct.

property filters

filters: {
    field: string;
    value: string;
}[];

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.

property serviceCode

serviceCode: string;

The code of the service. Available service codes can be fetched using the DescribeServices pricing API call.

interface GetProductResult

A collection of values returned by getProduct.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property result

result: string;

Set to the product returned from the API.