AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.ec2.getDedicatedHost
Explore with Pulumi AI
Use this data source to get information about an EC2 Dedicated Host.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testDedicatedHost = new aws.ec2.DedicatedHost("test", {
instanceType: "c5.18xlarge",
availabilityZone: "us-west-2a",
});
const test = aws.ec2.getDedicatedHostOutput({
hostId: testDedicatedHost.id,
});
import pulumi
import pulumi_aws as aws
test_dedicated_host = aws.ec2.DedicatedHost("test",
instance_type="c5.18xlarge",
availability_zone="us-west-2a")
test = aws.ec2.get_dedicated_host_output(host_id=test_dedicated_host.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 {
testDedicatedHost, err := ec2.NewDedicatedHost(ctx, "test", &ec2.DedicatedHostArgs{
InstanceType: pulumi.String("c5.18xlarge"),
AvailabilityZone: pulumi.String("us-west-2a"),
})
if err != nil {
return err
}
_ = ec2.LookupDedicatedHostOutput(ctx, ec2.GetDedicatedHostOutputArgs{
HostId: testDedicatedHost.ID(),
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var testDedicatedHost = new Aws.Ec2.DedicatedHost("test", new()
{
InstanceType = "c5.18xlarge",
AvailabilityZone = "us-west-2a",
});
var test = Aws.Ec2.GetDedicatedHost.Invoke(new()
{
HostId = testDedicatedHost.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.DedicatedHost;
import com.pulumi.aws.ec2.DedicatedHostArgs;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetDedicatedHostArgs;
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) {
var testDedicatedHost = new DedicatedHost("testDedicatedHost", DedicatedHostArgs.builder()
.instanceType("c5.18xlarge")
.availabilityZone("us-west-2a")
.build());
final var test = Ec2Functions.getDedicatedHost(GetDedicatedHostArgs.builder()
.hostId(testDedicatedHost.id())
.build());
}
}
resources:
testDedicatedHost:
type: aws:ec2:DedicatedHost
name: test
properties:
instanceType: c5.18xlarge
availabilityZone: us-west-2a
variables:
test:
fn::invoke:
Function: aws:ec2:getDedicatedHost
Arguments:
hostId: ${testDedicatedHost.id}
Filter Example
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.ec2.getDedicatedHost({
filters: [{
name: "instance-type",
values: ["c5.18xlarge"],
}],
});
import pulumi
import pulumi_aws as aws
test = aws.ec2.get_dedicated_host(filters=[{
"name": "instance-type",
"values": ["c5.18xlarge"],
}])
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.LookupDedicatedHost(ctx, &ec2.LookupDedicatedHostArgs{
Filters: []ec2.GetDedicatedHostFilter{
{
Name: "instance-type",
Values: []string{
"c5.18xlarge",
},
},
},
}, 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 test = Aws.Ec2.GetDedicatedHost.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetDedicatedHostFilterInputArgs
{
Name = "instance-type",
Values = new[]
{
"c5.18xlarge",
},
},
},
});
});
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.GetDedicatedHostArgs;
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 test = Ec2Functions.getDedicatedHost(GetDedicatedHostArgs.builder()
.filters(GetDedicatedHostFilterArgs.builder()
.name("instance-type")
.values("c5.18xlarge")
.build())
.build());
}
}
variables:
test:
fn::invoke:
Function: aws:ec2:getDedicatedHost
Arguments:
filters:
- name: instance-type
values:
- c5.18xlarge
Using getDedicatedHost
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 getDedicatedHost(args: GetDedicatedHostArgs, opts?: InvokeOptions): Promise<GetDedicatedHostResult>
function getDedicatedHostOutput(args: GetDedicatedHostOutputArgs, opts?: InvokeOptions): Output<GetDedicatedHostResult>
def get_dedicated_host(filters: Optional[Sequence[GetDedicatedHostFilter]] = None,
host_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetDedicatedHostResult
def get_dedicated_host_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDedicatedHostFilterArgs]]]] = None,
host_id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDedicatedHostResult]
func LookupDedicatedHost(ctx *Context, args *LookupDedicatedHostArgs, opts ...InvokeOption) (*LookupDedicatedHostResult, error)
func LookupDedicatedHostOutput(ctx *Context, args *LookupDedicatedHostOutputArgs, opts ...InvokeOption) LookupDedicatedHostResultOutput
> Note: This function is named LookupDedicatedHost
in the Go SDK.
public static class GetDedicatedHost
{
public static Task<GetDedicatedHostResult> InvokeAsync(GetDedicatedHostArgs args, InvokeOptions? opts = null)
public static Output<GetDedicatedHostResult> Invoke(GetDedicatedHostInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDedicatedHostResult> getDedicatedHost(GetDedicatedHostArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2/getDedicatedHost:getDedicatedHost
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Dedicated Host Filter> - Configuration block. Detailed below.
- Host
Id string - ID of the Dedicated Host.
- Dictionary<string, string>
- Filters
[]Get
Dedicated Host Filter - Configuration block. Detailed below.
- Host
Id string - ID of the Dedicated Host.
- map[string]string
- filters
List<Get
Dedicated Host Filter> - Configuration block. Detailed below.
- host
Id String - ID of the Dedicated Host.
- Map<String,String>
- filters
Get
Dedicated Host Filter[] - Configuration block. Detailed below.
- host
Id string - ID of the Dedicated Host.
- {[key: string]: string}
- filters
Sequence[Get
Dedicated Host Filter] - Configuration block. Detailed below.
- host_
id str - ID of the Dedicated Host.
- Mapping[str, str]
- filters List<Property Map>
- Configuration block. Detailed below.
- host
Id String - ID of the Dedicated Host.
- Map<String>
getDedicatedHost Result
The following output properties are available:
- Arn string
- ARN of the Dedicated Host.
- Asset
Id string - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- Auto
Placement string - Whether auto-placement is on or off.
- Availability
Zone string - Availability Zone of the Dedicated Host.
- Cores int
- Number of cores on the Dedicated Host.
- Host
Id string - Host
Recovery string - Whether host recovery is enabled or disabled for the Dedicated Host.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Family string - Instance family supported by the Dedicated Host. For example, "m5".
- Instance
Type string - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- Outpost
Arn string - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- Owner
Id string - ID of the AWS account that owns the Dedicated Host.
- Sockets int
- Number of sockets on the Dedicated Host.
- Dictionary<string, string>
- Total
Vcpus int - Total number of vCPUs on the Dedicated Host.
- Filters
List<Get
Dedicated Host Filter>
- Arn string
- ARN of the Dedicated Host.
- Asset
Id string - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- Auto
Placement string - Whether auto-placement is on or off.
- Availability
Zone string - Availability Zone of the Dedicated Host.
- Cores int
- Number of cores on the Dedicated Host.
- Host
Id string - Host
Recovery string - Whether host recovery is enabled or disabled for the Dedicated Host.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Family string - Instance family supported by the Dedicated Host. For example, "m5".
- Instance
Type string - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- Outpost
Arn string - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- Owner
Id string - ID of the AWS account that owns the Dedicated Host.
- Sockets int
- Number of sockets on the Dedicated Host.
- map[string]string
- Total
Vcpus int - Total number of vCPUs on the Dedicated Host.
- Filters
[]Get
Dedicated Host Filter
- arn String
- ARN of the Dedicated Host.
- asset
Id String - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- auto
Placement String - Whether auto-placement is on or off.
- availability
Zone String - Availability Zone of the Dedicated Host.
- cores Integer
- Number of cores on the Dedicated Host.
- host
Id String - host
Recovery String - Whether host recovery is enabled or disabled for the Dedicated Host.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Family String - Instance family supported by the Dedicated Host. For example, "m5".
- instance
Type String - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- outpost
Arn String - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- owner
Id String - ID of the AWS account that owns the Dedicated Host.
- sockets Integer
- Number of sockets on the Dedicated Host.
- Map<String,String>
- total
Vcpus Integer - Total number of vCPUs on the Dedicated Host.
- filters
List<Get
Dedicated Host Filter>
- arn string
- ARN of the Dedicated Host.
- asset
Id string - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- auto
Placement string - Whether auto-placement is on or off.
- availability
Zone string - Availability Zone of the Dedicated Host.
- cores number
- Number of cores on the Dedicated Host.
- host
Id string - host
Recovery string - Whether host recovery is enabled or disabled for the Dedicated Host.
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Family string - Instance family supported by the Dedicated Host. For example, "m5".
- instance
Type string - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- outpost
Arn string - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- owner
Id string - ID of the AWS account that owns the Dedicated Host.
- sockets number
- Number of sockets on the Dedicated Host.
- {[key: string]: string}
- total
Vcpus number - Total number of vCPUs on the Dedicated Host.
- filters
Get
Dedicated Host Filter[]
- arn str
- ARN of the Dedicated Host.
- asset_
id str - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- auto_
placement str - Whether auto-placement is on or off.
- availability_
zone str - Availability Zone of the Dedicated Host.
- cores int
- Number of cores on the Dedicated Host.
- host_
id str - host_
recovery str - Whether host recovery is enabled or disabled for the Dedicated Host.
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
family str - Instance family supported by the Dedicated Host. For example, "m5".
- instance_
type str - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- outpost_
arn str - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- owner_
id str - ID of the AWS account that owns the Dedicated Host.
- sockets int
- Number of sockets on the Dedicated Host.
- Mapping[str, str]
- total_
vcpus int - Total number of vCPUs on the Dedicated Host.
- filters
Sequence[Get
Dedicated Host Filter]
- arn String
- ARN of the Dedicated Host.
- asset
Id String - The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
- auto
Placement String - Whether auto-placement is on or off.
- availability
Zone String - Availability Zone of the Dedicated Host.
- cores Number
- Number of cores on the Dedicated Host.
- host
Id String - host
Recovery String - Whether host recovery is enabled or disabled for the Dedicated Host.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Family String - Instance family supported by the Dedicated Host. For example, "m5".
- instance
Type String - Instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
- outpost
Arn String - ARN of the AWS Outpost on which the Dedicated Host is allocated.
- owner
Id String - ID of the AWS account that owns the Dedicated Host.
- sockets Number
- Number of sockets on the Dedicated Host.
- Map<String>
- total
Vcpus Number - Total number of vCPUs on the Dedicated Host.
- filters List<Property Map>
Supporting Types
GetDedicatedHostFilter
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values List<string>
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values []string
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
- name string
- Name of the field to filter by, as defined by the underlying AWS API.
- values string[]
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
- name str
- Name of the field to filter by, as defined by the underlying AWS API.
- values Sequence[str]
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. A host will be selected if any one of the given values matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.