-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbatch.yml
644 lines (600 loc) · 20.7 KB
/
batch.yml
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# https://gitlab.invenia.ca/invenia/AWSClusterManagers.jl/blob/master/test/batch.yml
#
# Creates a bare bones AWS Batch environment used to test the AWSBatchManager from AWSClusterManagers.jl.
#
# ```
# aws cloudformation create-stack \
# --stack-name aws-batch-manager-test \
# --template-body file://test/batch.yml \
# --capabilities CAPABILITY_NAMED_IAM
# ```
#
# If you are planning on destroying your stack after you have finished running tests you
# can use the following parameters to make the tests avoid delays with scaling the compute
# environments by being slightly more expensive:
#
# ```
# aws cloudformation create-stack \
# --stack-name aws-batch-manager-test-fast \
# --template-body file://test/batch.yml \
# --capabilities CAPABILITY_NAMED_IAM \
# --parameters \
# ParameterKey=MinVCPUs,ParameterValue=16
# ```
AWSTemplateFormatVersion: 2010-09-09
Description: >-
A bare bones AWS Batch environment used to test the AWSBatchManager from AWSClusterManagers.jl.
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-specific-parameter-types
Parameters:
VPCCidrBlock:
# https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html#VPC_Sizing
Description: >-
The IP address range used for batch instances in the VPC.
Type: String
Default: 10.0.0.0/16
AllowedPattern: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/\\d{1,2}"
SubnetType:
Description: Specify the use of a private or public subnet
Type: String
Default: private
AllowedValues:
- private
- public
ExternalNetworking:
Description: Specify how external networking is setup within private subnets
Type: String
Default: nat
AllowedValues:
- none
- nat
ProvisioningModel:
Description: Spot instances are cheaper than on-demand but can be abruptly terminated
Type: String
Default: on-demand
AllowedValues:
- on-demand
- spot
MinVCPUs:
Description: >-
The minimum number of VCPUs to be available. Setting to 1 or higher makes jobs start
faster but will cost us more when instances are idle. Note you cannot decrease the
minimum number of VCPUs with a stack update.
Type: Number
Default: 0
MaxVCPUs:
Description: >-
The maximum number of VCPUs. Typically this number does not need to be touched
Type: Number
Default: 16
CIEntityArn:
Description: The user/role ARN used when executing CI test stage jobs.
Type: String
Default: ""
AllowedPattern: "|arn:aws:iam::\\d{12}:(user|role)/[^/]+"
AutomaticTeardown:
Description: Delete the stack automatically after 3 hours of inactivity
Type: String
Default: "false"
AllowedValues:
- "true"
- "false"
Conditions:
UsePublicSubnet: !Equals [!Ref SubnetType, public]
UsePrivateSubnet: !Equals [!Ref SubnetType, private]
UseNAT: !And
- !Condition UsePrivateSubnet
- !Equals [!Ref ExternalNetworking, nat]
UseExternalNetworking: !Or
- !Condition UsePublicSubnet
- !Condition UseNAT
OnDemandComputeEnvironment: !Equals [!Ref ProvisioningModel, on-demand]
Testing: !Not [!Equals [!Ref CIEntityArn, ""]]
SelfDestruct: !Equals [!Ref AutomaticTeardown, true]
Resources:
ComputeEnvironment:
Type: AWS::Batch::ComputeEnvironment
DependsOn: BatchServiceRole # Removing the ServiceRole before deleting the ComputeEnvironment will cause issues
Properties:
Type: MANAGED
# Make the ComputeEnvironment name unique for every conditional variation
ComputeEnvironmentName: !Sub
- "${AWS::StackName}-${InstanceType}-${SubnetType}"
- InstanceType: !If [OnDemandComputeEnvironment, demand, spot]
SubnetType: !If [UsePrivateSubnet, private, public]
ComputeResources:
Type: !If [OnDemandComputeEnvironment, EC2, SPOT]
BidPercentage: 100
MinvCpus: !Ref MinVCPUs
MaxvCpus: !Ref MaxVCPUs
InstanceTypes: [optimal]
PlacementGroup: !Ref PlacementGroup
Subnets:
!If
- UsePrivateSubnet
- - !Ref PrivateSubnetA
- !Ref PrivateSubnetB
- !Ref PrivateSubnetC
- !Ref PrivateSubnetD
- !Ref PrivateSubnetE
- !Ref PrivateSubnetF
- - !Ref PublicSubnetA
SecurityGroupIds: [!Ref SecurityGroup]
InstanceRole: !Ref IamInstanceProfile
SpotIamFleetRole: !If [OnDemandComputeEnvironment, !Ref "AWS::NoValue", !Ref BatchSpotFleetRole]
Tags:
Name: !Sub "AWS Batch (${AWS::StackName})"
ServiceRole: !Ref BatchServiceRole
ManagerJobQueue:
Type: AWS::Batch::JobQueue
Properties:
JobQueueName: !Sub ${AWS::StackName}-Managers
Priority: 2 # Managers should have a higher priority relative to workers
ComputeEnvironmentOrder:
- Order: 1 # Orders are 0-based which will cause issues in Julia
ComputeEnvironment: !Ref ComputeEnvironment
WorkerJobQueue:
Type: AWS::Batch::JobQueue
Properties:
JobQueueName: !Sub ${AWS::StackName}-Workers
Priority: 1
ComputeEnvironmentOrder:
- Order: 1 # Orders are 0-based which will cause issues in Julia
ComputeEnvironment: !Ref ComputeEnvironment
IamInstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Roles:
- !Ref EcsInstanceRole
EcsInstanceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2008-10-17
Statement:
- Effect: Allow
Principal:
Service: ec2.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
BatchServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: batch.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole
# http://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html
BatchSpotFleetRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: spotfleet.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetTaggingRole
SecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: EC2 Security Group for instances launched in the VPC by Batch
VpcId: !Ref VPC
VPC:
Type: AWS::EC2::VPC
DependsOn: DeleteStackRole # This role should be the last to delete
Properties:
CidrBlock: !Ref VPCCidrBlock
PlacementGroup:
Type: AWS::EC2::PlacementGroup
Properties:
Strategy: partition
# For details see: "docs/src/pages/design.md#compute-environment-networking-considerations"
PrivateSubnetA:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}a
CidrBlock: !Select [0, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.0.0/20 (10.0.0.0 - 10.0.15.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetA:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetA
PrivateSubnetB:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}b
CidrBlock: !Select [1, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.16.0/20 (10.0.16.0 - 10.0.31.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetB:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetB
PrivateSubnetC:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}c
CidrBlock: !Select [2, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.32.0/20 (10.0.32.0 - 10.0.63.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetC:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetC
PrivateSubnetD:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}d
CidrBlock: !Select [3, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.48.0/20 (10.0.48.0 - 10.0.63.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetD:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetD
PrivateSubnetE:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}e
CidrBlock: !Select [4, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.64.0/20 (10.0.64.0 - 10.0.79.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetE:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetE
PrivateSubnetF:
Type: AWS::EC2::Subnet
Condition: UsePrivateSubnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}f
CidrBlock: !Select [5, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.80.0/20 (10.0.80.0 - 10.0.95.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
RTAPrivateSubnetF:
Type: AWS::EC2::SubnetRouteTableAssociation
Condition: UsePrivateSubnet
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetF
PrivateRouteTable:
Type: AWS::EC2::RouteTable
Condition: UsePrivateSubnet
Properties:
VpcId: !Ref VPC
PrivateRoute:
Type: AWS::EC2::Route
Condition: UseNAT
DependsOn: VPCGatewayAttachment
Properties:
RouteTableId: !Ref PrivateRouteTable
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NATGateway
NATGateway:
Type: AWS::EC2::NatGateway # "/design.md#nat-gateway"
Condition: UseNAT
Properties:
AllocationId: !GetAtt EIP.AllocationId
SubnetId: !Ref PublicSubnetA
EIP:
Type: AWS::EC2::EIP
Condition: UseNAT
DependsOn: VPCGatewayAttachment
Properties:
Domain: vpc
PublicSubnetA:
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: !Sub ${AWS::Region}a
CidrBlock: !Select [6, !Cidr [!GetAtt VPC.CidrBlock, 16, 12]] # e.g. 10.0.0.0/16 becomes 10.0.96.0/20 (10.0.96.0 - 10.0.111.255)
VpcId: !Ref VPC
MapPublicIpOnLaunch: true
RTAPublicSubnetA:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicRouteTable
SubnetId: !Ref PublicSubnetA
PublicRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
PublicRoute:
Type: AWS::EC2::Route
Condition: UseExternalNetworking
DependsOn: VPCGatewayAttachment
Properties:
RouteTableId: !Ref PublicRouteTable
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
VPCGatewayAttachment:
Type: AWS::EC2::VPCGatewayAttachment
Condition: UseExternalNetworking
DependsOn: PublicSubnetA # Detaching the gateway can fail if the VPC still contains public addresses
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
InternetGateway:
Type: AWS::EC2::InternetGateway
Condition: UseExternalNetworking
#============================================#
# Automatically delete stacks in the CI account that haven't been updated recently.
DeleteStackRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Policies:
- PolicyName: DeleteStackPolicy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- cloudformation:DescribeStacks
- cloudformation:DeleteStack
Resource: !Ref AWS::StackId
- Effect: Allow
Action:
- logs:*
- ec2:*
- batch:*
- iam:*
- events:*
- lambda:*
- ecr:*
Resource: "*"
DeleteStackLambda:
Type: AWS::Lambda::Function
Properties:
Handler: index.lambda_handler
Runtime: python3.6
Timeout: 5
Role: !GetAtt DeleteStackRole.Arn
Environment:
Variables:
STACK_NAME: !Ref AWS::StackName
WAIT_PERIOD: "3" # hours
Code:
ZipFile: |
from datetime import datetime, timedelta
import boto3
import os
STACK_NAME = os.environ["STACK_NAME"]
WAIT_PERIOD = os.environ["WAIT_PERIOD"]
def empty_repository(ecr):
client = boto3.client('ecr')
image_ids = client.list_images(repositoryName=ecr)["imageIds"]
client.batch_delete_image(repositoryName=ecr, imageIds=image_ids)
print(f"Finished emptying ECR repository \"{ecr}\".")
def lambda_handler(event, context):
cfn = boto3.resource('cloudformation')
stack = cfn.Stack(STACK_NAME)
wait_period = timedelta(hours=int(WAIT_PERIOD))
if stack.last_updated_time is None:
last_update = stack.creation_time
else:
last_update = stack.last_updated_time
tzaware_now = datetime.now(last_update.tzinfo)
if tzaware_now >= last_update + wait_period:
print(f"Deleting stack after {WAIT_PERIOD} hours without updates.")
stack_outputs = {x["OutputKey"]: x["OutputValue"] for x in stack.outputs}
empty_repository(stack_outputs["Ecr"])
stack.delete()
DeleteStackPermission:
Condition: SelfDestruct
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref DeleteStackLambda
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn: !GetAtt DeleteStackRule.Arn
DeleteStackRule:
Condition: SelfDestruct
Type: AWS::Events::Rule
Properties:
Description: Trigger deletion if stack has not been updated recently.
ScheduleExpression: cron(0 * * * ? *) # Run every hour
State: ENABLED
Targets:
- Id: DeleteStackLambda
Arn: !GetAtt DeleteStackLambda.Arn
#============================================#
# Role for AWSClusterManagers.jl for managers/workers
JLBatchJobRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com # Note: Shouldn't be batch.amazonaws.com
Action: sts:AssumeRole
JLBatchManagerPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Description: >-
Allow a AWSBatchManager to spawn workers and perform introspection
Roles:
- !Ref JLBatchJobRole
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- batch:SubmitJob
- batch:DescribeJobs
- batch:DescribeJobDefinitions
- batch:DescribeComputeEnvironments
- batch:DescribeJobQueues
Resource: '*'
TestBatchNodeJobRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com # Note: Shouldn't be batch.amazonaws.com
Action: sts:AssumeRole
TestBatchNodeJobPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: DescribeJobs
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: batch:DescribeJobs
Resource: "*"
Roles: [!Ref TestBatchNodeJobRole]
JLBatchJobIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
Description: Allows Julia managers/workers to connect to each other on any port
GroupId: !Ref SecurityGroup
IpProtocol: "-1" # All protocols (TCP, UDP, ICMP) on all ports
SourceSecurityGroupId: !Ref SecurityGroup
ECR:
Type: AWS::ECR::Repository
# Note: Doesn't work. ECR repositories will not be deleted when the stack is deleted if
# the repo contains any images. Delete the repo manually first to solve this.
DeletionPolicy: Delete
TestRole:
Type: AWS::IAM::Role
Condition: Testing
Properties:
RoleName: !Sub ${AWS::StackName}-TestRole
MaxSessionDuration: 7200 # 2 hours, in seconds
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
# https://github.com/aws-actions/configure-aws-credentials#permissions-for-assuming-a-role
- Effect: Allow
Principal:
AWS: !Ref CIEntityArn
Action:
- sts:AssumeRole
- sts:TagSession
# Similar to the "JLBatchManagerPolicy" but includes additional required permissions
# necessary for running the AWSClusterManagers online batch tests.
TestPolicy:
Type: AWS::IAM::Policy
Condition: Testing
Properties:
PolicyName: TestPolicy
PolicyDocument:
Version: 2012-10-17
Statement:
# Permissions used by AWSBatch.jl
- Effect: Allow
Action:
- batch:RegisterJobDefinition
- batch:DescribeJobDefinitions
- batch:DeregisterJobDefinition
- batch:SubmitJob
- batch:DescribeJobs
- batch:DescribeJobQueues
- batch:DescribeComputeEnvironments
Resource: "*"
- Effect: Allow
Action: logs:GetLogEvents
Resource: "*"
- Effect: Allow
Action: iam:PassRole
Resource: !GetAtt JLBatchJobRole.Arn
# AWSTools.stack_output
- Effect: Allow
Action: cloudformation:DescribeStacks
Resource: !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}/*
# AWSBatch.Docker.login
- Effect: Allow
Action: ecr:GetAuthorizationToken
Resource: "*"
# AWSBatch.Docker.pull
- Effect: Allow
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
Resource:
- !Sub arn:aws:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ECR}
# AWSBatch.Docker.push
- Effect: Allow
Action:
- ecr:PutImage
- ecr:InitiateLayerUpload
- ecr:UploadLayerPart
- ecr:CompleteLayerUpload
Resource:
- !Sub arn:aws:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ECR}
# aws-clear-queue
- Effect: Allow
Action:
- batch:ListJobs
- batch:TerminateJob
- batch:UpdateJobQueue
Resource: "*"
# batch-delete-image
- Effect: Allow
Action:
- ecr:ListImages
- ecr:BatchDeleteImage
Resource: !GetAtt ECR.Arn
# test/batch_node_online.jl
- Effect: Allow
Action: iam:PassRole
Resource: !GetAtt TestBatchNodeJobRole.Arn
Roles: [!Ref TestRole]
Outputs:
# JobDefinitionArn:
# Value: !Ref JobDefinition
JobName:
Value: !Ref AWS::StackName
JobDefinitionName:
Value: !Ref AWS::StackName
ComputeEnvironmentArn:
Value: !Ref ComputeEnvironment
ManagerJobQueueArn:
Value: !Ref ManagerJobQueue
WorkerJobQueueArn:
Value: !Ref WorkerJobQueue
JobRoleArn:
Value: !GetAtt JLBatchJobRole.Arn
TestBatchNodeJobRoleArn:
Value: !GetAtt TestBatchNodeJobRole.Arn
Ecr:
Value: !Ref ECR
EcrUri:
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${ECR}