diff --git a/aws/start b/aws/bootstrap similarity index 50% rename from aws/start rename to aws/bootstrap index f1ffead..aadfa45 100755 --- a/aws/start +++ b/aws/bootstrap @@ -1,3 +1,3 @@ #!/bin/sh -l -BOOTSTRAP_PATH \ No newline at end of file +TAILCALL_PATH \ No newline at end of file diff --git a/aws/tailcall.tf b/aws/tailcall.tf index 5c47fdc..70da039 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -51,7 +51,7 @@ variable "TERRAFORM_WORKSPACE" { type = string } -variable "BOOTSTRAP_PATH" { +variable "TAILCALL_PATH" { type = string } @@ -92,14 +92,14 @@ data "http" "bootstrap" { url = data.github_release.tailcall.assets[index(data.github_release.tailcall.assets.*.name, "tailcall-aws-lambda-bootstrap")].browser_download_url } -resource "local_sensitive_file" "start" { - content_base64 = filebase64("start") - filename = "start" +resource "local_sensitive_file" "bootstrap" { + content_base64 = filebase64("bootstrap") + filename = "config/bootstrap" } -resource "local_sensitive_file" "bootstrap" { +resource "local_sensitive_file" "tailcall" { content_base64 = data.http.bootstrap.response_body_base64 - filename = var.BOOTSTRAP_PATH + filename = var.TAILCALL_PATH } resource "local_sensitive_file" "config" { @@ -113,7 +113,7 @@ data "archive_file" "tailcall" { depends_on = [ local_sensitive_file.bootstrap, local_sensitive_file.config, - local_sensitive_file.start + local_sensitive_file.tailcall ] source_dir = "config" output_path = "tailcall.zip" diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index cb26262..74cb1bd 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -39,7 +39,7 @@ export TF_VAR_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID export TF_VAR_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY export TF_VAR_TERRAFORM_ORG=$TERRAFORM_ORG export TF_VAR_TERRAFORM_WORKSPACE=$TERRAFORM_WORKSPACE -export TF_VAR_BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" +export TF_VAR_TAILCALL_PATH="config/$TC_CONFIG_DIR/tailcall" export TF_TOKEN_app_terraform_io=$TERRAFORM_API_TOKEN @@ -81,8 +81,8 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config - awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/start > /tmp/start - mv /tmp/start /aws/start + awk -v tailcall_path="$TF_VAR_TAILCALL_PATH" "{sub(/TAILCALL_PATH/,tailcall_path)}1" /aws/bootstrap > /tmp/bootstrap + mv /tmp/bootstrap /aws/bootstrap cd /aws echo "List: $(find /app -type f)" setup_terraform