Skip to content

Commit c90708e

Browse files
committed
Add working test user-data script
1 parent 9ab6b71 commit c90708e

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

modules/eks/main.tf

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ locals {
44
disk_setup_user_data = base64encode(<<-EOT
55
#!/bin/bash
66
set -xeuo pipefail
7-
8-
yum update -y
9-
yum install -y lvm2 util-linux jq e2fsprogs
10-
117
BOTTLEROCKET_ROOT="/.bottlerocket/rootfs"
128
DRIVE_PATHS=()
139
@@ -31,15 +27,7 @@ locals {
3127
pvcreate "$${device_path}"
3228
done
3329
34-
echo "Creating VG instance-store-vg"
3530
vgcreate instance-store-vg "$${DRIVE_PATHS[@]}"
36-
37-
echo "PV Status:"
38-
pvs
39-
echo "VG Status:"
40-
vgs
41-
42-
echo "Completed LVM setup successfully"
4331
EOT
4432
)
4533
}
@@ -57,7 +45,6 @@ module "eks" {
5745

5846
cluster_endpoint_public_access = true
5947

60-
# Add CloudWatch logging
6148
cluster_enabled_log_types = var.cluster_enabled_log_types
6249

6350
eks_managed_node_groups = {
@@ -80,19 +67,20 @@ module "eks" {
8067
}
8168

8269
enable_bootstrap_user_data = true
70+
8371
bootstrap_extra_args = <<-TOML
84-
[settings.bootstrap-containers.disk-setup]
72+
[settings.bootstrap-containers.default]
8573
mode = "once"
8674
essential = true
8775
user-data = "${local.disk_setup_user_data}"
8876
TOML
8977

9078
# Simpler test to see if the user data is being applied
9179
# bootstrap_extra_args = <<-TOML
92-
# [settings.bootstrap-containers.disk-setup]
80+
# [settings.bootstrap-containers.default]
9381
# mode = "once"
9482
# essential = true
95-
# user-data = "${base64encode("#!/bin/bash\necho 'Simple test' > /tmp/test.log")}"
83+
# user-data = "IyEvYmluL2Jhc2gKZWNobyBIRUxMTyBXT1JMRA=="
9684
# TOML
9785

9886
}

0 commit comments

Comments
 (0)