diff --git a/plugins/modules/ecs_taskdefinition.py b/plugins/modules/ecs_taskdefinition.py index 4c4aefc2032..36e07112c9e 100644 --- a/plugins/modules/ecs_taskdefinition.py +++ b/plugins/modules/ecs_taskdefinition.py @@ -897,6 +897,8 @@ def register_task( params["placementConstraints"] = placement_constraints if runtime_platform: params["runtimePlatform"] = runtime_platform + if launch_type != "FARGATE": + params["runtimePlatform"] = {} try: response = self.ecs.register_task_definition(aws_retry=True, **params)