Skip to content

Commit 6ba3699

Browse files
committed
Add download_url parameter for airgapped environment support
1 parent 2039c39 commit 6ba3699

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

registry/ausbru87/modules/aws-cli/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ module "aws-cli" {
6262
log_path = "/var/log/aws-cli.log"
6363
}
6464
```
65+
66+
### Airgapped Environment
67+
68+
Use a custom download URL for environments without internet access to AWS:
69+
70+
```tf
71+
module "aws-cli" {
72+
count = data.coder_workspace.me.start_count
73+
source = "registry.coder.com/ausbru87/aws-cli/coder"
74+
version = "1.0.0"
75+
agent_id = coder_agent.example.id
76+
download_url = "https://internal-mirror.company.com/awscli-exe-linux-x86_64.zip"
77+
}
78+
```

registry/ausbru87/modules/aws-cli/aws-cli.tftest.hcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ run "with_custom_log_path" {
2323
log_path = "/var/log/aws-cli.log"
2424
}
2525
}
26+
27+
run "with_custom_download_url" {
28+
command = plan
29+
30+
variables {
31+
agent_id = "test-agent-id"
32+
download_url = "https://internal-mirror.company.com/awscli-exe-linux-x86_64.zip"
33+
}
34+
}

registry/ausbru87/modules/aws-cli/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ variable "install_version" {
2020
default = ""
2121
}
2222

23+
variable "download_url" {
24+
type = string
25+
description = "Custom download URL for AWS CLI. Useful for airgapped environments. If not set, uses the official AWS download URL."
26+
default = ""
27+
}
28+
2329
variable "log_path" {
2430
type = string
2531
description = "The path to the AWS CLI installation log file."
@@ -33,6 +39,7 @@ resource "coder_script" "aws-cli" {
3339
script = templatefile("${path.module}/run.sh", {
3440
LOG_PATH : var.log_path,
3541
VERSION : var.install_version,
42+
DOWNLOAD_URL : var.download_url,
3643
})
3744
run_on_start = true
3845
run_on_stop = false

0 commit comments

Comments
 (0)