diff --git a/al1.pkr.hcl b/al1.pkr.hcl index 7a6c64be..58705ad9 100644 --- a/al1.pkr.hcl +++ b/al1.pkr.hcl @@ -89,6 +89,10 @@ build { destination = "/tmp/additional-packages" } + provisioner "shell" { + script = "scripts/setup-ecs-config-dir.sh" + } + provisioner "shell" { inline_shebang = "/bin/sh -ex" inline = [ diff --git a/al2.pkr.hcl b/al2.pkr.hcl index a26338ca..7929281a 100644 --- a/al2.pkr.hcl +++ b/al2.pkr.hcl @@ -103,6 +103,10 @@ build { ] } + provisioner "shell" { + script = "scripts/setup-ecs-config-dir.sh" + } + provisioner "shell" { script = "scripts/install-docker.sh" environment_vars = [ diff --git a/al2023.pkr.hcl b/al2023.pkr.hcl index ac2c6cc1..e8ee038a 100644 --- a/al2023.pkr.hcl +++ b/al2023.pkr.hcl @@ -83,6 +83,10 @@ build { ] } + provisioner "shell" { + script = "scripts/setup-ecs-config-dir.sh" + } + provisioner "shell" { script = "scripts/install-docker.sh" environment_vars = [ diff --git a/scripts/setup-ecs-config-dir.sh b/scripts/setup-ecs-config-dir.sh new file mode 100644 index 00000000..7c82bb47 --- /dev/null +++ b/scripts/setup-ecs-config-dir.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -ex + +sudo mkdir -p "/etc/ecs" + +if [ ! -f "/etc/ecs/ecs.config" ]; then + sudo touch /etc/ecs/ecs.config +fi + +if [ ! -f "/etc/ecs/ecs.config.json" ]; then + sudo touch /etc/ecs/ecs.config.json +fi \ No newline at end of file