<commit_before># ------------ inputs ----------------------

variable "name" {
    description = "The name of the launch configuration."
    default = "Experimental Launch Configuration"
}

variable "image_id" {
    description = "The EC2 image ID to launch."
}

variable "instance_type" {
    description = "The size of instance to launch."
    default = "t2.micro"
}

variable "instance_profile" {
    description = "The IAM instance profile to associate with launched instances."
    default = ""
}

variable "key_name" {
    description = "The key name that should be used for the instance."
}

variable "security_groups" {
    description = "A list of associated security group IDs."
    default = ""
}

variable "associate_public_ip" {
    description = "Associate a public ip address with an instance in a VPC."
    default = "true"
}

variable "user_data" {
    description = "The user data to provide when launching the instance."
    default = ""
}

variable "ebs_optimized" {
    description = "If true, the launched EC2 instance will be EBS-optimized."
    default = "true"
}

variable "spot_price" {
    description = "The price to use for reserving spot instances."
    default = ""
}

# ------------ resources ----------------------

resource "aws_launch_configuration" "alc" {
    name = "${var.name}"
    image_id = "${var.image_id}"
    instance_type = "${var.instance_type}"
    iam_instance_profile = "${var.instance_profile}"
    key_name = "${var.key_name}"
    security_groups = ["${split(",", var.security_groups)}"]
    associate_public_ip_address = "${var.associate_public_ip}"
    user_data = "${var.user_data}"
    enable_monitoring = "${var.user_data}"
    ebs_optimized = "${var.ebs_optimized}"
    spot_price = "${var.spot_price}"
#   root_block_device = ???
#   ebs_block_device = ???
#   ephemeral_block_device = ???

    lifecycle { create_before_destroy = true }<commit_msg>Do not try and create a new one before destroying the old one.  Causes name collisions<commit_after># ------------ inputs ----------------------

variable "name" {
    description = "The name of the launch configuration."
    default = "Experimental Launch Configuration"
}

variable "image_id" {
    description = "The EC2 image ID to launch."
}

variable "instance_type" {
    description = "The size of instance to launch."
    default = "t2.micro"
}

variable "instance_profile" {
    description = "The IAM instance profile to associate with launched instances."
    default = ""
}

variable "key_name" {
    description = "The key name that should be used for the instance."
}

variable "security_groups" {
    description = "A list of associated security group IDs."
    default = ""
}

variable "associate_public_ip" {
    description = "Associate a public ip address with an instance in a VPC."
    default = "true"
}

variable "user_data" {
    description = "The user data to provide when launching the instance."
    default = ""
}

variable "ebs_optimized" {
    description = "If true, the launched EC2 instance will be EBS-optimized."
    default = "true"
}

variable "spot_price" {
    description = "The price to use for reserving spot instances."
    default = ""
}

# ------------ resources ----------------------

resource "aws_launch_configuration" "alc" {
    name = "${var.name}"
    image_id = "${var.image_id}"
    instance_type = "${var.instance_type}"
    iam_instance_profile = "${var.instance_profile}"
    key_name = "${var.key_name}"
    security_groups = ["${split(",", var.security_groups)}"]
    associate_public_ip_address = "${var.associate_public_ip}"
    user_data = "${var.user_data}"
    enable_monitoring = "${var.user_data}"
    ebs_optimized = "${var.ebs_optimized}"
    spot_price = "${var.spot_price}"
#   root_block_device = ???
#   ebs_block_device = ???
#   ephemeral_block_device = ???

#   lifecycle { create_before_destroy = true }
{'fraction_non_alphanumeric': 0.1485479311231046, 'fraction_numerical': 0.0015420200462606013, 'mean_word_length': 3.153681963713981, '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': '3741629', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1138, 'n_words': 335}