From bf8119f1798da4c1bcd4a2f66d0c7dc0f85b1d53 Mon Sep 17 00:00:00 2001 From: Niall Thomson Date: Sun, 8 Oct 2023 07:20:29 -0600 Subject: [PATCH] Reboot Cloud9 instead of explicitly resizing the partition --- lab/cfn/eks-workshop-ide-cfn.yaml | 32 ++++--------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/lab/cfn/eks-workshop-ide-cfn.yaml b/lab/cfn/eks-workshop-ide-cfn.yaml index 1ece7632d..217df887b 100644 --- a/lab/cfn/eks-workshop-ide-cfn.yaml +++ b/lab/cfn/eks-workshop-ide-cfn.yaml @@ -285,34 +285,6 @@ Resources: runCommand: - !Sub | set -e - - STR=$(cat /etc/os-release) - SUB="VERSION_ID=\"2\"" - - marker_file="/root/resized.mark" - - if [[ ! -f "$marker_file" ]]; then - if [ $(readlink -f /dev/xvda) = "/dev/xvda" ] - then - sudo growpart /dev/xvda 1 - if [[ "$STR" == *"$SUB"* ]] - then - sudo xfs_growfs -d / - else - sudo resize2fs /dev/xvda1 - fi - else - sudo growpart /dev/nvme0n1 1 - if [[ "$STR" == *"$SUB"* ]] - then - sudo xfs_growfs -d / - else - sudo resize2fs /dev/nvme0n1p1 - fi - fi - fi - - touch $marker_file export AWS_REGION="${AWS::Region}" export REPOSITORY_OWNER="${RepositoryOwner}" @@ -325,6 +297,10 @@ Resources: sudo -E -H -u ec2-user bash -c "curl -fsSL https://raw.githubusercontent.com/${RepositoryOwner}/${RepositoryName}/${RepositoryRef}/lab/scripts/setup.sh | bash" + echo "Rebooting...." + + FILE=$(mktemp) && echo $FILE && echo '#!/bin/bash' > $FILE && echo 'reboot -f --verbose' >> $FILE && at now + 1 minute -f $FILE + EksWorkshopC9InstanceProfile: Type: AWS::IAM::InstanceProfile Properties: