AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.ec2.getInstanceTypeOffering
Explore with Pulumi AI
Information about single EC2 Instance Type Offering.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2.getInstanceTypeOffering({
    filters: [{
        name: "instance-type",
        values: [
            "t2.micro",
            "t3.micro",
        ],
    }],
    preferredInstanceTypes: [
        "t3.micro",
        "t2.micro",
    ],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.get_instance_type_offering(filters=[{
        "name": "instance-type",
        "values": [
            "t2.micro",
            "t3.micro",
        ],
    }],
    preferred_instance_types=[
        "t3.micro",
        "t2.micro",
    ])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.GetInstanceTypeOffering(ctx, &ec2.GetInstanceTypeOfferingArgs{
			Filters: []ec2.GetInstanceTypeOfferingFilter{
				{
					Name: "instance-type",
					Values: []string{
						"t2.micro",
						"t3.micro",
					},
				},
			},
			PreferredInstanceTypes: []string{
				"t3.micro",
				"t2.micro",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = Aws.Ec2.GetInstanceTypeOffering.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2.Inputs.GetInstanceTypeOfferingFilterInputArgs
            {
                Name = "instance-type",
                Values = new[]
                {
                    "t2.micro",
                    "t3.micro",
                },
            },
        },
        PreferredInstanceTypes = new[]
        {
            "t3.micro",
            "t2.micro",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetInstanceTypeOfferingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = Ec2Functions.getInstanceTypeOffering(GetInstanceTypeOfferingArgs.builder()
            .filters(GetInstanceTypeOfferingFilterArgs.builder()
                .name("instance-type")
                .values(                
                    "t2.micro",
                    "t3.micro")
                .build())
            .preferredInstanceTypes(            
                "t3.micro",
                "t2.micro")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2:getInstanceTypeOffering
      arguments:
        filters:
          - name: instance-type
            values:
              - t2.micro
              - t3.micro
        preferredInstanceTypes:
          - t3.micro
          - t2.micro
Using getInstanceTypeOffering
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInstanceTypeOffering(args: GetInstanceTypeOfferingArgs, opts?: InvokeOptions): Promise<GetInstanceTypeOfferingResult>
function getInstanceTypeOfferingOutput(args: GetInstanceTypeOfferingOutputArgs, opts?: InvokeOptions): Output<GetInstanceTypeOfferingResult>def get_instance_type_offering(filters: Optional[Sequence[GetInstanceTypeOfferingFilter]] = None,
                               location_type: Optional[str] = None,
                               preferred_instance_types: Optional[Sequence[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetInstanceTypeOfferingResult
def get_instance_type_offering_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceTypeOfferingFilterArgs]]]] = None,
                               location_type: Optional[pulumi.Input[str]] = None,
                               preferred_instance_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetInstanceTypeOfferingResult]func GetInstanceTypeOffering(ctx *Context, args *GetInstanceTypeOfferingArgs, opts ...InvokeOption) (*GetInstanceTypeOfferingResult, error)
func GetInstanceTypeOfferingOutput(ctx *Context, args *GetInstanceTypeOfferingOutputArgs, opts ...InvokeOption) GetInstanceTypeOfferingResultOutput> Note: This function is named GetInstanceTypeOffering in the Go SDK.
public static class GetInstanceTypeOffering 
{
    public static Task<GetInstanceTypeOfferingResult> InvokeAsync(GetInstanceTypeOfferingArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceTypeOfferingResult> Invoke(GetInstanceTypeOfferingInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInstanceTypeOfferingResult> getInstanceTypeOffering(GetInstanceTypeOfferingArgs args, InvokeOptions options)
public static Output<GetInstanceTypeOfferingResult> getInstanceTypeOffering(GetInstanceTypeOfferingArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2/getInstanceTypeOffering:getInstanceTypeOffering
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetInstance Type Offering Filter> 
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- LocationType string
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- PreferredInstance List<string>Types 
- 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.
- Filters
[]GetInstance Type Offering Filter 
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- LocationType string
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- PreferredInstance []stringTypes 
- 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.
- filters
List<GetInstance Type Offering Filter> 
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- locationType String
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- preferredInstance List<String>Types 
- 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.
- filters
GetInstance Type Offering Filter[] 
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- locationType string
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- preferredInstance string[]Types 
- 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.
- filters
Sequence[GetInstance Type Offering Filter] 
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- location_type str
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- preferred_instance_ Sequence[str]types 
- 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.
- filters List<Property Map>
- One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- locationType String
- Location type. Defaults to region. Valid values:availability-zone,availability-zone-id, andregion.
- preferredInstance List<String>Types 
- 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.
getInstanceTypeOffering Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- InstanceType string
- EC2 Instance Type.
- Filters
List<GetInstance Type Offering Filter> 
- LocationType string
- PreferredInstance List<string>Types 
- Id string
- The provider-assigned unique ID for this managed resource.
- InstanceType string
- EC2 Instance Type.
- Filters
[]GetInstance Type Offering Filter 
- LocationType string
- PreferredInstance []stringTypes 
- id String
- The provider-assigned unique ID for this managed resource.
- instanceType String
- EC2 Instance Type.
- filters
List<GetInstance Type Offering Filter> 
- locationType String
- preferredInstance List<String>Types 
- id string
- The provider-assigned unique ID for this managed resource.
- instanceType string
- EC2 Instance Type.
- filters
GetInstance Type Offering Filter[] 
- locationType string
- preferredInstance string[]Types 
- id str
- The provider-assigned unique ID for this managed resource.
- instance_type str
- EC2 Instance Type.
- filters
Sequence[GetInstance Type Offering Filter] 
- location_type str
- preferred_instance_ Sequence[str]types 
- id String
- The provider-assigned unique ID for this managed resource.
- instanceType String
- EC2 Instance Type.
- filters List<Property Map>
- locationType String
- preferredInstance List<String>Types 
Supporting Types
GetInstanceTypeOfferingFilter    
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.