-
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
Suppress task definition diffs for equivalent port mappings. #5833
Conversation
When using the `awsvpc` networking mode, aws assigns the value of `containerPort` to the `hostPort` for each item in `portMappings`. This leads to spurious diffs if the user doesn't set `hostPort`. This patch suppresses diffs when using `awsvpc` networking and the `hostPort` field is unset. [Fixes hashicorp#3401]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and ignoring my testing nitpick. Thanks, @jmcarp 🚀
--- PASS: TestAccAWSEcsTaskDefinition_constraint (4.42s)
--- PASS: TestAccAWSEcsTaskDefinition_arrays (4.61s)
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (4.63s)
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (7.05s)
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (7.11s)
--- PASS: TestAccAWSEcsTaskDefinition_basic (7.51s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (7.80s)
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (7.80s)
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (11.02s)
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (12.07s)
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (42.81s)
@@ -649,7 +654,7 @@ TASK_DEFINITION | |||
`, tdName) | |||
} | |||
|
|||
func testAccAWSEcsTaskDefinitionFargate(tdName string) string { | |||
func testAccAWSEcsTaskDefinitionFargate(tdName, portMappings string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: It'd be much better if this was a separate test and test configuration as it does not pertain to the basic functionality of the resource with Fargate
This has been released in version 1.36.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
When using the
awsvpc
networking mode, aws assigns the value ofcontainerPort
to thehostPort
for each item inportMappings
. Thisleads to spurious diffs if the user doesn't set
hostPort
. This patchsuppresses diffs when using
awsvpc
networking and thehostPort
fieldis unset.
[Fixes #3401]