1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getInstanceTypeOffering

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi

aws.ec2.getInstanceTypeOffering

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi

    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=[aws.ec2.GetInstanceTypeOfferingFilterArgs(
            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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getInstanceTypeOffering:getInstanceTypeOffering
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetInstanceTypeOfferingFilter>
    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, and region.
    PreferredInstanceTypes List<string>
    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 []GetInstanceTypeOfferingFilter
    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, and region.
    PreferredInstanceTypes []string
    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<GetInstanceTypeOfferingFilter>
    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, and region.
    preferredInstanceTypes List<String>
    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 GetInstanceTypeOfferingFilter[]
    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, and region.
    preferredInstanceTypes string[]
    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[GetInstanceTypeOfferingFilter]
    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, and region.
    preferred_instance_types Sequence[str]
    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, and region.
    preferredInstanceTypes List<String>
    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<GetInstanceTypeOfferingFilter>
    LocationType string
    PreferredInstanceTypes List<string>
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceType string
    EC2 Instance Type.
    Filters []GetInstanceTypeOfferingFilter
    LocationType string
    PreferredInstanceTypes []string
    id String
    The provider-assigned unique ID for this managed resource.
    instanceType String
    EC2 Instance Type.
    filters List<GetInstanceTypeOfferingFilter>
    locationType String
    preferredInstanceTypes List<String>
    id string
    The provider-assigned unique ID for this managed resource.
    instanceType string
    EC2 Instance Type.
    filters GetInstanceTypeOfferingFilter[]
    locationType string
    preferredInstanceTypes string[]
    id str
    The provider-assigned unique ID for this managed resource.
    instance_type str
    EC2 Instance Type.
    filters Sequence[GetInstanceTypeOfferingFilter]
    location_type str
    preferred_instance_types Sequence[str]
    id String
    The provider-assigned unique ID for this managed resource.
    instanceType String
    EC2 Instance Type.
    filters List<Property Map>
    locationType String
    preferredInstanceTypes List<String>

    Supporting Types

    GetInstanceTypeOfferingFilter

    Name string
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    Values List<string>
    List of one or more values for the filter.
    Name string
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    Values []string
    List of one or more values for the filter.
    name String
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    values List<String>
    List of one or more values for the filter.
    name string
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    values string[]
    List of one or more values for the filter.
    name str
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    values Sequence[str]
    List of one or more values for the filter.
    name String
    Name of the filter. The location filter depends on the top-level location_type argument and if not specified, defaults to the current region.
    values List<String>
    List of one or more values for the filter.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.0 published on Monday, Apr 15, 2024 by Pulumi