@@ -42,6 +42,17 @@ Parameters:
4242 Default : /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2
4343 AllowedValues :
4444 - /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2
45+
46+ CromwellVersion :
47+ Type : String
48+ Description : >-
49+ Version of Cromwell to install. "latest" will retrieve the currently released
50+ version of Cromwell from Github.
51+ AllowedValues :
52+ - latest
53+ - 36.1
54+ - 36
55+ Default : 36.1
4556
4657 InstanceName :
4758 Type : String
@@ -79,6 +90,14 @@ Parameters:
7990 Description : ARN of the AWS Batch Job Queue this server will use by default
8091 Type : String
8192
93+
94+ Conditions :
95+ GetLatestCromwellVersion :
96+ Fn::Equals :
97+ - !Ref CromwellVersion
98+ - latest
99+
100+
82101# Resources
83102Resources :
84103 Ec2InstanceRole :
@@ -221,11 +240,17 @@ Resources:
221240 group : root
222241
223242 " /home/ec2-user/get_cromwell.sh " :
224- content : !Sub |
243+ content : !Sub
244+ - |
225245 #!/bin/bash
226- url=$(curl --silent "https://api.github.com/repos/broadinstitute/cromwell/releases/latest " | jq -r .assets[0].browser_download_url)
246+ url=$(curl --silent "https://api.github.com/repos/broadinstitute/cromwell/releases/${CromwellVersionPath} " | jq -r .assets[0].browser_download_url)
227247 curl -LO $url
228- ln -s $(find . | grep "cromwell.*\.jar") cromwell-latest.jar
248+ ln -s $(find . | grep "cromwell.*\.jar") cromwell.jar
249+ - CromwellVersionPath :
250+ Fn::If :
251+ - GetLatestCromwellVersion
252+ - !Ref CromwellVersion
253+ - !Join ["/", ["tags", !Ref CromwellVersion]]
229254
230255 mode : " 000755"
231256 owner : " ec2-user"
@@ -281,7 +306,7 @@ Resources:
281306 " /home/ec2-user/run_cromwell_server.sh " :
282307 content : !Sub |
283308 #!/bin/bash
284- java -Dconfig.file=cromwell.conf -jar cromwell-latest .jar server
309+ java -Dconfig.file=cromwell.conf -jar cromwell.jar server
285310
286311 mode : " 000755"
287312 owner : " ec2-user"
@@ -487,6 +512,7 @@ Metadata:
487512 - Label :
488513 default : " Cromwell Configuration"
489514 Parameters :
515+ - CromwellVersion
490516 - S3BucketName
491517 - BatchQueue
492518
@@ -509,6 +535,8 @@ Metadata:
509535 default : " S3 Bucket Name"
510536 BatchQueue :
511537 default : " Default Batch Queue"
538+ CromwellVersion :
539+ default : " Cromwell Version"
512540
513541Outputs :
514542 EC2Instance :
0 commit comments