code: def deploy_stack(
      stack_name: str,
      template_body: str,
      keypair: str,
      boto3_session: boto3.session.Session,
      no_prompt: bool,
      deployment_type: str,
      extra_tags: Optional[List[Tuple[str, str]]],
      parameters: Optional[List] = None,
      update_terminate_agents: bool = True,
  ) -> None:
      cfn = boto3_session.client("cloudformation")
      cfn.validate_template(TemplateBody=template_body)
  
      check_keypair(keypair, boto3_session)
      if stack_exists(stack_name, boto3_session):
          print("True - Updating Stack")
  
          if not no_prompt:
              tags = get_tags(stack_name, boto3_session)
              prompt_needed = False
              if constants.deployment_types.TYPE_TAG_KEY not in tags:
                  print()
                  print(
                      "Previous value of --deployment-type is unknown. Versions of `det` prior to"
                  )
                  print(
                      "0.17.3 did not annotate deployed clusters, and it was the responsibility of"
                  )
                  print(
                      "the user to make updates with the same --deployment-type. Note that if you"
                  )
                  print(
                      "are sure --deployment-type was not set before, your cluster would have"
                  )
                  print(
                      "deployed as --deployment-type simple (the default)."
                  )
                  print()
  
                  prompt_needed = True
              elif (
                  tags[constants.deployment_types.TYPE_TAG_KEY]
                  != deployment_type
              ):
                  print("Value of --deployment-type has changed!")
                  prompt_needed = True
  
              if prompt_needed:
                  val = input(
                      "If --deployment-type has changed, updating the stack may erase the database.\n"
                      "Are you sure you want to proceed? [y/N]"
                  )
                  if val.lower() != "y":
                      print("Update canceled.")
                      sys.exit(1)
  
          update_stack(
              stack_name,
              template_body,
              boto3_session,
              deployment_type,
              extra_tags,
              parameters,
              update_terminate_agents=update_terminate_agents,
          )
      else:
          print("False - Creating Stack")
  
          create_stack(
              stack_name,
              template_body,
              boto3_session,
              deployment_type,
              extra_tags,
              parameters,
          )
  
imports: import sys
  import threading
  import time
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import boto3
  import tqdm
  from botocore.exceptions import ClientError, WaiterError
  from determined.deploy.aws import constants
label_desc: Use image node_id 15 for calling a global function with example usage: deploy_stack(stack_name, template_body, keypair, boto3_session, no_prompt, deployment_type, extra_tags, parameters, update_terminate_agents) without return types