Skip to content

Commit 329d9a7

Browse files
author
Angel Pizarro
committed
Revised user data to be a string that will be base64 encoded if defined.
1 parent 5db3da4 commit 329d9a7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

modules/computation/ec2.tf

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ resource "aws_launch_template" "cpu" {
3434
http_put_response_hop_limit = var.launch_template_http_put_response_hop_limit
3535
}
3636

37-
# Supply custom user data as a base64 encoded string.
38-
user_data = var.launch_template_custom_user_data
37+
# Base64 encode user data for the launch template if it is defined.
38+
# User data must be in MIME multi-part archive format.
39+
# Refer to the AWS Batch user guide for examples.
40+
# https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html#lt-user-data
41+
user_data = var.launch_template_custom_user_data != null ? base64encode(var.launch_template_custom_user_data ) : null
3942

4043
tags = var.standard_tags
4144
}

modules/computation/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ variable "launch_template_image_id" {
105105

106106
variable "launch_template_custom_user_data" {
107107
type = string
108-
description = "Custom user data script for the launch template provided as a base64-encoded string."
108+
description = "Custom user data in MIME multi-part archive format for the launch template. Refer to the AWS Batch user guide for examples at https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html#lt-user-data"
109109
nullable = true
110110
default = null
111111
}

0 commit comments

Comments
 (0)