Skip to content

Conversation

fvazquez20
Copy link
Contributor

@fvazquez20 fvazquez20 commented Jun 30, 2025

Description

This PR fixes the way EKS pod properties are referenced in the aws_batch_job_definition resource in main.tf.
The module previously accessed attributes like dns_policy, host_network, image_pull_secrets, etc. from eks_properties.value.pod_properties, but according to the variable definition, these should be accessed directly from eks_properties.value.

Motivation and Context

This change is required to align the module implementation with the variable structure defined in variables.tf.
It solves errors like:

│ Error: Unsupported attribute
│   on .../main.tf line 455, in resource "aws_batch_job_definition" "this":
│  455:         dns_policy   = eks_properties.value.pod_properties.dns_policy
│     ├────────────────
│     │ eks_properties.value.pod_properties is object with 1 attribute "containers"
│ 
│ This object does not have an attribute named "dns_policy".

and similar errors for other attributes.

Breaking Changes

No breaking changes. This PR only corrects attribute references to match the documented variable structure.

How Has This Been Tested?

Used a minimal EKS job definition with pod properties and confirmed that the job definition is created successfully.
Verified that the AWS Console displays the "Pod Properties" tab and all configured properties.

@bryantbiggs bryantbiggs changed the title fix aws batch job definitions EKS Properties Structure fix: Remove erroneous pod_properties scoping from job definition variable attribute structure Jul 1, 2025
Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, thats not great - but thank you for fixing!

@bryantbiggs bryantbiggs merged commit 7c8becf into terraform-aws-modules:master Jul 1, 2025
7 of 8 checks passed
antonbabenko pushed a commit that referenced this pull request Jul 1, 2025
## [3.0.2](v3.0.1...v3.0.2) (2025-07-01)

### Bug Fixes

* Remove erroneous `pod_properties` scoping from job definition variable attribute structure ([#45](#45)) ([7c8becf](7c8becf))
@antonbabenko
Copy link
Member

This PR is included in version 3.0.2 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix AWS Batch Job Definition EKS Properties Structure
4 participants