|
1 | 1 | --- |
2 | 2 | display_name: AWS CLI |
3 | | -description: Install the AWS Command Line Interface in your workspace |
| 3 | +description: Install AWS CLI v2 in your workspace |
4 | 4 | icon: ../../../../.icons/aws.svg |
5 | 5 | verified: false |
6 | | -tags: [aws, cli, tools] |
| 6 | +tags: [helper, aws, cli] |
7 | 7 | --- |
8 | 8 |
|
9 | 9 | # AWS CLI |
10 | 10 |
|
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. |
12 | 12 |
|
13 | 13 | ```tf |
14 | 14 | module "aws-cli" { |
15 | 15 | 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" |
17 | 17 | version = "1.0.0" |
18 | 18 | agent_id = coder_agent.example.id |
19 | 19 | } |
20 | 20 | ``` |
21 | 21 |
|
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 | | - |
31 | 22 | ## Examples |
32 | 23 |
|
33 | | -### Basic Installation (Latest Version) |
34 | | - |
35 | | -Install the latest version of AWS CLI: |
| 24 | +### Basic Installation |
36 | 25 |
|
37 | 26 | ```tf |
38 | 27 | module "aws-cli" { |
39 | 28 | 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" |
41 | 30 | version = "1.0.0" |
42 | 31 | agent_id = coder_agent.example.id |
43 | 32 | } |
44 | 33 | ``` |
45 | 34 |
|
46 | 35 | ### Pin to Specific Version |
47 | 36 |
|
48 | | -Install a specific version of AWS CLI for consistency across your team: |
49 | | - |
50 | 37 | ```tf |
51 | 38 | 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" |
59 | 44 | } |
60 | 45 | ``` |
61 | 46 |
|
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 |
67 | 48 |
|
68 | 49 | ```tf |
69 | 50 | 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" |
103 | 56 | } |
104 | 57 | ``` |
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 |
0 commit comments