AWS Classic
getInstanceTypes
Information about EC2 Instance Types.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var test = Output.Create(Aws.Ec2.GetInstanceTypes.InvokeAsync(new Aws.Ec2.GetInstanceTypesArgs
{
Filters =
{
new Aws.Ec2.Inputs.GetInstanceTypesFilterArgs
{
Name = "auto-recovery-supported",
Values =
{
"true",
},
},
new Aws.Ec2.Inputs.GetInstanceTypesFilterArgs
{
Name = "network-info.encryption-in-transit-supported",
Values =
{
"true",
},
},
new Aws.Ec2.Inputs.GetInstanceTypesFilterArgs
{
Name = "instance-storage-supported",
Values =
{
"true",
},
},
new Aws.Ec2.Inputs.GetInstanceTypesFilterArgs
{
Name = "instance-type",
Values =
{
"g5.2xlarge",
"g5.4xlarge",
},
},
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.GetInstanceTypes(ctx, &ec2.GetInstanceTypesArgs{
Filters: []ec2.GetInstanceTypesFilter{
ec2.GetInstanceTypesFilter{
Name: "auto-recovery-supported",
Values: []string{
"true",
},
},
ec2.GetInstanceTypesFilter{
Name: "network-info.encryption-in-transit-supported",
Values: []string{
"true",
},
},
ec2.GetInstanceTypesFilter{
Name: "instance-storage-supported",
Values: []string{
"true",
},
},
ec2.GetInstanceTypesFilter{
Name: "instance-type",
Values: []string{
"g5.2xlarge",
"g5.4xlarge",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var test = Output.of(Ec2Functions.getInstanceTypes(GetInstanceTypesArgs.builder()
.filters(
GetInstanceTypesFilterArgs.builder()
.name("auto-recovery-supported")
.values("true")
.build(),
GetInstanceTypesFilterArgs.builder()
.name("network-info.encryption-in-transit-supported")
.values("true")
.build(),
GetInstanceTypesFilterArgs.builder()
.name("instance-storage-supported")
.values("true")
.build(),
GetInstanceTypesFilterArgs.builder()
.name("instance-type")
.values(
"g5.2xlarge",
"g5.4xlarge")
.build())
.build()));
}
}
import pulumi
import pulumi_aws as aws
test = aws.ec2.get_instance_types(filters=[
aws.ec2.GetInstanceTypesFilterArgs(
name="auto-recovery-supported",
values=["true"],
),
aws.ec2.GetInstanceTypesFilterArgs(
name="network-info.encryption-in-transit-supported",
values=["true"],
),
aws.ec2.GetInstanceTypesFilterArgs(
name="instance-storage-supported",
values=["true"],
),
aws.ec2.GetInstanceTypesFilterArgs(
name="instance-type",
values=[
"g5.2xlarge",
"g5.4xlarge",
],
),
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = pulumi.output(aws.ec2.getInstanceTypes({
filters: [
{
name: "auto-recovery-supported",
values: ["true"],
},
{
name: "network-info.encryption-in-transit-supported",
values: ["true"],
},
{
name: "instance-storage-supported",
values: ["true"],
},
{
name: "instance-type",
values: [
"g5.2xlarge",
"g5.4xlarge",
],
},
],
}));
variables:
test:
Fn::Invoke:
Function: aws:ec2:getInstanceTypes
Arguments:
filters:
- name: auto-recovery-supported
values:
- true
- name: network-info.encryption-in-transit-supported
values:
- true
- name: instance-storage-supported
values:
- true
- name: instance-type
values:
- g5.2xlarge
- g5.4xlarge
Using getInstanceTypes
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 getInstanceTypes(args: GetInstanceTypesArgs, opts?: InvokeOptions): Promise<GetInstanceTypesResult>
function getInstanceTypesOutput(args: GetInstanceTypesOutputArgs, opts?: InvokeOptions): Output<GetInstanceTypesResult>
def get_instance_types(filters: Optional[Sequence[GetInstanceTypesFilter]] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceTypesResult
def get_instance_types_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceTypesFilterArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceTypesResult]
func GetInstanceTypes(ctx *Context, args *GetInstanceTypesArgs, opts ...InvokeOption) (*GetInstanceTypesResult, error)
func GetInstanceTypesOutput(ctx *Context, args *GetInstanceTypesOutputArgs, opts ...InvokeOption) GetInstanceTypesResultOutput
> Note: This function is named GetInstanceTypes
in the Go SDK.
public static class GetInstanceTypes
{
public static Task<GetInstanceTypesResult> InvokeAsync(GetInstanceTypesArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceTypesResult> Invoke(GetInstanceTypesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceTypesResult> getInstanceTypes(GetInstanceTypesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: aws:ec2/getInstanceTypes:getInstanceTypes
Arguments:
# Arguments dictionary
The following arguments are supported:
- Filters
List<Pulumi.
Aws. Ec2. Inputs. Get Instance Types Filter> One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- Filters
[]Get
Instance Types Filter One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- filters
List<Get
Instance Types Filter> One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- filters
Get
Instance Types Filter[] One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- filters
Sequence[Get
Instance Types Filter] One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
- filters List<Property Map>
One or more configuration blocks containing name-values filters. See the EC2 API Reference for supported filters. Detailed below.
getInstanceTypes Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Types List<string> List of EC2 Instance Types.
- Filters
List<Pulumi.
Aws. Ec2. Outputs. Get Instance Types Filter>
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Types []string List of EC2 Instance Types.
- Filters
[]Get
Instance Types Filter
- id String
The provider-assigned unique ID for this managed resource.
- instance
Types List<String> List of EC2 Instance Types.
- filters
List<Get
Instance Types Filter>
- id string
The provider-assigned unique ID for this managed resource.
- instance
Types string[] List of EC2 Instance Types.
- filters
Get
Instance Types Filter[]
- id str
The provider-assigned unique ID for this managed resource.
- instance_
types Sequence[str] List of EC2 Instance Types.
- filters
Sequence[Get
Instance Types Filter]
- id String
The provider-assigned unique ID for this managed resource.
- instance
Types List<String> List of EC2 Instance Types.
- filters List<Property Map>
Supporting Types
GetInstanceTypesFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.