# Buggy code
def main():
    argument_spec = ec2_argument_spec()
    argument_spec.update(
        dict(
            deregistration_delay_timeout=dict(type="int"),
            health_check_protocol=dict(
                choices=["http", "https", "tcp", "HTTP", "HTTPS", "TCP"]
            ),
            health_check_port=dict(),
            health_check_path=dict(),
            health_check_interval=dict(type="int"),
            health_check_timeout=dict(type="int"),
            healthy_threshold_count=dict(type="int"),
            modify_targets=dict(default=True, type="bool"),
            name=dict(required=True),
            port=dict(type="int"),
            protocol=dict(choices=["http", "https", "tcp", "HTTP", "HTTPS", "TCP"]),
            purge_tags=dict(default=True, type="bool"),
            stickiness_enabled=dict(type="bool"),
            stickiness_type=dict(default="lb_cookie"),
            stickiness_lb_cookie_duration=dict(type="int"),
            state=dict(required=True, choices=["present", "absent"]),
            successful_response_codes=dict(),
            tags=dict(default={}, type="dict"),
            target_type=dict(default="instance", choices=["instance", "ip"]),
            targets=dict(type="list"),
            unhealthy_threshold_count=dict(type="int"),
            vpc_id=dict(),
            wait_timeout=dict(type="int"),
            wait=dict(type="bool"),
        )
    )

    module = AnsibleAWSModule(
        argument_spec=argument_spec,
        required_if=[["state", "present", ["protocol", "port", "vpc_id"]]],
    )

    connection = module.client("elbv2")

    if module.params.get("state") == "present":
        create_or_update_target_group(connection, module)
    else:
        delete_target_group(connection, module)


# Traceback (TypeError)
The full traceback is:
Traceback (most recent call last):
File "/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_5ak5igpc/ansible_module_elb_target_group.py", line 705, in <module>
main()
File "/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_5ak5igpc/ansible_module_elb_target_group.py", line 699, in main
create_or_update_target_group(connection, module)
File "/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_5ak5igpc/ansible_module_elb_target_group.py", line 579, in create_or_update_target_group
status_achieved, registered_instances = wait_for_status(connection, module, tg['TargetGroupArn'], params['Targets'], 'healthy')
File "/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_5ak5igpc/ansible_module_elb_target_group.py", line 349, in wait_for_status
max_retries = (module.params.get('wait_timeout') // polling_increment_secs)
TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'

# Fixed code
def main():
    argument_spec = ec2_argument_spec()
    argument_spec.update(
        dict(
            deregistration_delay_timeout=dict(type="int"),
            health_check_protocol=dict(
                choices=["http", "https", "tcp", "HTTP", "HTTPS", "TCP"]
            ),
            health_check_port=dict(),
            health_check_path=dict(),
            health_check_interval=dict(type="int"),
            health_check_timeout=dict(type="int"),
            healthy_threshold_count=dict(type="int"),
            modify_targets=dict(default=True, type="bool"),
            name=dict(required=True),
            port=dict(type="int"),
            protocol=dict(choices=["http", "https", "tcp", "HTTP", "HTTPS", "TCP"]),
            purge_tags=dict(default=True, type="bool"),
            stickiness_enabled=dict(type="bool"),
            stickiness_type=dict(default="lb_cookie"),
            stickiness_lb_cookie_duration=dict(type="int"),
            state=dict(required=True, choices=["present", "absent"]),
            successful_response_codes=dict(),
            tags=dict(default={}, type="dict"),
            target_type=dict(default="instance", choices=["instance", "ip"]),
            targets=dict(type="list"),
            unhealthy_threshold_count=dict(type="int"),
            vpc_id=dict(),
            wait_timeout=dict(type="int", default=200),
            wait=dict(type="bool", default=False),
        )
    )

    module = AnsibleAWSModule(
        argument_spec=argument_spec,
        required_if=[["state", "present", ["protocol", "port", "vpc_id"]]],
    )

    connection = module.client("elbv2")

    if module.params.get("state") == "present":
        create_or_update_target_group(connection, module)
    else:
        delete_target_group(connection, module)