<commit_before>resource "aws_instance" "bastion" {
  ami = "${ var.ami-id }"
  associate_public_ip_address = true
  iam_instance_profile = "${ aws_iam_instance_profile.bastion.name }"
  instance_type = "${ var.instance-type }"
  key_name = "${ var.key-name }"

  security_groups = [
    "${ var.security-group-id }",
  ]

  source_dest_check = false
  subnet_id = "${ element( split(",", var.subnet-ids), 0 ) }"

  tags  {
    Name = "bastion"
    Cluster = "${ var.name }"
    Role = "bastion"
    builtWith = "terraform"
  }

  /*user_data = "${ var.user-data }"*/
  user_data = <<EOF
#cloud-config

---
coreos:
  update:
    reboot-strategy: etcd-lock

  etcd2:
    discovery-srv: k8s
    proxy: on

  units:
    - name: etcd2.service
      command: start
    - name: s3-iam-get.service
      command: start
      content: |
        [Unit]
        Description=s3-iam-get
        [Service]
        Type=oneshot
        RemainAfterExit=yes
        ExecStartPre=-/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/curl -L -o /opt/bin/s3-iam-get \
          https://raw.githubusercontent.com/kz8s/s3-iam-get/master/s3-iam-get
        ExecStart=/usr/bin/chmod +x /opt/bin/s3-iam-get
EOF
}
<commit_msg>added: todo: force private_ip on bastion to avoid collisions with etcd turnup<commit_after>resource "aws_instance" "bastion" {
  ami = "${ var.ami-id }"
  associate_public_ip_address = true
  iam_instance_profile = "${ aws_iam_instance_profile.bastion.name }"
  instance_type = "${ var.instance-type }"
  key_name = "${ var.key-name }"

  # TODO: force private_ip to prevent collision with etcd machines

  security_groups = [
    "${ var.security-group-id }",
  ]

  source_dest_check = false
  subnet_id = "${ element( split(",", var.subnet-ids), 0 ) }"

  tags  {
    Name = "bastion"
    Cluster = "${ var.name }"
    Role = "bastion"
    builtWith = "terraform"
  }

  /*user_data = "${ var.user-data }"*/
  user_data = <<EOF
#cloud-config

---
coreos:
  update:
    reboot-strategy: etcd-lock

  etcd2:
    discovery-srv: k8s
    proxy: on

  units:
    - name: etcd2.service
      command: start
    - name: s3-iam-get.service
      command: start
      content: |
        [Unit]
        Description=s3-iam-get
        [Service]
        Type=oneshot
        RemainAfterExit=yes
        ExecStartPre=-/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/curl -L -o /opt/bin/s3-iam-get \
          https://raw.githubusercontent.com/kz8s/s3-iam-get/master/s3-iam-get
        ExecStart=/usr/bin/chmod +x /opt/bin/s3-iam-get
EOF
}

{'fraction_non_alphanumeric': 0.14634146341463414, 'fraction_numerical': 0.00865460267505901, 'mean_word_length': 2.4411366711772664, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6474348', 'n_tokens_mistral': 963, 'n_tokens_neox': 936, 'n_words': 164}