Skip to content

Commit 3d347d2

Browse files
authored
feat: cleartext user_data variable (#158)
* feat: add user_data var * feat: base64 encode user_data var
1 parent aad64e8 commit 3d347d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resource "aws_launch_template" "default" {
7878
}
7979
}
8080

81-
user_data = var.user_data_base64
81+
user_data = var.user_data != "" ? base64encode(var.user_data) : var.user_data_base64
8282

8383
dynamic "iam_instance_profile" {
8484
for_each = var.iam_instance_profile_name != "" ? [var.iam_instance_profile_name] : []

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ variable "user_data_base64" {
5757
default = ""
5858
}
5959

60+
variable "user_data" {
61+
type = string
62+
description = "The cleartext user data to be Base64-encoded to provide when launching the instances"
63+
default = ""
64+
}
65+
6066
variable "enable_monitoring" {
6167
type = bool
6268
description = "Enable/disable detailed monitoring"

0 commit comments

Comments
 (0)