Skip to content

Commit

Permalink
Adding timeouts while updating,deleting or creating proxy (#9)
Browse files Browse the repository at this point in the history
* adding timeouts for when proxy is created

* Auto Format

* ci(Mergify): configuration update

Signed-off-by: null <[email protected]>

* Update variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Update variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Update examples/complete/variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Update examples/complete/variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Update examples/complete/variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Update variables.tf

Co-authored-by: Andriy Knysh <[email protected]>

* Auto Format

* Update main.tf

* Auto Format

* Update main.tf

* Auto Format

Signed-off-by: null <[email protected]>
Co-authored-by: Amrutha <[email protected]>
Co-authored-by: cloudpossebot <[email protected]>
Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
4 people authored Sep 14, 2022
1 parent ac5f706 commit 5a5d540
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ version-resolver:
- 'bugfix'
- 'bug'
- 'hotfix'
- 'no-release'
default: 'minor'

categories:
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ Available targets:
| <a name="input_max_idle_connections_percent"></a> [max\_idle\_connections\_percent](#input\_max\_idle\_connections\_percent) | Controls how actively the proxy closes idle database connections in the connection pool. A high value enables the proxy to leave a high percentage of idle connections open. A low value causes the proxy to close idle client connections and return the underlying database connections to the connection pool | `number` | `50` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
| <a name="input_proxy_create_timeout"></a> [proxy\_create\_timeout](#input\_proxy\_create\_timeout) | Proxy creation timeout | `string` | `"30m"` | no |
| <a name="input_proxy_delete_timeout"></a> [proxy\_delete\_timeout](#input\_proxy\_delete\_timeout) | Proxy delete timeout | `string` | `"60m"` | no |
| <a name="input_proxy_update_timeout"></a> [proxy\_update\_timeout](#input\_proxy\_update\_timeout) | Proxy update timeout | `string` | `"30m"` | no |
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
| <a name="input_require_tls"></a> [require\_tls](#input\_require\_tls) | A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy | `bool` | `false` | no |
| <a name="input_session_pinning_filters"></a> [session\_pinning\_filters](#input\_session\_pinning\_filters) | Each item in the list represents a class of SQL operations that normally cause all later statements in a session using a proxy to be pinned to the same underlying database connection | `list(string)` | `null` | no |
Expand Down Expand Up @@ -490,7 +493,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]

<!-- markdownlint-disable -->
[logo]: https://cloudposse.com/logo-300x69.svg
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-rds-db-proxy&utm_content=docs
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-rds-db-proxy&utm_content=website
Expand Down Expand Up @@ -521,3 +524,4 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-rds-db-proxy
[share_email]: mailto:?subject=terraform-aws-rds-db-proxy&body=https://github.com/cloudposse/terraform-aws-rds-db-proxy
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-rds-db-proxy?pixel&cs=github&cm=readme&an=terraform-aws-rds-db-proxy
<!-- markdownlint-restore -->
3 changes: 3 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
| <a name="input_max_idle_connections_percent"></a> [max\_idle\_connections\_percent](#input\_max\_idle\_connections\_percent) | Controls how actively the proxy closes idle database connections in the connection pool. A high value enables the proxy to leave a high percentage of idle connections open. A low value causes the proxy to close idle client connections and return the underlying database connections to the connection pool | `number` | `50` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
| <a name="input_proxy_create_timeout"></a> [proxy\_create\_timeout](#input\_proxy\_create\_timeout) | Proxy creation timeout | `string` | `"30m"` | no |
| <a name="input_proxy_delete_timeout"></a> [proxy\_delete\_timeout](#input\_proxy\_delete\_timeout) | Proxy delete timeout | `string` | `"60m"` | no |
| <a name="input_proxy_update_timeout"></a> [proxy\_update\_timeout](#input\_proxy\_update\_timeout) | Proxy update timeout | `string` | `"30m"` | no |
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
| <a name="input_require_tls"></a> [require\_tls](#input\_require\_tls) | A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy | `bool` | `false` | no |
| <a name="input_session_pinning_filters"></a> [session\_pinning\_filters](#input\_session\_pinning\_filters) | Each item in the list represents a class of SQL operations that normally cause all later statements in a session using a proxy to be pinned to the same underlying database connection | `list(string)` | `null` | no |
Expand Down
4 changes: 4 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ module "rds_proxy" {
session_pinning_filters = var.session_pinning_filters
existing_iam_role_arn = var.existing_iam_role_arn

proxy_create_timeout = var.proxy_create_timeout
proxy_update_timeout = var.proxy_update_timeout
proxy_delete_timeout = var.proxy_delete_timeout

context = module.this.context
}
17 changes: 17 additions & 0 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,20 @@ variable "existing_iam_role_arn" {
default = null
description = "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"
}

variable "proxy_create_timeout" {
type = string
default = "30m"
description = "Proxy create timeout"
}

variable "proxy_update_timeout" {
type = string
default = "30m"
description = "Proxy update timeout"
}
variable "proxy_delete_timeout" {
type = string
default = "60m"
description = "Proxy delete timeout"
}
6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ resource "aws_db_proxy" "this" {
}

tags = module.this.tags

timeouts {
create = var.proxy_create_timeout
update = var.proxy_update_timeout
delete = var.proxy_delete_timeout
}
}

resource "aws_db_proxy_default_target_group" "this" {
Expand Down
17 changes: 17 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,20 @@ variable "kms_key_id" {
default = null
description = "The ARN or Id of the AWS KMS customer master key (CMK) to encrypt the secret values in the versions stored in secrets. If you don't specify this value, then Secrets Manager defaults to using the AWS account's default CMK (the one named `aws/secretsmanager`)"
}

variable "proxy_create_timeout" {
type = string
default = "30m"
description = "Proxy creation timeout"
}

variable "proxy_update_timeout" {
type = string
default = "30m"
description = "Proxy update timeout"
}
variable "proxy_delete_timeout" {
type = string
default = "60m"
description = "Proxy delete timeout"
}

0 comments on commit 5a5d540

Please sign in to comment.