<commit_before>module "ec2" {
    source = "../ec2"
    
    app_name                = "${var.app_name}"
    instance_type           = "${var.instance_type}"
    ecs_aws_ami             = "${var.ecs_aws_ami}"
    security_group_id       = "${module.network.sg_elb_to_app_id}"
    iam_instance_profile    = "${module.iam_roles.ecs_instance_profile_arn}"
    ecs_cluster_name        = "${aws_ecs_cluster.cluster_development.name}"
    max_size                = "${var.max_size}"
    min_size                = "${var.min_size}"
    desired_capacity        = "${var.desired_capacity}"
    private_subnet_ids      = "${module.network.private_subnet_ids}"
}

module "network" {
    source = "../network"

    app_name                = "${var.app_name}"
    vpc_cidr                = "${var.vpc_cidr}"
    public_subnet_cidrs     = "${var.public_subnet_cidrs}"
    private_subnet_cidrs    = "${var.private_subnet_cidrs}"
    availibility_zones      = "${var.availibility_zones}"
}

module "iam_roles" {
    source = "../iam_roles"

    app_name                = "${var.app_name}"
}

module "alb" {
    source = "../alb"

    route53_name            = "${var.route53_name}"
    vpc_id                  = "${module.network.vpc_id}"
    app_name                = "${var.app_name}"
    security_group_id       = "${module.network.elb_https_http_id}"
    public_subnet_ids       = "${module.network.public_subnet_ids}"
    certificate_arn         = "${var.certificate_arn}"
}

resource "aws_ecs_cluster" "cluster_development" {
    name = "${var.app_name}_development"
}

resource "aws_ecs_cluster" "cluster_test" {
    name = "${var.app_name}_test"
}

resource "aws_ecs_cluster" "cluster_production" {
    name = "${var.app_name}_production"
}

# Simply specify the family to find the latest ACTIVE revision in that family.
data "aws_ecs_task_definition" "hello" {
  task_definition = "${aws_ecs_task_definition.hello.family}"
}

resource "aws_ecs_task_definition" "hello" {
  family = "development"

  container_definitions = <<DEFINITION
[
  {
    "cpu": 128,
    "environment": [{
      "name": "SECRET",
      "value": "KEY"
    }],
    "portMappings": [
        {
          "hostPort": 0,
          "containerPort": 8080,
          "protocol": "tcp"
        }
      ],
    "essential": true,
    "image": "gazgeek/springboot-helloworld",
    "memory": 256,
    "name": "development"
  }
]<commit_msg>set docker images and env variable on task definition<commit_after>module "ec2" {
    source = "../ec2"
    
    app_name                = "${var.app_name}"
    instance_type           = "${var.instance_type}"
    ecs_aws_ami             = "${var.ecs_aws_ami}"
    security_group_id       = "${module.network.sg_elb_to_app_id}"
    iam_instance_profile    = "${module.iam_roles.ecs_instance_profile_arn}"
    ecs_cluster_name        = "${aws_ecs_cluster.cluster_development.name}"
    max_size                = "${var.max_size}"
    min_size                = "${var.min_size}"
    desired_capacity        = "${var.desired_capacity}"
    private_subnet_ids      = "${module.network.private_subnet_ids}"
}

module "network" {
    source = "../network"

    app_name                = "${var.app_name}"
    vpc_cidr                = "${var.vpc_cidr}"
    public_subnet_cidrs     = "${var.public_subnet_cidrs}"
    private_subnet_cidrs    = "${var.private_subnet_cidrs}"
    availibility_zones      = "${var.availibility_zones}"
}

module "iam_roles" {
    source = "../iam_roles"

    app_name                = "${var.app_name}"
}

module "alb" {
    source = "../alb"

    route53_name            = "${var.route53_name}"
    vpc_id                  = "${module.network.vpc_id}"
    app_name                = "${var.app_name}"
    security_group_id       = "${module.network.elb_https_http_id}"
    public_subnet_ids       = "${module.network.public_subnet_ids}"
    certificate_arn         = "${var.certificate_arn}"
}

resource "aws_ecs_cluster" "cluster_development" {
    name = "${var.app_name}_development"
}

resource "aws_ecs_cluster" "cluster_test" {
    name = "${var.app_name}_test"
}

resource "aws_ecs_cluster" "cluster_production" {
    name = "${var.app_name}_production"
}

# Simply specify the family to find the latest ACTIVE revision in that family.
data "aws_ecs_task_definition" "hello" {
  task_definition = "${aws_ecs_task_definition.hello.family}"
}

resource "aws_ecs_task_definition" "hello" {
  family = "development"

  container_definitions = <<DEFINITION
[
  {
    "cpu": 128,
    "environment": [{
      "name": "ENV",
      "value": "development"
    }],
    "portMappings": [
        {
          "hostPort": 0,
          "containerPort": 8080,
          "protocol": "tcp"
        }
      ],
    "essential": true,
    "image": "156161676080.dkr.ecr.eu-central-1.amazonaws.com/hello-world",
    "memory": 256,
    "name": "development"
  }
]
{'fraction_non_alphanumeric': 0.1408595517170471, 'fraction_numerical': 0.009664815957228049, 'mean_word_length': 2.514450867052023, 'pattern_counts': {'":': 24, '<': 7, '<?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': '3491582', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1638, 'n_words': 252}