Skip to content

Conversation

bryantbiggs
Copy link
Member

Description

  • Remove empty containers (map/list) from container definition

Motivation and Context

relates to hashicorp/terraform-provider-aws#17988

Breaking Changes

  • No

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Deploying the complete example from master and then changing to this PR produces the following desired diff
image

description = "Container restart policy; helps overcome transient failures faster and maintain task availability"
type = object({
enabled = optional(bool)
enabled = optional(bool, true)
Copy link
Member Author

Choose a reason for hiding this comment

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

repositoryCredentials = var.repositoryCredentials
resourceRequirements = var.resourceRequirements
restartPolicy = { for k, v in var.restartPolicy : k => v if v != null }
restartPolicy = local.trimmedRestartPolicy.enabled ? local.trimmedRestartPolicy : null
Copy link
Member Author

Choose a reason for hiding this comment

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

if enabled = false then we don't send any configs for restartPolicy to the Task Definition API call

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

If it works, LGTM :)

@bryantbiggs bryantbiggs merged commit 24746cc into master Aug 7, 2025
12 checks passed
antonbabenko pushed a commit that referenced this pull request Aug 7, 2025
## [6.2.0](v6.1.4...v6.2.0) (2025-08-07)

### Features

* Remove empty containers (map/list) from container definition ([#336](#336)) ([24746cc](24746cc))
@bryantbiggs bryantbiggs deleted the chore/more-container-def branch August 7, 2025 14:55
@antonbabenko
Copy link
Member

This PR is included in version 6.2.0 🎉

Copy link

github-actions bot commented Sep 7, 2025

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 Sep 7, 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.

ECS Fargate with Windows Containers does not support Restart Policy
2 participants