You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: update db_proxy module with latest AWS provider arguments (#46)
* Update db_proxy module with latest AWS provider arguments
Add new auth block fields (client_password_auth_type, username), support SQL Server engine family, and update version constraints to Terraform 1.3+ and AWS provider 5.0+. These changes align the module with the latest Terraform AWS provider capabilities and prepare for wider database engine support.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* docs: Update README with latest module changes
Auto-generated documentation reflecting updated auth block fields, version constraints, and SQL Server support.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Use dynamic client_password_auth_type based on engine_family
The client_password_auth_type must match the engine_family - MySQL uses MYSQL_NATIVE_PASSWORD, PostgreSQL uses POSTGRES_SCRAM_SHA_256, and SQL Server uses SQL_SERVER_AUTHENTICATION.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
** This file was automatically generated by the `cloudposse/build-harness`.
17
20
** 1) Make all changes to `README.yaml`
18
-
** 2) Run `make init` (you only need to do this once)
19
-
** 3) Run`make readme` to rebuild this file.
21
+
** 2) Install [atmos](https://atmos.tools/install/) (you only need to do this once)
22
+
** 3) Run`atmos readme` to rebuild this file.
20
23
**
21
24
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
22
25
**
@@ -47,6 +50,7 @@ Terraform module to provision an Amazon [RDS Proxy](https://docs.aws.amazon.com/
47
50
48
51
## Usage
49
52
53
+
50
54
For a complete example, see [examples/complete](examples/complete).
51
55
52
56
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest)
@@ -187,14 +191,14 @@ Review the [complete example](examples/complete) to see how to use this module.
| <aname="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map)| Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br/>This is for some rare cases where resources want additional configuration of tags<br/>and therefore take a list of maps with tag key, value, and additional configuration. |`map(string)`|`{}`| no |
226
230
| <aname="input_attributes"></a> [attributes](#input\_attributes)| ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br/>in the order they appear in the list. New attributes are appended to the<br/>end of the list. The elements of the list are joined by the `delimiter`<br/>and treated as a single ID element. |`list(string)`|`[]`| no |
227
-
| <aname="input_auth"></a> [auth](#input\_auth)| Configuration blocks with authorization mechanisms to connect to the associated database instances or clusters | <pre>list(object({<br/> auth_scheme = string<br/> description = string<br/> iam_auth = string<br/> secret_arn = string<br/> }))</pre> | n/a | yes |
231
+
| <a name="input_auth"></a> [auth](#input\_auth) | Configuration blocks with authorization mechanisms to connect to the associated database instances or clusters.<br/>- `auth_scheme` - The type of authentication that the proxy uses for connections from the proxy to the underlying database. Valid values are `SECRETS`.<br/>- `client_password_auth_type` - The type of authentication the proxy uses for connections from clients. Valid values are `MYSQL_NATIVE_PASSWORD`, `POSTGRES_SCRAM_SHA_256`, `POSTGRES_MD5`, and `SQL_SERVER_AUTHENTICATION`.<br/>- `description` - A user-specified description about the authentication used by a proxy to log in as a specific database user.<br/>- `iam_auth` - Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy. Valid values are `DISABLED`, `REQUIRED`.<br/>- `secret_arn` - The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster.<br/>- `username` - The name of the database user to which the proxy connects. Note: `username` must NOT be set when `auth_scheme` is `SECRETS`. | <pre>list(object({<br/> auth_scheme = optional(string, "SECRETS")<br/> client_password_auth_type = optional(string)<br/> description = optional(string)<br/> iam_auth = optional(string, "DISABLED")<br/> secret_arn = optional(string)<br/> username = optional(string)<br/> }))</pre> | n/a | yes |
228
232
| <aname="input_connection_borrow_timeout"></a> [connection\_borrow\_timeout](#input\_connection\_borrow\_timeout)| The number of seconds for a proxy to wait for a connection to become available in the connection pool. Only applies when the proxy has opened its maximum number of connections and all connections are busy with client sessions |`number`|`120`| no |
229
233
| <aname="input_context"></a> [context](#input\_context)| Single object for setting entire context at once.<br/>See description of individual variables for details.<br/>Leave string and numeric variables as `null` to use default value.<br/>Individual variable settings (non-null) override settings in context object,<br/>except for attributes, tags, and additional\_tag\_map, which are merged. |`any`| <pre>{<br/> "additional_tag_map": {},<br/> "attributes": [],<br/> "delimiter": null,<br/> "descriptor_formats": {},<br/> "enabled": true,<br/> "environment": null,<br/> "id_length_limit": null,<br/> "label_key_case": null,<br/> "label_order": [],<br/> "label_value_case": null,<br/> "labels_as_tags": [<br/> "unset"<br/> ],<br/> "name": null,<br/> "namespace": null,<br/> "regex_replace_chars": null,<br/> "stage": null,<br/> "tags": {},<br/> "tenant": null<br/>}</pre> | no |
230
234
| <aname="input_db_cluster_identifier"></a> [db\_cluster\_identifier](#input\_db\_cluster\_identifier)| DB cluster identifier. Either `db_instance_identifier` or `db_cluster_identifier` should be specified and both should not be specified together |`string`|`null`| no |
@@ -233,7 +237,7 @@ Review the [complete example](examples/complete) to see how to use this module.
233
237
| <aname="input_delimiter"></a> [delimiter](#input\_delimiter)| Delimiter to be used between ID elements.<br/>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. |`string`|`null`| no |
234
238
| <aname="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats)| Describe additional descriptors to be output in the `descriptors` output map.<br/>Map of maps. Keys are names of descriptors. Values are maps of the form<br/>`{<br/> format = string<br/> labels = list(string)<br/>}`<br/>(Type is `any` so the map values can later be enhanced to provide additional options.)<br/>`format` is a Terraform format string to be passed to the `format()` function.<br/>`labels` is a list of labels, in order, to pass to `format()` function.<br/>Label values will be normalized before being passed to `format()` so they will be<br/>identical to how they appear in `id`.<br/>Default is `{}` (`descriptors` output will be empty). |`any`|`{}`| no |
235
239
| <aname="input_enabled"></a> [enabled](#input\_enabled)| Set to false to prevent the module from creating any resources |`bool`|`null`| no |
236
-
| <aname="input_engine_family"></a> [engine\_family](#input\_engine\_family)| The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. The engine family applies to MySQL and PostgreSQL for both RDS and Aurora. Valid values are MYSQLand POSTGRESQL|`string`|`"MYSQL"`| no |
240
+
| <aname="input_engine_family"></a> [engine\_family](#input\_engine\_family)| The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. Valid values are `MYSQL`, `POSTGRESQL`, and `SQLSERVER`|`string`|`"MYSQL"`| no |
237
241
| <aname="input_environment"></a> [environment](#input\_environment)| ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' |`string`|`null`| no |
238
242
| <aname="input_existing_iam_role_arn"></a> [existing\_iam\_role\_arn](#input\_existing\_iam\_role\_arn)| The ARN of an existing IAM role that the proxy can use to access secrets in AWS Secrets Manager. If not provided, the module will create a role to access secrets in Secrets Manager |`string`|`null`| no |
239
243
| <aname="input_iam_role_attributes"></a> [iam\_role\_attributes](#input\_iam\_role\_attributes)| Additional attributes to add to the ID of the IAM role that the proxy uses to access secrets in AWS Secrets Manager |`list(string)`|`null`| no |
@@ -335,7 +339,8 @@ Check out these related projects.
335
339
> -**Customer Workshops.** Engage with our team in weekly workshops, gaining insights and strategies to continuously improve and innovate.
@@ -361,6 +366,38 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
361
366
362
367
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
363
368
369
+
370
+
## Running Terraform Tests
371
+
372
+
We use [Atmos](https://atmos.tools) to streamline how Terraform tests are run. It centralizes configuration and wraps common test workflows with easy-to-use commands.
373
+
374
+
All tests are located in the [`test/`](test) folder.
375
+
376
+
Under the hood, tests are powered by Terratest together with our internal [Test Helpers](https://github.com/cloudposse/test-helpers) library, providing robust infrastructure validation.
- Install Go [1.24+ or newer](https://go.dev/doc/install)
381
+
- Install Terraform or OpenTofu
382
+
383
+
To run tests:
384
+
385
+
- Run all tests:
386
+
```sh
387
+
atmos test run
388
+
```
389
+
- Clean up test artifacts:
390
+
```sh
391
+
atmos test clean
392
+
```
393
+
- Explore additional test options:
394
+
```sh
395
+
atmos test --help
396
+
```
397
+
The configuration for test commands is centrally managed. To review what's being imported, see the [`atmos.yaml`](https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/terraform-module.yaml) file.
398
+
399
+
Learn more about our [automated testing in our documentation](https://docs.cloudposse.com/community/contribute/automated-testing/) or implementing [custom commands](https://atmos.tools/core-concepts/custom-commands/) with atmos.
400
+
364
401
### 🌎 Slack Community
365
402
366
403
Join our [Open Source Community](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-rds-db-proxy&utm_content=slack) on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
Copy file name to clipboardExpand all lines: examples/complete/variables.tf
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ variable "debug_logging" {
100
100
variable"engine_family" {
101
101
type=string
102
102
default="MYSQL"
103
-
description="The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. The engine family applies to MySQL and PostgreSQL for both RDS and Aurora. Valid values are MYSQLand POSTGRESQL"
103
+
description="The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. Valid values are `MYSQL`, `POSTGRESQL`, and `SQLSERVER`"
Copy file name to clipboardExpand all lines: variables.tf
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,12 @@ variable "debug_logging" {
7
7
variable"engine_family" {
8
8
type=string
9
9
default="MYSQL"
10
-
description="The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. The engine family applies to MySQL and PostgreSQL for both RDS and Aurora. Valid values are MYSQL and POSTGRESQL"
10
+
description="The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. Valid values are `MYSQL`, `POSTGRESQL`, and `SQLSERVER`"
error_message="Valid values for engine_family are MYSQL, POSTGRESQL, and SQLSERVER."
15
+
}
11
16
}
12
17
13
18
variable"idle_client_timeout" {
@@ -34,12 +39,22 @@ variable "vpc_subnet_ids" {
34
39
35
40
variable"auth" {
36
41
type=list(object({
37
-
auth_scheme =string
38
-
description =string
39
-
iam_auth =string
40
-
secret_arn =string
42
+
auth_scheme =optional(string, "SECRETS")
43
+
client_password_auth_type =optional(string)
44
+
description =optional(string)
45
+
iam_auth =optional(string, "DISABLED")
46
+
secret_arn =optional(string)
47
+
username =optional(string)
41
48
}))
42
-
description="Configuration blocks with authorization mechanisms to connect to the associated database instances or clusters"
49
+
description=<<-EOT
50
+
Configuration blocks with authorization mechanisms to connect to the associated database instances or clusters.
51
+
- `auth_scheme` - The type of authentication that the proxy uses for connections from the proxy to the underlying database. Valid values are `SECRETS`.
52
+
- `client_password_auth_type` - The type of authentication the proxy uses for connections from clients. Valid values are `MYSQL_NATIVE_PASSWORD`, `POSTGRES_SCRAM_SHA_256`, `POSTGRES_MD5`, and `SQL_SERVER_AUTHENTICATION`.
53
+
- `description` - A user-specified description about the authentication used by a proxy to log in as a specific database user.
54
+
- `iam_auth` - Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy. Valid values are `DISABLED`, `REQUIRED`.
55
+
- `secret_arn` - The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster.
56
+
- `username` - The name of the database user to which the proxy connects. Note: `username` must NOT be set when `auth_scheme` is `SECRETS`.
0 commit comments