/
getJobDefinition.go
234 lines (206 loc) · 11.1 KB
/
getJobDefinition.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// 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-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Data source for managing an AWS Batch Job Definition.
//
// ## Example Usage
//
// ### Lookup via Arn
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := batch.LookupJobDefinition(ctx, &batch.LookupJobDefinitionArgs{
// Arn: pulumi.StringRef("arn:aws:batch:us-east-1:012345678910:job-definition/example"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Lookup via Name
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := batch.LookupJobDefinition(ctx, &batch.LookupJobDefinitionArgs{
// Name: pulumi.StringRef("example"),
// Revision: pulumi.IntRef(2),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupJobDefinition(ctx *pulumi.Context, args *LookupJobDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupJobDefinitionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupJobDefinitionResult
err := ctx.Invoke("aws:batch/getJobDefinition:getJobDefinition", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getJobDefinition.
type LookupJobDefinitionArgs struct {
// ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
Arn *string `pulumi:"arn"`
// The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
Name *string `pulumi:"name"`
// The revision of the job definition.
Revision *int `pulumi:"revision"`
// The status of the job definition.
Status *string `pulumi:"status"`
}
// A collection of values returned by getJobDefinition.
type LookupJobDefinitionResult struct {
Arn *string `pulumi:"arn"`
ArnPrefix string `pulumi:"arnPrefix"`
// The orchestration type of the compute environment.
ContainerOrchestrationType string `pulumi:"containerOrchestrationType"`
// An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
EksProperties []GetJobDefinitionEksProperty `pulumi:"eksProperties"`
// The ARN
Id string `pulumi:"id"`
// The name of the volume.
Name *string `pulumi:"name"`
// An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
NodeProperties []GetJobDefinitionNodeProperty `pulumi:"nodeProperties"`
// The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
RetryStrategies []GetJobDefinitionRetryStrategy `pulumi:"retryStrategies"`
Revision *int `pulumi:"revision"`
// The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
SchedulingPriority int `pulumi:"schedulingPriority"`
Status *string `pulumi:"status"`
Tags map[string]string `pulumi:"tags"`
// The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
Timeouts []GetJobDefinitionTimeout `pulumi:"timeouts"`
// The type of resource to assign to a container. The supported resources include `GPU`, `MEMORY`, and `VCPU`.
Type string `pulumi:"type"`
}
func LookupJobDefinitionOutput(ctx *pulumi.Context, args LookupJobDefinitionOutputArgs, opts ...pulumi.InvokeOption) LookupJobDefinitionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupJobDefinitionResult, error) {
args := v.(LookupJobDefinitionArgs)
r, err := LookupJobDefinition(ctx, &args, opts...)
var s LookupJobDefinitionResult
if r != nil {
s = *r
}
return s, err
}).(LookupJobDefinitionResultOutput)
}
// A collection of arguments for invoking getJobDefinition.
type LookupJobDefinitionOutputArgs struct {
// ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
Arn pulumi.StringPtrInput `pulumi:"arn"`
// The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
Name pulumi.StringPtrInput `pulumi:"name"`
// The revision of the job definition.
Revision pulumi.IntPtrInput `pulumi:"revision"`
// The status of the job definition.
Status pulumi.StringPtrInput `pulumi:"status"`
}
func (LookupJobDefinitionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobDefinitionArgs)(nil)).Elem()
}
// A collection of values returned by getJobDefinition.
type LookupJobDefinitionResultOutput struct{ *pulumi.OutputState }
func (LookupJobDefinitionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobDefinitionResult)(nil)).Elem()
}
func (o LookupJobDefinitionResultOutput) ToLookupJobDefinitionResultOutput() LookupJobDefinitionResultOutput {
return o
}
func (o LookupJobDefinitionResultOutput) ToLookupJobDefinitionResultOutputWithContext(ctx context.Context) LookupJobDefinitionResultOutput {
return o
}
func (o LookupJobDefinitionResultOutput) Arn() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) *string { return v.Arn }).(pulumi.StringPtrOutput)
}
func (o LookupJobDefinitionResultOutput) ArnPrefix() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) string { return v.ArnPrefix }).(pulumi.StringOutput)
}
// The orchestration type of the compute environment.
func (o LookupJobDefinitionResultOutput) ContainerOrchestrationType() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) string { return v.ContainerOrchestrationType }).(pulumi.StringOutput)
}
// An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
func (o LookupJobDefinitionResultOutput) EksProperties() GetJobDefinitionEksPropertyArrayOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) []GetJobDefinitionEksProperty { return v.EksProperties }).(GetJobDefinitionEksPropertyArrayOutput)
}
// The ARN
func (o LookupJobDefinitionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of the volume.
func (o LookupJobDefinitionResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
func (o LookupJobDefinitionResultOutput) NodeProperties() GetJobDefinitionNodePropertyArrayOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) []GetJobDefinitionNodeProperty { return v.NodeProperties }).(GetJobDefinitionNodePropertyArrayOutput)
}
// The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
func (o LookupJobDefinitionResultOutput) RetryStrategies() GetJobDefinitionRetryStrategyArrayOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) []GetJobDefinitionRetryStrategy { return v.RetryStrategies }).(GetJobDefinitionRetryStrategyArrayOutput)
}
func (o LookupJobDefinitionResultOutput) Revision() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) *int { return v.Revision }).(pulumi.IntPtrOutput)
}
// The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
func (o LookupJobDefinitionResultOutput) SchedulingPriority() pulumi.IntOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) int { return v.SchedulingPriority }).(pulumi.IntOutput)
}
func (o LookupJobDefinitionResultOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) *string { return v.Status }).(pulumi.StringPtrOutput)
}
func (o LookupJobDefinitionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
func (o LookupJobDefinitionResultOutput) Timeouts() GetJobDefinitionTimeoutArrayOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) []GetJobDefinitionTimeout { return v.Timeouts }).(GetJobDefinitionTimeoutArrayOutput)
}
// The type of resource to assign to a container. The supported resources include `GPU`, `MEMORY`, and `VCPU`.
func (o LookupJobDefinitionResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobDefinitionResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupJobDefinitionResultOutput{})
}