diff --git a/registry/coder/modules/amazon-q/README.md b/registry/coder/modules/amazon-q/README.md index 630c3a6bc..3146f01eb 100644 --- a/registry/coder/modules/amazon-q/README.md +++ b/registry/coder/modules/amazon-q/README.md @@ -13,7 +13,7 @@ Run [Amazon Q](https://aws.amazon.com/q/) in your workspace to access Amazon's A ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" @@ -102,7 +102,7 @@ data "coder_parameter" "ai_prompt" { module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -228,7 +228,7 @@ If no custom `agent_config` is provided, the default agent name "agent" is used. ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -258,7 +258,7 @@ This example will: ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -279,7 +279,7 @@ module "amazon-q" { ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -305,7 +305,7 @@ module "amazon-q" { ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -319,7 +319,7 @@ module "amazon-q" { ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -340,7 +340,7 @@ module "amazon-q" { ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball @@ -358,7 +358,7 @@ For environments without direct internet access, you can host Amazon Q installat ```tf module "amazon-q" { source = "registry.coder.com/coder/amazon-q/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id workdir = "/home/coder" auth_tarball = var.amazon_q_auth_tarball diff --git a/registry/coder/modules/amazon-q/main.tf b/registry/coder/modules/amazon-q/main.tf index a4bac213d..84ac3c031 100644 --- a/registry/coder/modules/amazon-q/main.tf +++ b/registry/coder/modules/amazon-q/main.tf @@ -96,8 +96,6 @@ variable "workdir" { description = "The folder to run Amazon Q in." } -# --------------------------------------------- - variable "install_amazon_q" { type = bool description = "Whether to install Amazon Q." @@ -190,6 +188,7 @@ resource "coder_env" "auth_tarball" { locals { app_slug = "amazonq" + workdir = trimsuffix(var.workdir, "/") install_script = file("${path.module}/scripts/install.sh") start_script = file("${path.module}/scripts/start.sh") module_dir_name = ".amazonq-module" @@ -218,6 +217,7 @@ module "agentapi" { version = "1.2.0" agent_id = var.agent_id + folder = local.workdir web_app_slug = local.app_slug web_app_order = var.order web_app_group = var.group diff --git a/registry/coder/modules/amazon-q/scripts/install.sh b/registry/coder/modules/amazon-q/scripts/install.sh index e3ae3361a..f8e43e763 100644 --- a/registry/coder/modules/amazon-q/scripts/install.sh +++ b/registry/coder/modules/amazon-q/scripts/install.sh @@ -94,6 +94,13 @@ function install_amazon_q() { function extract_auth_tarball() { if [ -n "$ARG_AUTH_TARBALL" ]; then echo "Extracting auth tarball..." + + if ! command_exists zstd; then + echo "Error: zstd is required to extract the authentication tarball but is not installed." + echo "Please install zstd using the pre_install_script parameter." + exit 1 + fi + PREV_DIR="$PWD" echo "$ARG_AUTH_TARBALL" | base64 -d > /tmp/auth.tar.zst rm -rf ~/.local/share/amazon-q