github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/batch/getComputeEnvironment.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 Compute Environment data source allows access to details of a specific 15 // compute environment 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.LookupComputeEnvironment(ctx, &batch.LookupComputeEnvironmentArgs{ 33 // ComputeEnvironmentName: "batch-mongo-production", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupComputeEnvironment(ctx *pulumi.Context, args *LookupComputeEnvironmentArgs, opts ...pulumi.InvokeOption) (*LookupComputeEnvironmentResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupComputeEnvironmentResult 47 err := ctx.Invoke("aws:batch/getComputeEnvironment:getComputeEnvironment", 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 getComputeEnvironment. 55 type LookupComputeEnvironmentArgs struct { 56 // Name of the Batch Compute Environment 57 ComputeEnvironmentName string `pulumi:"computeEnvironmentName"` 58 // Key-value map of resource tags 59 Tags map[string]string `pulumi:"tags"` 60 } 61 62 // A collection of values returned by getComputeEnvironment. 63 type LookupComputeEnvironmentResult struct { 64 // ARN of the compute environment. 65 Arn string `pulumi:"arn"` 66 ComputeEnvironmentName string `pulumi:"computeEnvironmentName"` 67 // ARN of the underlying Amazon ECS cluster used by the compute environment. 68 EcsClusterArn string `pulumi:"ecsClusterArn"` 69 // The provider-assigned unique ID for this managed resource. 70 Id string `pulumi:"id"` 71 // ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. 72 ServiceRole string `pulumi:"serviceRole"` 73 // State of the compute environment (for example, `ENABLED` or `DISABLED`). If the state is `ENABLED`, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. 74 State string `pulumi:"state"` 75 // Current status of the compute environment (for example, `CREATING` or `VALID`). 76 Status string `pulumi:"status"` 77 // Short, human-readable string to provide additional details about the current status of the compute environment. 78 StatusReason string `pulumi:"statusReason"` 79 // Key-value map of resource tags 80 Tags map[string]string `pulumi:"tags"` 81 // Type of the compute environment (for example, `MANAGED` or `UNMANAGED`). 82 Type string `pulumi:"type"` 83 // Specifies the infrastructure update policy for the compute environment. 84 UpdatePolicies []GetComputeEnvironmentUpdatePolicy `pulumi:"updatePolicies"` 85 } 86 87 func LookupComputeEnvironmentOutput(ctx *pulumi.Context, args LookupComputeEnvironmentOutputArgs, opts ...pulumi.InvokeOption) LookupComputeEnvironmentResultOutput { 88 return pulumi.ToOutputWithContext(context.Background(), args). 89 ApplyT(func(v interface{}) (LookupComputeEnvironmentResult, error) { 90 args := v.(LookupComputeEnvironmentArgs) 91 r, err := LookupComputeEnvironment(ctx, &args, opts...) 92 var s LookupComputeEnvironmentResult 93 if r != nil { 94 s = *r 95 } 96 return s, err 97 }).(LookupComputeEnvironmentResultOutput) 98 } 99 100 // A collection of arguments for invoking getComputeEnvironment. 101 type LookupComputeEnvironmentOutputArgs struct { 102 // Name of the Batch Compute Environment 103 ComputeEnvironmentName pulumi.StringInput `pulumi:"computeEnvironmentName"` 104 // Key-value map of resource tags 105 Tags pulumi.StringMapInput `pulumi:"tags"` 106 } 107 108 func (LookupComputeEnvironmentOutputArgs) ElementType() reflect.Type { 109 return reflect.TypeOf((*LookupComputeEnvironmentArgs)(nil)).Elem() 110 } 111 112 // A collection of values returned by getComputeEnvironment. 113 type LookupComputeEnvironmentResultOutput struct{ *pulumi.OutputState } 114 115 func (LookupComputeEnvironmentResultOutput) ElementType() reflect.Type { 116 return reflect.TypeOf((*LookupComputeEnvironmentResult)(nil)).Elem() 117 } 118 119 func (o LookupComputeEnvironmentResultOutput) ToLookupComputeEnvironmentResultOutput() LookupComputeEnvironmentResultOutput { 120 return o 121 } 122 123 func (o LookupComputeEnvironmentResultOutput) ToLookupComputeEnvironmentResultOutputWithContext(ctx context.Context) LookupComputeEnvironmentResultOutput { 124 return o 125 } 126 127 // ARN of the compute environment. 128 func (o LookupComputeEnvironmentResultOutput) Arn() pulumi.StringOutput { 129 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.Arn }).(pulumi.StringOutput) 130 } 131 132 func (o LookupComputeEnvironmentResultOutput) ComputeEnvironmentName() pulumi.StringOutput { 133 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.ComputeEnvironmentName }).(pulumi.StringOutput) 134 } 135 136 // ARN of the underlying Amazon ECS cluster used by the compute environment. 137 func (o LookupComputeEnvironmentResultOutput) EcsClusterArn() pulumi.StringOutput { 138 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.EcsClusterArn }).(pulumi.StringOutput) 139 } 140 141 // The provider-assigned unique ID for this managed resource. 142 func (o LookupComputeEnvironmentResultOutput) Id() pulumi.StringOutput { 143 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.Id }).(pulumi.StringOutput) 144 } 145 146 // ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. 147 func (o LookupComputeEnvironmentResultOutput) ServiceRole() pulumi.StringOutput { 148 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.ServiceRole }).(pulumi.StringOutput) 149 } 150 151 // State of the compute environment (for example, `ENABLED` or `DISABLED`). If the state is `ENABLED`, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. 152 func (o LookupComputeEnvironmentResultOutput) State() pulumi.StringOutput { 153 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.State }).(pulumi.StringOutput) 154 } 155 156 // Current status of the compute environment (for example, `CREATING` or `VALID`). 157 func (o LookupComputeEnvironmentResultOutput) Status() pulumi.StringOutput { 158 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.Status }).(pulumi.StringOutput) 159 } 160 161 // Short, human-readable string to provide additional details about the current status of the compute environment. 162 func (o LookupComputeEnvironmentResultOutput) StatusReason() pulumi.StringOutput { 163 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.StatusReason }).(pulumi.StringOutput) 164 } 165 166 // Key-value map of resource tags 167 func (o LookupComputeEnvironmentResultOutput) Tags() pulumi.StringMapOutput { 168 return o.ApplyT(func(v LookupComputeEnvironmentResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 169 } 170 171 // Type of the compute environment (for example, `MANAGED` or `UNMANAGED`). 172 func (o LookupComputeEnvironmentResultOutput) Type() pulumi.StringOutput { 173 return o.ApplyT(func(v LookupComputeEnvironmentResult) string { return v.Type }).(pulumi.StringOutput) 174 } 175 176 // Specifies the infrastructure update policy for the compute environment. 177 func (o LookupComputeEnvironmentResultOutput) UpdatePolicies() GetComputeEnvironmentUpdatePolicyArrayOutput { 178 return o.ApplyT(func(v LookupComputeEnvironmentResult) []GetComputeEnvironmentUpdatePolicy { return v.UpdatePolicies }).(GetComputeEnvironmentUpdatePolicyArrayOutput) 179 } 180 181 func init() { 182 pulumi.RegisterOutputType(LookupComputeEnvironmentResultOutput{}) 183 }