/
getJobQueue.go
182 lines (158 loc) · 7.15 KB
/
getJobQueue.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package batch
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Batch Job Queue data source allows access to details of a specific
// job queue within AWS Batch.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/batch"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := batch.LookupJobQueue(ctx, &batch.LookupJobQueueArgs{
// Name: "tf-test-batch-job-queue",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupJobQueue(ctx *pulumi.Context, args *LookupJobQueueArgs, opts ...pulumi.InvokeOption) (*LookupJobQueueResult, error) {
var rv LookupJobQueueResult
err := ctx.Invoke("aws:batch/getJobQueue:getJobQueue", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getJobQueue.
type LookupJobQueueArgs struct {
// Name of the job queue.
Name string `pulumi:"name"`
// Key-value map of resource tags
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getJobQueue.
type LookupJobQueueResult struct {
// ARN of the job queue.
Arn string `pulumi:"arn"`
// The compute environments that are attached to the job queue and the order in
// which job placement is preferred. Compute environments are selected for job placement in ascending order.
// * `compute_environment_order.#.order` - The order of the compute environment.
// * `compute_environment_order.#.compute_environment` - The ARN of the compute environment.
ComputeEnvironmentOrders []GetJobQueueComputeEnvironmentOrder `pulumi:"computeEnvironmentOrders"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// Priority of the job queue. Job queues with a higher priority are evaluated first when
// associated with the same compute environment.
Priority int `pulumi:"priority"`
// The ARN of the fair share scheduling policy. If this attribute has a value, the job queue uses a fair share scheduling policy. If this attribute does not have a value, the job queue uses a first in, first out (FIFO) scheduling policy.
SchedulingPolicyArn string `pulumi:"schedulingPolicyArn"`
// Describes the ability of the queue to accept new jobs (for example, `ENABLED` or `DISABLED`).
State string `pulumi:"state"`
// Current status of the job queue (for example, `CREATING` or `VALID`).
Status string `pulumi:"status"`
// Short, human-readable string to provide additional details about the current status
// of the job queue.
StatusReason string `pulumi:"statusReason"`
// Key-value map of resource tags
Tags map[string]string `pulumi:"tags"`
}
func LookupJobQueueOutput(ctx *pulumi.Context, args LookupJobQueueOutputArgs, opts ...pulumi.InvokeOption) LookupJobQueueResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupJobQueueResult, error) {
args := v.(LookupJobQueueArgs)
r, err := LookupJobQueue(ctx, &args, opts...)
var s LookupJobQueueResult
if r != nil {
s = *r
}
return s, err
}).(LookupJobQueueResultOutput)
}
// A collection of arguments for invoking getJobQueue.
type LookupJobQueueOutputArgs struct {
// Name of the job queue.
Name pulumi.StringInput `pulumi:"name"`
// Key-value map of resource tags
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupJobQueueOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobQueueArgs)(nil)).Elem()
}
// A collection of values returned by getJobQueue.
type LookupJobQueueResultOutput struct{ *pulumi.OutputState }
func (LookupJobQueueResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobQueueResult)(nil)).Elem()
}
func (o LookupJobQueueResultOutput) ToLookupJobQueueResultOutput() LookupJobQueueResultOutput {
return o
}
func (o LookupJobQueueResultOutput) ToLookupJobQueueResultOutputWithContext(ctx context.Context) LookupJobQueueResultOutput {
return o
}
// ARN of the job queue.
func (o LookupJobQueueResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The compute environments that are attached to the job queue and the order in
// which job placement is preferred. Compute environments are selected for job placement in ascending order.
// * `compute_environment_order.#.order` - The order of the compute environment.
// * `compute_environment_order.#.compute_environment` - The ARN of the compute environment.
func (o LookupJobQueueResultOutput) ComputeEnvironmentOrders() GetJobQueueComputeEnvironmentOrderArrayOutput {
return o.ApplyT(func(v LookupJobQueueResult) []GetJobQueueComputeEnvironmentOrder { return v.ComputeEnvironmentOrders }).(GetJobQueueComputeEnvironmentOrderArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupJobQueueResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupJobQueueResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.Name }).(pulumi.StringOutput)
}
// Priority of the job queue. Job queues with a higher priority are evaluated first when
// associated with the same compute environment.
func (o LookupJobQueueResultOutput) Priority() pulumi.IntOutput {
return o.ApplyT(func(v LookupJobQueueResult) int { return v.Priority }).(pulumi.IntOutput)
}
// The ARN of the fair share scheduling policy. If this attribute has a value, the job queue uses a fair share scheduling policy. If this attribute does not have a value, the job queue uses a first in, first out (FIFO) scheduling policy.
func (o LookupJobQueueResultOutput) SchedulingPolicyArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.SchedulingPolicyArn }).(pulumi.StringOutput)
}
// Describes the ability of the queue to accept new jobs (for example, `ENABLED` or `DISABLED`).
func (o LookupJobQueueResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.State }).(pulumi.StringOutput)
}
// Current status of the job queue (for example, `CREATING` or `VALID`).
func (o LookupJobQueueResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.Status }).(pulumi.StringOutput)
}
// Short, human-readable string to provide additional details about the current status
// of the job queue.
func (o LookupJobQueueResultOutput) StatusReason() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobQueueResult) string { return v.StatusReason }).(pulumi.StringOutput)
}
// Key-value map of resource tags
func (o LookupJobQueueResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupJobQueueResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupJobQueueResultOutput{})
}