@@ -57,22 +57,27 @@ Copy the output and use it as the `auth_tarball` variable.
5757<summary ><strong >Detailed Authentication Setup</strong ></summary >
5858
5959** Step 1: Install Amazon Q locally**
60+
6061- Download from [ AWS Amazon Q Developer] ( https://aws.amazon.com/q/developer/ )
6162- Follow the installation instructions for your platform
6263
6364** Step 2: Authenticate**
65+
6466``` bash
6567q login
6668```
69+
6770Complete the authentication process in your browser.
6871
6972** Step 3: Generate tarball**
73+
7074``` bash
7175cd ~ /.local/share/amazon-q
7276tar -c . | zstd | base64 -w 0 > /tmp/amazon-q-auth.txt
7377```
7478
7579** Step 4: Use in Terraform**
80+
7681``` tf
7782variable "amazon_q_auth_tarball" {
7883 type = string
@@ -82,6 +87,7 @@ variable "amazon_q_auth_tarball" {
8287```
8388
8489** Important Notes:**
90+
8591- Regenerate the tarball if you logout or re-authenticate
8692- Each user needs their own authentication tarball
8793- Keep the tarball secure as it contains authentication credentials
@@ -92,38 +98,39 @@ variable "amazon_q_auth_tarball" {
9298
9399### Required Variables
94100
95- | Variable | Type | Description |
96- | ----------| ------| -------------|
101+ | Variable | Type | Description |
102+ | ---------- | -------- | ----------------------- |
97103| ` agent_id ` | ` string ` | The ID of a Coder agent |
98104
99105### Optional Variables
100106
101- | Variable | Type | Default | Description |
102- | ----------| ------| ---------| -------------|
103- | ` auth_tarball ` | ` string ` | ` "" ` | Base64 encoded, zstd compressed tarball of authenticated Amazon Q directory |
104- | ` amazon_q_version ` | ` string ` | ` "latest" ` | Version of Amazon Q to install |
105- | ` install_amazon_q ` | ` bool ` | ` true ` | Whether to install Amazon Q CLI |
106- | ` install_agentapi ` | ` bool ` | ` true ` | Whether to install AgentAPI for web integration |
107- | ` agentapi_version ` | ` string ` | ` "v0.5.0" ` | Version of AgentAPI to install |
108- | ` folder ` | ` string ` | ` "/home/coder" ` | Working directory for Amazon Q |
109- | ` trust_all_tools ` | ` bool ` | ` true ` | Whether to trust all tools in Amazon Q |
110- | ` ai_prompt ` | ` string ` | ` "" ` | Initial task prompt to send to Amazon Q |
111- | ` system_prompt ` | ` string ` | * See below * | System prompt for task reporting behavior |
112- | ` pre_install_script ` | ` string ` | ` null ` | Script to run before installing Amazon Q |
113- | ` post_install_script ` | ` string ` | ` null ` | Script to run after installing Amazon Q |
114- | ` agent_config ` | ` string ` | ` null ` | Custom agent configuration JSON (See the [ Default Agent configuration] ( #default-agent-configuration ) )|
107+ | Variable | Type | Default | Description |
108+ | --------------------- | -------- | --------------- | ----------------------------------------------------------------------------------------------------- |
109+ | ` auth_tarball ` | ` string ` | ` "" ` | Base64 encoded, zstd compressed tarball of authenticated Amazon Q directory |
110+ | ` amazon_q_version ` | ` string ` | ` "latest" ` | Version of Amazon Q to install |
111+ | ` install_amazon_q ` | ` bool ` | ` true ` | Whether to install Amazon Q CLI |
112+ | ` install_agentapi ` | ` bool ` | ` true ` | Whether to install AgentAPI for web integration |
113+ | ` agentapi_version ` | ` string ` | ` "v0.5.0" ` | Version of AgentAPI to install |
114+ | ` folder ` | ` string ` | ` "/home/coder" ` | Working directory for Amazon Q |
115+ | ` trust_all_tools ` | ` bool ` | ` true ` | Whether to trust all tools in Amazon Q |
116+ | ` ai_prompt ` | ` string ` | ` "" ` | Initial task prompt to send to Amazon Q |
117+ | ` system_prompt ` | ` string ` | _ See below _ | System prompt for task reporting behavior |
118+ | ` pre_install_script ` | ` string ` | ` null ` | Script to run before installing Amazon Q |
119+ | ` post_install_script ` | ` string ` | ` null ` | Script to run after installing Amazon Q |
120+ | ` agent_config ` | ` string ` | ` null ` | Custom agent configuration JSON (See the [ Default Agent configuration] ( #default-agent-configuration ) ) |
115121
116122### UI Configuration
117123
118- | Variable | Type | Default | Description |
119- | ---------- | ------| ---------| -------------|
120- | ` order ` | ` number ` | ` null ` | Position in UI (lower numbers appear first) |
121- | ` group ` | ` string ` | ` null ` | Group name for organizing apps |
122- | ` icon ` | ` string ` | ` "/icon/amazon-q.svg" ` | Icon to display in UI |
124+ | Variable | Type | Default | Description |
125+ | -------- | -- ------ | ---------------------- | ------------------------------------------- |
126+ | ` order ` | ` number ` | ` null ` | Position in UI (lower numbers appear first) |
127+ | ` group ` | ` string ` | ` null ` | Group name for organizing apps |
128+ | ` icon ` | ` string ` | ` "/icon/amazon-q.svg" ` | Icon to display in UI |
123129
124130### Default System Prompt
125131
126132The module includes a comprehensive system prompt that instructs Amazon Q:
133+
127134```
128135You are a helpful Coding assistant. Aim to autonomously investigate
129136and solve issues the user gives you and test your work, whenever possible.
@@ -157,7 +164,6 @@ Task summaries MUST:
157164
158165You can customize this behavior by providing your own system prompt via the ` system_prompt ` variable.
159166
160-
161167## Default Agent Configuration
162168
163169The module includes a default agent configuration template that provides a comprehensive setup for Amazon Q integration:
@@ -168,17 +174,9 @@ The module includes a default agent configuration template that provides a compr
168174 "description" : " This is an default agent config" ,
169175 "prompt" : " ${system_prompt}" ,
170176 "mcpServers" : {},
171- "tools" : [
172- " fs_read" ,
173- " fs_write" ,
174- " execute_bash" ,
175- " use_aws" ,
176- " knowledge"
177- ],
177+ "tools" : [" fs_read" , " fs_write" , " execute_bash" , " use_aws" , " knowledge" ],
178178 "toolAliases" : {},
179- "allowedTools" : [
180- " fs_read"
181- ],
179+ "allowedTools" : [" fs_read" ],
182180 "resources" : [
183181 " file://AmazonQ.md" ,
184182 " file://README.md" ,
@@ -233,14 +231,14 @@ module "amazon-q" {
233231 version = "2.0.0"
234232 agent_id = coder_agent.example.id
235233 auth_tarball = var.amazon_q_auth_tarball
236-
234+
237235 pre_install_script = <<-EOT
238236 #!/bin/bash
239237 echo "Setting up custom environment..."
240238 # Install additional dependencies
241239 sudo apt-get update && sudo apt-get install -y zstd
242240 EOT
243-
241+
244242 post_install_script = <<-EOT
245243 #!/bin/bash
246244 echo "Configuring Amazon Q settings..."
@@ -254,12 +252,12 @@ module "amazon-q" {
254252
255253``` tf
256254module "amazon-q" {
257- source = "registry.coder.com/coder/amazon-q/coder"
258- version = "2.0.0"
259- agent_id = coder_agent.example.id
260- auth_tarball = var.amazon_q_auth_tarball
261- amazon_q_version = "1.14.0" # Specific version
262- install_amazon_q = true
255+ source = "registry.coder.com/coder/amazon-q/coder"
256+ version = "2.0.0"
257+ agent_id = coder_agent.example.id
258+ auth_tarball = var.amazon_q_auth_tarball
259+ amazon_q_version = "1.14.0" # Specific version
260+ install_amazon_q = true
263261}
264262```
265263
@@ -271,7 +269,7 @@ module "amazon-q" {
271269 version = "2.0.0"
272270 agent_id = coder_agent.example.id
273271 auth_tarball = var.amazon_q_auth_tarball
274-
272+
275273 agent_config = jsonencode({
276274 name = "custom-agent"
277275 description = "Custom Amazon Q agent for my workspace"
@@ -289,16 +287,14 @@ module "amazon-q" {
289287 version = "2.0.0"
290288 agent_id = coder_agent.example.id
291289 auth_tarball = var.amazon_q_auth_tarball
292-
290+
293291 # UI configuration
294292 order = 1
295293 group = "AI Tools"
296294 icon = "/icon/custom-amazon-q.svg"
297295}
298296```
299297
300-
301-
302298## Architecture
303299
304300### Components
@@ -331,6 +327,7 @@ module "amazon-q" {
331327### Common Issues
332328
333329** Amazon Q not found after installation:**
330+
334331``` bash
335332# Check if Amazon Q is in PATH
336333which q
@@ -339,18 +336,21 @@ export PATH="$PATH:$HOME/.local/bin"
339336```
340337
341338** Authentication issues:**
339+
342340- Regenerate the auth tarball on your local machine
343341- Ensure the tarball is properly base64 encoded
344342- Check that the original authentication is still valid
345343
346344** MCP integration not working:**
345+
347346- Verify that AgentAPI is installed (` install_agentapi = true ` )
348347- Check that the Coder agent is properly configured
349348- Review the system prompt configuration
350349
351350### Debug Mode
352351
353352Enable verbose logging by setting environment variables:
353+
354354``` bash
355355export DEBUG=1
356356export VERBOSE=1
0 commit comments