Skip to content

Commit 75fd523

Browse files
committed
Add aws-cli module for ausbru87 namespace
1 parent 5564a55 commit 75fd523

File tree

7 files changed

+98
-443
lines changed

7 files changed

+98
-443
lines changed
-57.6 KB
Binary file not shown.

registry/ausbru87/README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
---
2-
display_name: "Austen Bruhn"
3-
bio: "Software engineer and cloud infrastructure enthusiast"
4-
avatar: "./.images/avatar.png"
5-
github: "ausbru87"
6-
status: "community"
2+
display_name: ausbru87
3+
bio: Brief description of what this namespace provides
4+
github: your-github-username
5+
avatar: ./.images/avatar.svg
6+
linkedin: https://www.linkedin.com/in/your-profile
7+
website: https://your-website.com
8+
status: community
79
---
810

9-
# Austen Bruhn
11+
# ausbru87
1012

11-
Software engineer and cloud infrastructure enthusiast, contributing modules to help developers work more efficiently with cloud services.
13+
Brief description of what this namespace provides. Include information about:
14+
15+
- What types of templates/modules you offer
16+
- Your focus areas (e.g., specific cloud providers, technologies)
17+
- Any special features or configurations
18+
19+
## Templates
20+
21+
List your available templates here:
22+
23+
- **template-name**: Brief description
24+
25+
## Modules
26+
27+
List your available modules here:
28+
29+
- **module-name**: Brief description
30+
31+
## Contributing
32+
33+
If you'd like to contribute to this namespace, please [open an issue](https://github.com/coder/registry/issues) or submit a pull request.
Lines changed: 17 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,57 @@
11
---
22
display_name: AWS CLI
3-
description: Install the AWS Command Line Interface in your workspace
3+
description: Install AWS CLI v2 in your workspace
44
icon: ../../../../.icons/aws.svg
55
verified: false
6-
tags: [aws, cli, tools]
6+
tags: [helper, aws, cli]
77
---
88

99
# AWS CLI
1010

11-
Automatically install the [AWS Command Line Interface (CLI)](https://aws.amazon.com/cli/) in a Coder workspace. The AWS CLI is a unified tool to manage AWS services from the command line.
11+
Automatically install the [AWS CLI v2](https://aws.amazon.com/cli/) in your Coder workspace.
1212

1313
```tf
1414
module "aws-cli" {
1515
count = data.coder_workspace.me.start_count
16-
source = "registry.coder.com/modules/ausbru87/aws-cli"
16+
source = "registry.coder.com/ausbru87/aws-cli/coder"
1717
version = "1.0.0"
1818
agent_id = coder_agent.example.id
1919
}
2020
```
2121

22-
## Features
23-
24-
- ✅ Supports both x86_64 and ARM64 (aarch64) architectures
25-
- ✅ Automatic architecture detection
26-
- ✅ Install latest version or pin to a specific version
27-
- ✅ Optional GPG signature verification
28-
- ✅ Idempotent - skips installation if already present
29-
- ✅ Supports custom installation directories
30-
3122
## Examples
3223

33-
### Basic Installation (Latest Version)
34-
35-
Install the latest version of AWS CLI:
24+
### Basic Installation
3625

3726
```tf
3827
module "aws-cli" {
3928
count = data.coder_workspace.me.start_count
40-
source = "registry.coder.com/modules/ausbru87/aws-cli"
29+
source = "registry.coder.com/ausbru87/aws-cli/coder"
4130
version = "1.0.0"
4231
agent_id = coder_agent.example.id
4332
}
4433
```
4534

4635
### Pin to Specific Version
4736

48-
Install a specific version of AWS CLI for consistency across your team:
49-
5037
```tf
5138
module "aws-cli" {
52-
count = data.coder_workspace.me.start_count
53-
source = "registry.coder.com/modules/ausbru87/aws-cli"
54-
version = "1.0.0"
55-
agent_id = coder_agent.example.id
56-
57-
# Pin to AWS CLI version 2.15.0
58-
aws_cli_version = "2.15.0"
39+
count = data.coder_workspace.me.start_count
40+
source = "registry.coder.com/ausbru87/aws-cli/coder"
41+
version = "1.0.0"
42+
agent_id = coder_agent.example.id
43+
install_version = "2.15.0"
5944
}
6045
```
6146

62-
Note: Find available versions in the [AWS CLI v2 Changelog](https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst).
63-
64-
### Custom Installation Directory
65-
66-
Install AWS CLI to a custom directory (useful when you don't have sudo access):
47+
### Custom Log Path
6748

6849
```tf
6950
module "aws-cli" {
70-
count = data.coder_workspace.me.start_count
71-
source = "registry.coder.com/modules/ausbru87/aws-cli"
72-
version = "1.0.0"
73-
agent_id = coder_agent.example.id
74-
install_directory = "/home/coder/.local"
75-
}
76-
```
77-
78-
### Verify GPG Signature
79-
80-
Enable GPG signature verification for enhanced security:
81-
82-
```tf
83-
module "aws-cli" {
84-
count = data.coder_workspace.me.start_count
85-
source = "registry.coder.com/modules/ausbru87/aws-cli"
86-
version = "1.0.0"
87-
agent_id = coder_agent.example.id
88-
verify_signature = true
89-
}
90-
```
91-
92-
### Specify Architecture
93-
94-
Explicitly set the architecture (usually auto-detected):
95-
96-
```tf
97-
module "aws-cli" {
98-
count = data.coder_workspace.me.start_count
99-
source = "registry.coder.com/modules/ausbru87/aws-cli"
100-
version = "1.0.0"
101-
agent_id = coder_agent.example.id
102-
architecture = "aarch64" # or "x86_64"
51+
count = data.coder_workspace.me.start_count
52+
source = "registry.coder.com/ausbru87/aws-cli/coder"
53+
version = "1.0.0"
54+
agent_id = coder_agent.example.id
55+
log_path = "/var/log/aws-cli.log"
10356
}
10457
```
105-
106-
## Configuration
107-
108-
After installing AWS CLI, users will need to configure their AWS credentials. This can be done using:
109-
110-
```bash
111-
aws configure
112-
```
113-
114-
Or by setting environment variables:
115-
116-
```bash
117-
export AWS_ACCESS_KEY_ID="your-access-key-id"
118-
export AWS_SECRET_ACCESS_KEY="your-secret-access-key"
119-
export AWS_DEFAULT_REGION="us-east-1"
120-
```
121-
122-
For more information, see the [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html).
123-
124-
## Variables
125-
126-
| Name | Description | Default | Required |
127-
| ------------------- | ----------------------------------------------------------------------------------------- | ------------ | -------- |
128-
| `agent_id` | The ID of a Coder agent | - | Yes |
129-
| `aws_cli_version` | The version of AWS CLI to install (leave empty for latest) | `""` | No |
130-
| `install_directory` | The directory to install AWS CLI to | `/usr/local` | No |
131-
| `architecture` | The architecture to install AWS CLI for (`x86_64` or `aarch64`, empty for auto-detection) | `""` | No |
132-
| `verify_signature` | Whether to verify the GPG signature of the downloaded installer | `false` | No |
133-
134-
## Outputs
135-
136-
| Name | Description |
137-
| ----------------- | ----------------------------------------------------------------------------------- |
138-
| `aws_cli_version` | The version of AWS CLI that was installed (or 'latest' if no version was specified) |
139-
140-
## Requirements
141-
142-
- Linux operating system (x86_64 or ARM64)
143-
- `curl` for downloading the installer
144-
- `unzip` for extracting the installer
145-
- `sudo` access (if installing to system directories like `/usr/local`)
146-
- Optional: `gpg` (if using signature verification)
147-
148-
## Supported Platforms
149-
150-
- Amazon Linux 1 & 2
151-
- CentOS
152-
- Fedora
153-
- Ubuntu
154-
- Debian
155-
- Any Linux distribution with glibc, groff, and less
156-
157-
## Notes
158-
159-
- The module is idempotent - if AWS CLI is already installed with the correct version, it will skip the installation
160-
- When no version is specified, the latest version will be installed
161-
- The installer automatically creates a symlink at `/usr/local/bin/aws` (or `$INSTALL_DIRECTORY/bin/aws`)
162-
- Architecture is automatically detected based on `uname -m` if not explicitly specified

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

Lines changed: 5 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,112 +6,20 @@ run "required_vars" {
66
}
77
}
88

9-
run "with_version" {
9+
run "with_custom_version" {
1010
command = plan
1111

1212
variables {
13-
agent_id = "test-agent-id"
14-
aws_cli_version = "2.15.0"
15-
}
16-
17-
assert {
18-
condition = resource.coder_script.aws-cli.script != ""
19-
error_message = "coder_script must have a valid script"
20-
}
21-
}
22-
23-
run "custom_install_directory" {
24-
command = plan
25-
26-
variables {
27-
agent_id = "test-agent-id"
28-
install_directory = "/home/coder/.local"
29-
}
30-
31-
assert {
32-
condition = resource.coder_script.aws-cli.script != ""
33-
error_message = "coder_script must have a valid script"
34-
}
35-
}
36-
37-
run "architecture_validation_x86_64" {
38-
command = plan
39-
40-
variables {
41-
agent_id = "test-agent-id"
42-
architecture = "x86_64"
43-
}
44-
45-
assert {
46-
condition = resource.coder_script.aws-cli.script != ""
47-
error_message = "coder_script must have a valid script"
48-
}
49-
}
50-
51-
run "architecture_validation_aarch64" {
52-
command = plan
53-
54-
variables {
55-
agent_id = "test-agent-id"
56-
architecture = "aarch64"
57-
}
58-
59-
assert {
60-
condition = resource.coder_script.aws-cli.script != ""
61-
error_message = "coder_script must have a valid script"
13+
agent_id = "test-agent-id"
14+
install_version = "2.15.0"
6215
}
6316
}
6417

65-
run "architecture_validation_invalid" {
66-
command = plan
67-
68-
variables {
69-
agent_id = "test-agent-id"
70-
architecture = "invalid"
71-
}
72-
73-
expect_failures = [
74-
var.architecture
75-
]
76-
}
77-
78-
run "verify_signature" {
79-
command = plan
80-
81-
variables {
82-
agent_id = "test-agent-id"
83-
verify_signature = true
84-
}
85-
86-
assert {
87-
condition = resource.coder_script.aws-cli.script != ""
88-
error_message = "coder_script must have a valid script"
89-
}
90-
}
91-
92-
run "output_version_default" {
18+
run "with_custom_log_path" {
9319
command = plan
9420

9521
variables {
9622
agent_id = "test-agent-id"
97-
}
98-
99-
assert {
100-
condition = output.aws_cli_version == "latest"
101-
error_message = "output version should be 'latest' when no version is specified"
102-
}
103-
}
104-
105-
run "output_version_specified" {
106-
command = plan
107-
108-
variables {
109-
agent_id = "test-agent-id"
110-
aws_cli_version = "2.15.0"
111-
}
112-
113-
assert {
114-
condition = output.aws_cli_version == "2.15.0"
115-
error_message = "output version should match the specified version"
23+
log_path = "/var/log/aws-cli.log"
11624
}
11725
}

registry/ausbru87/modules/aws-cli/main.test.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)