<commit_before># I intentionally do not set the spot_price value because it defaults to the
# on-demand price. Based on my experience, this means I'm paying more than the
# average spot price. However, unless spot prices increase beyond the on-demand
# price, this will always be fulfilled.
resource "aws_spot_instance_request" "gaming" {
  count         = var.enable

  ami           = data.aws_ami.gaming.id
  ebs_optimized = "false"
  instance_type = "g4dn.xlarge"
  key_name      = "primary"
  subnet_id     = data.aws_subnet.main.id

  # Wait until the spot request is fulfilled. This should be fairly quick, so
  # if it takes a long time (minutes), then it should indicate a potential spot
  # instance shortage.
  wait_for_fulfillment = true

  # This allows me to take a snapshot of the instance and delete the
  # provisioned volume.
  #
  # Note: if you shut a *spot* instance down from the operating system, it will
  # terminate the instance. The only way to prevent this is to stop spot
  # instances from outside the OS, such as the AWS console or CLI.
  instance_initiated_shutdown_behavior = "stop"

  # Do not request another instance fulfilment after this instance is
  # terminated.
  #<commit_msg>enable ebs optimization regardless of instance type<commit_after># I intentionally do not set the spot_price value because it defaults to the
# on-demand price. Based on my experience, this means I'm paying more than the
# average spot price. However, unless spot prices increase beyond the on-demand
# price, this will always be fulfilled.
resource "aws_spot_instance_request" "gaming" {
  count         = var.enable

  ami           = data.aws_ami.gaming.id
  ebs_optimized = "true"
  instance_type = "g4dn.xlarge"
  key_name      = "primary"
  subnet_id     = data.aws_subnet.main.id

  # Wait until the spot request is fulfilled. This should be fairly quick, so
  # if it takes a long time (minutes), then it should indicate a potential spot
  # instance shortage.
  wait_for_fulfillment = true

  # This allows me to take a snapshot of the instance and delete the
  # provisioned volume.
  #
  # Note: if you shut a *spot* instance down from the operating system, it will
  # terminate the instance. The only way to prevent this is to stop spot
  # instances from outside the OS, such as the AWS console or CLI.
  instance_initiated_shutdown_behavior = "stop"

  # Do not request another instance fulfilment after this instance is
  # terminated.
  #
{'fraction_non_alphanumeric': 0.058228871815608575, 'fraction_numerical': 0.0008087343307723412, 'mean_word_length': 3.5228519195612433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7130998', 'n_tokens_mistral': 714, 'n_tokens_neox': 677, 'n_words': 320}