@@ -79,6 +79,10 @@ Parameters:
7979 - " true"
8080 - " false"
8181
82+ EnableSandbox :
83+ Type : String
84+ Default : " true"
85+ Description : " Install Docker for sandboxed execution (recommended for group chats)"
8286 CreateS3Bucket :
8387 Type : String
8488 Default : " true"
@@ -103,6 +107,7 @@ Conditions:
103107 AllowSSH : !And
104108 - !Not [!Equals [!Ref AllowedSSHCIDR, ""]]
105109 - !Not [!Equals [!Ref KeyPairName, "none"]]
110+ EnableDocker : !Equals [!Ref EnableSandbox, "true"]
106111
107112Mappings :
108113 # Architecture detection based on instance type
@@ -464,12 +469,16 @@ Resources:
464469 echo "[3/9] Configuring SSM Agent..."
465470 snap start amazon-ssm-agent || systemctl start amazon-ssm-agent
466471
467- # Install Docker
468- echo "[4/9] Installing Docker..."
469- curl -fsSL https://get.docker.com | sh
470- systemctl enable docker
471- systemctl start docker
472- usermod -aG docker ubuntu
472+ # Install Docker (if EnableSandbox=true)
473+ if [ "${EnableSandbox}" = "true" ]; then
474+ echo "[4/9] Installing Docker..."
475+ curl -fsSL https://get.docker.com | sh
476+ systemctl enable docker
477+ systemctl start docker
478+ usermod -aG docker ubuntu
479+ else
480+ echo "[4/9] Skipping Docker (EnableSandbox=false)..."
481+ fi
473482
474483 # Install Node.js
475484 echo "[5/9] Installing Node.js..."
0 commit comments