Skip to content

Commit f96c2e4

Browse files
authored
fix: update userdata for AML2023 changes (#321)
1 parent df04507 commit f96c2e4

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

stack/hlsconstructs/batch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def __init__(
103103
cloudwatch_config_param = aws_ssm.StringParameter(
104104
self,
105105
"CloudWatchAgentConfigParam",
106-
description="Configruation of Cloudwatch Agent for Amazon Linux 2",
106+
description="Configuration of Cloudwatch Agent for Amazon Linux 2",
107107
parameter_name=cloudwatch_ssm_param,
108108
string_value=cloudwatch_config_string,
109109
)
110-
# Grant ssm:GetParameters to ECS Instnace role.
110+
# Grant ssm:GetParameters to ECS Instance role.
111111
cloudwatch_config_param.grant_read(self.ecs_instance_role)
112112

113113
userdata_file = open(os.path.join(dirname, "userdata.txt"), "rb").read()

stack/hlsconstructs/userdata.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ runcmd:
3333

3434
--==MYBOUNDARY==
3535
Content-Type: text/cloud-boothook; charset="us-ascii"
36+
#!/bin/bash -xe
3637

38+
# ===== Mount /efs
39+
# See: https://docs.aws.amazon.com/linux/al2023/ug/efs.html
3740
# Install amazon-efs-utils
38-
cloud-init-per once install_amazon-efs-utils yum install -y amazon-efs-utils
41+
cloud-init-per once install_amazon-efs-utils dnf install -y amazon-efs-utils
3942

4043
# Create /efs folder
4144
cloud-init-per once mkdir_efs mkdir /mnt/efs
42-
43-
# Create a 16GB swapfile (128M * 128)
44-
cloud-init-per once create_swap
45-
46-
# Mount /efs
47-
cloud-init-per once mount_efs echo -e '{}:/ /mnt/efs efs defaults,_netdev 0 0' >> /etc/fstab
48-
mount -a
45+
# Mount
46+
cloud-init-per once mount_efs mount -t efs {} /mnt/efs
4947

5048
--==MYBOUNDARY==
5149
Content-Type: text/x-shellscript; charset="us-ascii"

stack/hlsconstructs/userdata_no_cw.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ runcmd:
3333

3434
--==MYBOUNDARY==
3535
Content-Type: text/cloud-boothook; charset="us-ascii"
36+
#!/bin/bash -xe
3637

38+
# ===== Mount /efs
39+
# See: https://docs.aws.amazon.com/linux/al2023/ug/efs.html
3740
# Install amazon-efs-utils
38-
cloud-init-per once install_amazon-efs-utils yum install -y amazon-efs-utils
41+
cloud-init-per once install_amazon-efs-utils dnf install -y amazon-efs-utils
3942

4043
# Create /efs folder
4144
cloud-init-per once mkdir_efs mkdir /mnt/efs
42-
43-
# Create a 16GB swapfile (128M * 128)
44-
cloud-init-per once create_swap
45-
46-
# Mount /efs
47-
cloud-init-per once mount_efs echo -e '{}:/ /mnt/efs efs defaults,_netdev 0 0' >> /etc/fstab
48-
mount -a
45+
# Mount
46+
cloud-init-per once mount_efs mount -t efs {} /mnt/efs
4947

5048
--==MYBOUNDARY==
5149
Content-Type: text/x-shellscript; charset="us-ascii"

0 commit comments

Comments
 (0)