-
Notifications
You must be signed in to change notification settings - Fork 151
/
getDedicatedHost.go
198 lines (170 loc) · 7.62 KB
/
getDedicatedHost.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get information about an EC2 Dedicated Host.
//
// ## Example Usage
// ### Filter Example
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/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{
// ec2.GetDedicatedHostFilter{
// Name: "instance-type",
// Values: []string{
// "c5.18xlarge",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupDedicatedHost(ctx *pulumi.Context, args *LookupDedicatedHostArgs, opts ...pulumi.InvokeOption) (*LookupDedicatedHostResult, error) {
var rv LookupDedicatedHostResult
err := ctx.Invoke("aws:ec2/getDedicatedHost:getDedicatedHost", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDedicatedHost.
type LookupDedicatedHostArgs struct {
// Configuration block. Detailed below.
Filters []GetDedicatedHostFilter `pulumi:"filters"`
// The ID of the Dedicated Host.
HostId *string `pulumi:"hostId"`
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getDedicatedHost.
type LookupDedicatedHostResult struct {
// The ARN of the Dedicated Host.
Arn string `pulumi:"arn"`
// Whether auto-placement is on or off.
AutoPlacement string `pulumi:"autoPlacement"`
// The Availability Zone of the Dedicated Host.
AvailabilityZone string `pulumi:"availabilityZone"`
// The number of cores on the Dedicated Host.
Cores int `pulumi:"cores"`
Filters []GetDedicatedHostFilter `pulumi:"filters"`
HostId string `pulumi:"hostId"`
// Indicates whether host recovery is enabled or disabled for the Dedicated Host.
HostRecovery string `pulumi:"hostRecovery"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The instance family supported by the Dedicated Host. For example, "m5".
InstanceFamily string `pulumi:"instanceFamily"`
// The instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
InstanceType string `pulumi:"instanceType"`
// The ID of the AWS account that owns the Dedicated Host.
OwnerId string `pulumi:"ownerId"`
// The number of sockets on the Dedicated Host.
Sockets int `pulumi:"sockets"`
Tags map[string]string `pulumi:"tags"`
// The total number of vCPUs on the Dedicated Host.
TotalVcpus int `pulumi:"totalVcpus"`
}
func LookupDedicatedHostOutput(ctx *pulumi.Context, args LookupDedicatedHostOutputArgs, opts ...pulumi.InvokeOption) LookupDedicatedHostResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDedicatedHostResult, error) {
args := v.(LookupDedicatedHostArgs)
r, err := LookupDedicatedHost(ctx, &args, opts...)
return *r, err
}).(LookupDedicatedHostResultOutput)
}
// A collection of arguments for invoking getDedicatedHost.
type LookupDedicatedHostOutputArgs struct {
// Configuration block. Detailed below.
Filters GetDedicatedHostFilterArrayInput `pulumi:"filters"`
// The ID of the Dedicated Host.
HostId pulumi.StringPtrInput `pulumi:"hostId"`
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupDedicatedHostOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDedicatedHostArgs)(nil)).Elem()
}
// A collection of values returned by getDedicatedHost.
type LookupDedicatedHostResultOutput struct{ *pulumi.OutputState }
func (LookupDedicatedHostResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDedicatedHostResult)(nil)).Elem()
}
func (o LookupDedicatedHostResultOutput) ToLookupDedicatedHostResultOutput() LookupDedicatedHostResultOutput {
return o
}
func (o LookupDedicatedHostResultOutput) ToLookupDedicatedHostResultOutputWithContext(ctx context.Context) LookupDedicatedHostResultOutput {
return o
}
// The ARN of the Dedicated Host.
func (o LookupDedicatedHostResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.Arn }).(pulumi.StringOutput)
}
// Whether auto-placement is on or off.
func (o LookupDedicatedHostResultOutput) AutoPlacement() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.AutoPlacement }).(pulumi.StringOutput)
}
// The Availability Zone of the Dedicated Host.
func (o LookupDedicatedHostResultOutput) AvailabilityZone() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.AvailabilityZone }).(pulumi.StringOutput)
}
// The number of cores on the Dedicated Host.
func (o LookupDedicatedHostResultOutput) Cores() pulumi.IntOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) int { return v.Cores }).(pulumi.IntOutput)
}
func (o LookupDedicatedHostResultOutput) Filters() GetDedicatedHostFilterArrayOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) []GetDedicatedHostFilter { return v.Filters }).(GetDedicatedHostFilterArrayOutput)
}
func (o LookupDedicatedHostResultOutput) HostId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.HostId }).(pulumi.StringOutput)
}
// Indicates whether host recovery is enabled or disabled for the Dedicated Host.
func (o LookupDedicatedHostResultOutput) HostRecovery() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.HostRecovery }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDedicatedHostResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.Id }).(pulumi.StringOutput)
}
// The instance family supported by the Dedicated Host. For example, "m5".
func (o LookupDedicatedHostResultOutput) InstanceFamily() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.InstanceFamily }).(pulumi.StringOutput)
}
// The instance type supported by the Dedicated Host. For example, "m5.large". If the host supports multiple instance types, no instanceType is returned.
func (o LookupDedicatedHostResultOutput) InstanceType() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.InstanceType }).(pulumi.StringOutput)
}
// The ID of the AWS account that owns the Dedicated Host.
func (o LookupDedicatedHostResultOutput) OwnerId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) string { return v.OwnerId }).(pulumi.StringOutput)
}
// The number of sockets on the Dedicated Host.
func (o LookupDedicatedHostResultOutput) Sockets() pulumi.IntOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) int { return v.Sockets }).(pulumi.IntOutput)
}
func (o LookupDedicatedHostResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The total number of vCPUs on the Dedicated Host.
func (o LookupDedicatedHostResultOutput) TotalVcpus() pulumi.IntOutput {
return o.ApplyT(func(v LookupDedicatedHostResult) int { return v.TotalVcpus }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDedicatedHostResultOutput{})
}