AWS v6.60.0 published on Tuesday, Nov 19, 2024 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)
// 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<Get
Instance Type Offering Filter> - One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- Location
Type string - Location type. Defaults to
region
. Valid values:availability-zone
,availability-zone-id
, andregion
. - Preferred
Instance 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
[]Get
Instance Type Offering Filter - One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- Location
Type string - Location type. Defaults to
region
. Valid values:availability-zone
,availability-zone-id
, andregion
. - Preferred
Instance []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<Get
Instance Type Offering Filter> - One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- location
Type String - Location type. Defaults to
region
. Valid values:availability-zone
,availability-zone-id
, andregion
. - preferred
Instance 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
Get
Instance Type Offering Filter[] - One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- location
Type string - Location type. Defaults to
region
. Valid values:availability-zone
,availability-zone-id
, andregion
. - preferred
Instance 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[Get
Instance 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.
- location
Type String - Location type. Defaults to
region
. Valid values:availability-zone
,availability-zone-id
, andregion
. - preferred
Instance 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.
- Instance
Type string - EC2 Instance Type.
- Filters
List<Get
Instance Type Offering Filter> - Location
Type string - Preferred
Instance List<string>Types
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Type string - EC2 Instance Type.
- Filters
[]Get
Instance Type Offering Filter - Location
Type string - Preferred
Instance []stringTypes
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Type String - EC2 Instance Type.
- filters
List<Get
Instance Type Offering Filter> - location
Type String - preferred
Instance List<String>Types
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Type string - EC2 Instance Type.
- filters
Get
Instance Type Offering Filter[] - location
Type string - preferred
Instance string[]Types
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
type str - EC2 Instance Type.
- filters
Sequence[Get
Instance Type Offering Filter] - location_
type str - preferred_
instance_ Sequence[str]types
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Type String - EC2 Instance Type.
- filters List<Property Map>
- location
Type String - preferred
Instance 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
aws
Terraform Provider.