1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. getInstanceTypeOfferings
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2.getInstanceTypeOfferings

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Information about EC2 Instance Type Offerings.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2.getInstanceTypeOfferings({
        filters: [
            {
                name: "instance-type",
                values: [
                    "t2.micro",
                    "t3.micro",
                ],
            },
            {
                name: "location",
                values: ["usw2-az4"],
            },
        ],
        locationType: "availability-zone-id",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.get_instance_type_offerings(filters=[
            {
                "name": "instance-type",
                "values": [
                    "t2.micro",
                    "t3.micro",
                ],
            },
            {
                "name": "location",
                "values": ["usw2-az4"],
            },
        ],
        location_type="availability-zone-id")
    
    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.GetInstanceTypeOfferings(ctx, &ec2.GetInstanceTypeOfferingsArgs{
    			Filters: []ec2.GetInstanceTypeOfferingsFilter{
    				{
    					Name: "instance-type",
    					Values: []string{
    						"t2.micro",
    						"t3.micro",
    					},
    				},
    				{
    					Name: "location",
    					Values: []string{
    						"usw2-az4",
    					},
    				},
    			},
    			LocationType: pulumi.StringRef("availability-zone-id"),
    		}, 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.GetInstanceTypeOfferings.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2.Inputs.GetInstanceTypeOfferingsFilterInputArgs
                {
                    Name = "instance-type",
                    Values = new[]
                    {
                        "t2.micro",
                        "t3.micro",
                    },
                },
                new Aws.Ec2.Inputs.GetInstanceTypeOfferingsFilterInputArgs
                {
                    Name = "location",
                    Values = new[]
                    {
                        "usw2-az4",
                    },
                },
            },
            LocationType = "availability-zone-id",
        });
    
    });
    
    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.GetInstanceTypeOfferingsArgs;
    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.getInstanceTypeOfferings(GetInstanceTypeOfferingsArgs.builder()
                .filters(            
                    GetInstanceTypeOfferingsFilterArgs.builder()
                        .name("instance-type")
                        .values(                    
                            "t2.micro",
                            "t3.micro")
                        .build(),
                    GetInstanceTypeOfferingsFilterArgs.builder()
                        .name("location")
                        .values("usw2-az4")
                        .build())
                .locationType("availability-zone-id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2:getInstanceTypeOfferings
          Arguments:
            filters:
              - name: instance-type
                values:
                  - t2.micro
                  - t3.micro
              - name: location
                values:
                  - usw2-az4
            locationType: availability-zone-id
    

    Using getInstanceTypeOfferings

    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 getInstanceTypeOfferings(args: GetInstanceTypeOfferingsArgs, opts?: InvokeOptions): Promise<GetInstanceTypeOfferingsResult>
    function getInstanceTypeOfferingsOutput(args: GetInstanceTypeOfferingsOutputArgs, opts?: InvokeOptions): Output<GetInstanceTypeOfferingsResult>
    def get_instance_type_offerings(filters: Optional[Sequence[GetInstanceTypeOfferingsFilter]] = None,
                                    location_type: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetInstanceTypeOfferingsResult
    def get_instance_type_offerings_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceTypeOfferingsFilterArgs]]]] = None,
                                    location_type: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetInstanceTypeOfferingsResult]
    func GetInstanceTypeOfferings(ctx *Context, args *GetInstanceTypeOfferingsArgs, opts ...InvokeOption) (*GetInstanceTypeOfferingsResult, error)
    func GetInstanceTypeOfferingsOutput(ctx *Context, args *GetInstanceTypeOfferingsOutputArgs, opts ...InvokeOption) GetInstanceTypeOfferingsResultOutput

    > Note: This function is named GetInstanceTypeOfferings in the Go SDK.

    public static class GetInstanceTypeOfferings 
    {
        public static Task<GetInstanceTypeOfferingsResult> InvokeAsync(GetInstanceTypeOfferingsArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceTypeOfferingsResult> Invoke(GetInstanceTypeOfferingsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceTypeOfferingsResult> getInstanceTypeOfferings(GetInstanceTypeOfferingsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getInstanceTypeOfferings:getInstanceTypeOfferings
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetInstanceTypeOfferingsFilter>
    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.
    Filters []GetInstanceTypeOfferingsFilter
    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.
    filters List<GetInstanceTypeOfferingsFilter>
    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.
    filters GetInstanceTypeOfferingsFilter[]
    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.
    filters Sequence[GetInstanceTypeOfferingsFilter]
    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.
    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.

    getInstanceTypeOfferings Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceTypes List<string>
    List of EC2 Instance Types.
    LocationTypes List<string>
    List of location types.
    Locations List<string>
    List of locations.
    Filters List<GetInstanceTypeOfferingsFilter>
    LocationType string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceTypes []string
    List of EC2 Instance Types.
    LocationTypes []string
    List of location types.
    Locations []string
    List of locations.
    Filters []GetInstanceTypeOfferingsFilter
    LocationType string
    id String
    The provider-assigned unique ID for this managed resource.
    instanceTypes List<String>
    List of EC2 Instance Types.
    locationTypes List<String>
    List of location types.
    locations List<String>
    List of locations.
    filters List<GetInstanceTypeOfferingsFilter>
    locationType String
    id string
    The provider-assigned unique ID for this managed resource.
    instanceTypes string[]
    List of EC2 Instance Types.
    locationTypes string[]
    List of location types.
    locations string[]
    List of locations.
    filters GetInstanceTypeOfferingsFilter[]
    locationType string
    id str
    The provider-assigned unique ID for this managed resource.
    instance_types Sequence[str]
    List of EC2 Instance Types.
    location_types Sequence[str]
    List of location types.
    locations Sequence[str]
    List of locations.
    filters Sequence[GetInstanceTypeOfferingsFilter]
    location_type str
    id String
    The provider-assigned unique ID for this managed resource.
    instanceTypes List<String>
    List of EC2 Instance Types.
    locationTypes List<String>
    List of location types.
    locations List<String>
    List of locations.
    filters List<Property Map>
    locationType String

    Supporting Types

    GetInstanceTypeOfferingsFilter

    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
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi