github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/batch/getJobQueue.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 Job Queue data source allows access to details of a specific
    15  // job queue within AWS Batch.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := batch.LookupJobQueue(ctx, &batch.LookupJobQueueArgs{
    33  //				Name: "tf-test-batch-job-queue",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  func LookupJobQueue(ctx *pulumi.Context, args *LookupJobQueueArgs, opts ...pulumi.InvokeOption) (*LookupJobQueueResult, error) {
    45  	opts = internal.PkgInvokeDefaultOpts(opts)
    46  	var rv LookupJobQueueResult
    47  	err := ctx.Invoke("aws:batch/getJobQueue:getJobQueue", args, &rv, opts...)
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return &rv, nil
    52  }
    53  
    54  // A collection of arguments for invoking getJobQueue.
    55  type LookupJobQueueArgs struct {
    56  	// Name of the job queue.
    57  	Name string `pulumi:"name"`
    58  	// Key-value map of resource tags
    59  	Tags map[string]string `pulumi:"tags"`
    60  }
    61  
    62  // A collection of values returned by getJobQueue.
    63  type LookupJobQueueResult struct {
    64  	// ARN of the job queue.
    65  	Arn string `pulumi:"arn"`
    66  	// The compute environments that are attached to the job queue and the order in
    67  	// which job placement is preferred. Compute environments are selected for job placement in ascending order.
    68  	// * `compute_environment_order.#.order` - The order of the compute environment.
    69  	// * `compute_environment_order.#.compute_environment` - The ARN of the compute environment.
    70  	ComputeEnvironmentOrders []GetJobQueueComputeEnvironmentOrder `pulumi:"computeEnvironmentOrders"`
    71  	// The provider-assigned unique ID for this managed resource.
    72  	Id   string `pulumi:"id"`
    73  	Name string `pulumi:"name"`
    74  	// Priority of the job queue. Job queues with a higher priority are evaluated first when
    75  	// associated with the same compute environment.
    76  	Priority int `pulumi:"priority"`
    77  	// 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.
    78  	SchedulingPolicyArn string `pulumi:"schedulingPolicyArn"`
    79  	// Describes the ability of the queue to accept new jobs (for example, `ENABLED` or `DISABLED`).
    80  	State string `pulumi:"state"`
    81  	// Current status of the job queue (for example, `CREATING` or `VALID`).
    82  	Status string `pulumi:"status"`
    83  	// Short, human-readable string to provide additional details about the current status
    84  	// of the job queue.
    85  	StatusReason string `pulumi:"statusReason"`
    86  	// Key-value map of resource tags
    87  	Tags map[string]string `pulumi:"tags"`
    88  }
    89  
    90  func LookupJobQueueOutput(ctx *pulumi.Context, args LookupJobQueueOutputArgs, opts ...pulumi.InvokeOption) LookupJobQueueResultOutput {
    91  	return pulumi.ToOutputWithContext(context.Background(), args).
    92  		ApplyT(func(v interface{}) (LookupJobQueueResult, error) {
    93  			args := v.(LookupJobQueueArgs)
    94  			r, err := LookupJobQueue(ctx, &args, opts...)
    95  			var s LookupJobQueueResult
    96  			if r != nil {
    97  				s = *r
    98  			}
    99  			return s, err
   100  		}).(LookupJobQueueResultOutput)
   101  }
   102  
   103  // A collection of arguments for invoking getJobQueue.
   104  type LookupJobQueueOutputArgs struct {
   105  	// Name of the job queue.
   106  	Name pulumi.StringInput `pulumi:"name"`
   107  	// Key-value map of resource tags
   108  	Tags pulumi.StringMapInput `pulumi:"tags"`
   109  }
   110  
   111  func (LookupJobQueueOutputArgs) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*LookupJobQueueArgs)(nil)).Elem()
   113  }
   114  
   115  // A collection of values returned by getJobQueue.
   116  type LookupJobQueueResultOutput struct{ *pulumi.OutputState }
   117  
   118  func (LookupJobQueueResultOutput) ElementType() reflect.Type {
   119  	return reflect.TypeOf((*LookupJobQueueResult)(nil)).Elem()
   120  }
   121  
   122  func (o LookupJobQueueResultOutput) ToLookupJobQueueResultOutput() LookupJobQueueResultOutput {
   123  	return o
   124  }
   125  
   126  func (o LookupJobQueueResultOutput) ToLookupJobQueueResultOutputWithContext(ctx context.Context) LookupJobQueueResultOutput {
   127  	return o
   128  }
   129  
   130  // ARN of the job queue.
   131  func (o LookupJobQueueResultOutput) Arn() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.Arn }).(pulumi.StringOutput)
   133  }
   134  
   135  // The compute environments that are attached to the job queue and the order in
   136  // which job placement is preferred. Compute environments are selected for job placement in ascending order.
   137  // * `compute_environment_order.#.order` - The order of the compute environment.
   138  // * `compute_environment_order.#.compute_environment` - The ARN of the compute environment.
   139  func (o LookupJobQueueResultOutput) ComputeEnvironmentOrders() GetJobQueueComputeEnvironmentOrderArrayOutput {
   140  	return o.ApplyT(func(v LookupJobQueueResult) []GetJobQueueComputeEnvironmentOrder { return v.ComputeEnvironmentOrders }).(GetJobQueueComputeEnvironmentOrderArrayOutput)
   141  }
   142  
   143  // The provider-assigned unique ID for this managed resource.
   144  func (o LookupJobQueueResultOutput) Id() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.Id }).(pulumi.StringOutput)
   146  }
   147  
   148  func (o LookupJobQueueResultOutput) Name() pulumi.StringOutput {
   149  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.Name }).(pulumi.StringOutput)
   150  }
   151  
   152  // Priority of the job queue. Job queues with a higher priority are evaluated first when
   153  // associated with the same compute environment.
   154  func (o LookupJobQueueResultOutput) Priority() pulumi.IntOutput {
   155  	return o.ApplyT(func(v LookupJobQueueResult) int { return v.Priority }).(pulumi.IntOutput)
   156  }
   157  
   158  // 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.
   159  func (o LookupJobQueueResultOutput) SchedulingPolicyArn() pulumi.StringOutput {
   160  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.SchedulingPolicyArn }).(pulumi.StringOutput)
   161  }
   162  
   163  // Describes the ability of the queue to accept new jobs (for example, `ENABLED` or `DISABLED`).
   164  func (o LookupJobQueueResultOutput) State() pulumi.StringOutput {
   165  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.State }).(pulumi.StringOutput)
   166  }
   167  
   168  // Current status of the job queue (for example, `CREATING` or `VALID`).
   169  func (o LookupJobQueueResultOutput) Status() pulumi.StringOutput {
   170  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.Status }).(pulumi.StringOutput)
   171  }
   172  
   173  // Short, human-readable string to provide additional details about the current status
   174  // of the job queue.
   175  func (o LookupJobQueueResultOutput) StatusReason() pulumi.StringOutput {
   176  	return o.ApplyT(func(v LookupJobQueueResult) string { return v.StatusReason }).(pulumi.StringOutput)
   177  }
   178  
   179  // Key-value map of resource tags
   180  func (o LookupJobQueueResultOutput) Tags() pulumi.StringMapOutput {
   181  	return o.ApplyT(func(v LookupJobQueueResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   182  }
   183  
   184  func init() {
   185  	pulumi.RegisterOutputType(LookupJobQueueResultOutput{})
   186  }