Skip to content

Data Source: awsEc2InstanceTypeOffering

Information about single EC2 Instance Type Offering.

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.dataAwsEc2InstanceTypeOffering.DataAwsEc2InstanceTypeOffering(
  this,
  "example",
  {
    filter: [
      {
        name: "instance-type",
        values: ["t2.micro", "t3.micro"],
      },
    ],
    preferredInstanceTypes: ["t3.micro", "t2.micro"],
  }
);

Argument Reference

The following arguments are supported:

  • filter - (Optional) One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
  • locationType - (Optional) Location type. Defaults to region. Valid values: availabilityZone, availabilityZoneId, and region.
  • preferredInstanceTypes - (Optional) Ordered list of preferred EC2 Instance Types. The first match in this list will be returned. If no preferred matches are found and the original search returned more than one result, an error is returned.

filter Argument Reference

  • name - (Required) Name of the filter. The location filter depends on the top-level locationType argument and if not specified, defaults to the current region.
  • values - (Required) List of one or more values for the filter.

Attribute Reference

In addition to all arguments above, the following attributes are exported:

  • id - EC2 Instance Type.
  • instanceType - EC2 Instance Type.

Timeouts

Configuration options:

  • read - (Default 20M)