github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/batch/getSchedulingPolicy.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package batch 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // The Batch Scheduling Policy data source allows access to details of a specific Scheduling Policy within AWS Batch. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := batch.LookupSchedulingPolicy(ctx, &batch.LookupSchedulingPolicyArgs{ 32 // Arn: "arn:aws:batch:us-east-1:012345678910:scheduling-policy/example", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupSchedulingPolicy(ctx *pulumi.Context, args *LookupSchedulingPolicyArgs, opts ...pulumi.InvokeOption) (*LookupSchedulingPolicyResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupSchedulingPolicyResult 46 err := ctx.Invoke("aws:batch/getSchedulingPolicy:getSchedulingPolicy", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getSchedulingPolicy. 54 type LookupSchedulingPolicyArgs struct { 55 // ARN of the scheduling policy. 56 Arn string `pulumi:"arn"` 57 // Key-value map of resource tags 58 Tags map[string]string `pulumi:"tags"` 59 } 60 61 // A collection of values returned by getSchedulingPolicy. 62 type LookupSchedulingPolicyResult struct { 63 Arn string `pulumi:"arn"` 64 FairSharePolicies []GetSchedulingPolicyFairSharePolicy `pulumi:"fairSharePolicies"` 65 // The provider-assigned unique ID for this managed resource. 66 Id string `pulumi:"id"` 67 // Name of the scheduling policy. 68 Name string `pulumi:"name"` 69 // Key-value map of resource tags 70 Tags map[string]string `pulumi:"tags"` 71 } 72 73 func LookupSchedulingPolicyOutput(ctx *pulumi.Context, args LookupSchedulingPolicyOutputArgs, opts ...pulumi.InvokeOption) LookupSchedulingPolicyResultOutput { 74 return pulumi.ToOutputWithContext(context.Background(), args). 75 ApplyT(func(v interface{}) (LookupSchedulingPolicyResult, error) { 76 args := v.(LookupSchedulingPolicyArgs) 77 r, err := LookupSchedulingPolicy(ctx, &args, opts...) 78 var s LookupSchedulingPolicyResult 79 if r != nil { 80 s = *r 81 } 82 return s, err 83 }).(LookupSchedulingPolicyResultOutput) 84 } 85 86 // A collection of arguments for invoking getSchedulingPolicy. 87 type LookupSchedulingPolicyOutputArgs struct { 88 // ARN of the scheduling policy. 89 Arn pulumi.StringInput `pulumi:"arn"` 90 // Key-value map of resource tags 91 Tags pulumi.StringMapInput `pulumi:"tags"` 92 } 93 94 func (LookupSchedulingPolicyOutputArgs) ElementType() reflect.Type { 95 return reflect.TypeOf((*LookupSchedulingPolicyArgs)(nil)).Elem() 96 } 97 98 // A collection of values returned by getSchedulingPolicy. 99 type LookupSchedulingPolicyResultOutput struct{ *pulumi.OutputState } 100 101 func (LookupSchedulingPolicyResultOutput) ElementType() reflect.Type { 102 return reflect.TypeOf((*LookupSchedulingPolicyResult)(nil)).Elem() 103 } 104 105 func (o LookupSchedulingPolicyResultOutput) ToLookupSchedulingPolicyResultOutput() LookupSchedulingPolicyResultOutput { 106 return o 107 } 108 109 func (o LookupSchedulingPolicyResultOutput) ToLookupSchedulingPolicyResultOutputWithContext(ctx context.Context) LookupSchedulingPolicyResultOutput { 110 return o 111 } 112 113 func (o LookupSchedulingPolicyResultOutput) Arn() pulumi.StringOutput { 114 return o.ApplyT(func(v LookupSchedulingPolicyResult) string { return v.Arn }).(pulumi.StringOutput) 115 } 116 117 func (o LookupSchedulingPolicyResultOutput) FairSharePolicies() GetSchedulingPolicyFairSharePolicyArrayOutput { 118 return o.ApplyT(func(v LookupSchedulingPolicyResult) []GetSchedulingPolicyFairSharePolicy { return v.FairSharePolicies }).(GetSchedulingPolicyFairSharePolicyArrayOutput) 119 } 120 121 // The provider-assigned unique ID for this managed resource. 122 func (o LookupSchedulingPolicyResultOutput) Id() pulumi.StringOutput { 123 return o.ApplyT(func(v LookupSchedulingPolicyResult) string { return v.Id }).(pulumi.StringOutput) 124 } 125 126 // Name of the scheduling policy. 127 func (o LookupSchedulingPolicyResultOutput) Name() pulumi.StringOutput { 128 return o.ApplyT(func(v LookupSchedulingPolicyResult) string { return v.Name }).(pulumi.StringOutput) 129 } 130 131 // Key-value map of resource tags 132 func (o LookupSchedulingPolicyResultOutput) Tags() pulumi.StringMapOutput { 133 return o.ApplyT(func(v LookupSchedulingPolicyResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 134 } 135 136 func init() { 137 pulumi.RegisterOutputType(LookupSchedulingPolicyResultOutput{}) 138 }