Skip to content

connection_pool_config is said to be optional for aws_db_proxy_default_target_group resource, but result in a fail if absent #16285

@Porkepix

Description

@Porkepix

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.5

  • provider registry.terraform.io/hashicorp/aws v3.15.0

Affected Resource(s)

  • aws_db_proxy_default_target_group

Terraform Configuration Files

resource "aws_db_proxy_default_target_group" "rds-proxy-default-target-group" {
  db_proxy_name = aws_db_proxy.rds-proxy.name

  # connection_pool_config {
    # connection_borrow_timeout    = 120
    # init_query                   = "SET x=1, y=2"
    # max_connections_percent      = 100
    # max_idle_connections_percent = 50
    # session_pinning_filters      = ["EXCLUDE_VARIABLE_SETS"]
 #  }
}

Expected Behavior

The documentation at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_proxy_default_target_group state that connection_pool_config is optional. This means we should be able to declare the resource with only required arguments, ie. only db_proxy_name.

However, not setting it result in this kind of error:

Error: Required attribute is not set

  on rds_proxy.tf line 92, in resource "aws_db_proxy_default_target_group" "rds-proxy-default-target-group":
  92: resource "aws_db_proxy_default_target_group" "rds-proxy-default-target-group" {

Declaring the block, even empty makes terraform able to pass.
Therefore, either the documentation have to be corrected to correctly state what's required or not, either the code shouldn't fail if optional arguments are not provided.

Steps to Reproduce

Pick documentation's example about aws_db_proxy_default_target_group but get rid of everythings marked as optional (ie. everything excepted the db_proxy_name)

Metadata

Metadata

Assignees

Labels

bugAddresses a defect in current functionality.service/rdsIssues and PRs that pertain to the rds service.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions