Skip to content

Commit

Permalink
fix: Disable endpoint creation when setting create_proxy = false (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
fatmcgav-depop and bryantbiggs authored Aug 10, 2022
1 parent 8c1720c commit 26724ab
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.68.1
rev: v1.74.1
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand All @@ -23,7 +23,7 @@ repos:
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
2 changes: 1 addition & 1 deletion examples/mysql_iam_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "rds_proxy" {
}

secrets = {
"${local.db_username}" = {
(local.db_username) = {
description = aws_secretsmanager_secret.superuser.description
arn = aws_secretsmanager_secret.superuser.arn
kms_key_id = aws_secretsmanager_secret.superuser.kms_key_id
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql_iam_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "rds_proxy" {
}

secrets = {
"${local.db_username}" = {
(local.db_username) = {
description = aws_secretsmanager_secret.superuser.description
arn = aws_secretsmanager_secret.superuser.arn
kms_key_id = aws_secretsmanager_secret.superuser.kms_key_id
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql_iam_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "rds_proxy" {
}

secrets = {
"${local.db_username}" = {
(local.db_username) = {
description = aws_secretsmanager_secret.superuser.description
arn = aws_secretsmanager_secret.superuser.arn
kms_key_id = aws_secretsmanager_secret.superuser.kms_key_id
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql_iam_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "rds_proxy" {
}

secrets = {
"${local.db_username}" = {
(local.db_username) = {
description = aws_secretsmanager_secret.superuser.description
arn = aws_secretsmanager_secret.superuser.arn
kms_key_id = aws_secretsmanager_secret.superuser.kms_key_id
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "aws_db_proxy_target" "db_cluster" {
}

resource "aws_db_proxy_endpoint" "this" {
for_each = var.db_proxy_endpoints
for_each = { for k, v in var.db_proxy_endpoints : k => v if var.create_proxy }

db_proxy_name = aws_db_proxy.this[0].name
db_proxy_endpoint_name = each.value.name
Expand Down

0 comments on commit 26724ab

Please sign in to comment.