-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: aws_ecs_task_definition incorrectly adds appProtocol to empty portMappings #38779
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
@ewbankkit as FYI, I see the Do you know offhand whether that PR could have caused new fields to get added to the portMappings in addition to any camelCase updates? Thanks! |
@mball-agathos Thanks for raising this issue 👏. |
Hi @ewbankkit I haven't worked out a minimal configuration, but from looking at the example provided at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition and removing extra stuff, I get something like this:
The key part here is that the The
Notice the inserted |
Also, it looks like this will also reproduce the error (i.e., using
|
Its not an empty list then. Why would you want to add an empty port mapping object rather than just having a zero size list? AKA
|
In my particular case, the ultimate portMappings was generated via this logic:
This particular code will end up generating All said, I've finished writing this particular logic on my side to avoid generating an empty object and we've been able to move on, but I do expect that a subset of existing users will run into a similar problem if they have similar generator logic for their port mappings. |
Verified that this is a change in behavior between v5.58.0 and v5.62.0: v5.58.0
v5.62.0
Relates #38016. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.63.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.5.7
AWS Provider Version
5.61.0
Affected Resource(s)
aws_ecs_task_definition
Expected Behavior
When creating a new task definition with portMapping set to an empty list, it should stay an empty list during the
terraform plan
phase.Actual Behavior
I see this
terraform plan
(with a few unrelated changes removed):In particular, this provider is now inserting the
appProtocol
andprotocol
attributes into what should have been an emptyportMappings
list.This then triggers an error later about an "Invalid 'containerPort'" because this portMapping is no longer empty.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
n/a
Steps to Reproduce
Create a new ecs task definition with
portMappings: []
Debug Output
No response
Panic Output
No response
Important Factoids
This is a regression. This used to work correctly in aws version 5.56.1. This broke sometime between that version and 5.61.0
References
No response
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: