Skip to content

Commit

Permalink
feat: Add support for eks_configuration (#32)
Browse files Browse the repository at this point in the history
* Add eks_configuration to compute_environment

* Fix formatting

To adhere to suggestions in https://github.com/terraform-aws-modules/terraform-aws-batch/actions/runs/10355161421/job/28731253912?pr=32

* chore: Update conditional logic

---------

Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
gallois and bryantbiggs authored Aug 19, 2024
1 parent 0ec188f commit b6aa7e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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.88.0
rev: v1.92.2
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand All @@ -24,7 +24,7 @@ repos:
- '--args=--only=terraform_unused_required_providers'
- id: terraform_validate
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
Expand Down
9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ resource "aws_batch_compute_environment" "this" {
}
}

dynamic "eks_configuration" {
for_each = try([each.value.eks_configuration], [])

content {
eks_cluster_arn = eks_configuration.value.eks_cluster_arn
kubernetes_namespace = eks_configuration.value.kubernetes_namespace
}
}

# Prevent a race condition during environment deletion, otherwise the policy may be destroyed
# too soon and the compute environment will then get stuck in the `DELETING` state
depends_on = [aws_iam_role_policy_attachment.service]
Expand Down

0 comments on commit b6aa7e1

Please sign in to comment.