UTI: PoC - Make detailed hover information copyable
[csit.git] / fdio.infra.terraform / terraform-aws-fdio-csit-dash-env / main.tf
1 data "vault_generic_secret" "fdio_docs" {
2   path = "kv/secret/data/etl/fdio_docs"
3 }
4
5 data "vault_aws_access_credentials" "creds" {
6   backend = "${var.vault_name}-path"
7   role    = "${var.vault_name}-role"
8 }
9
10 module "elastic_beanstalk_application" {
11   source = "../terraform-aws-elastic-beanstalk-application"
12
13   # application
14   application_description                    = "FD.io CSIT Results Dashboard"
15   application_name                           = "fdio-csit-dash-app"
16   appversion_lifecycle_service_role_arn      = ""
17   appversion_lifecycle_max_count             = 2
18   appversion_lifecycle_delete_source_from_s3 = false
19 }
20
21 module "elastic_beanstalk_environment" {
22   source = "../terraform-aws-elastic-beanstalk-environment"
23
24   # vpc
25   vpc_cidr_block           = "192.168.0.0/24"
26   vpc_enable_dns_hostnames = true
27   vpc_enable_dns_support   = true
28   vpc_instance_tenancy     = "default"
29
30   # subnet
31   subnet_availability_zone = "us-east-1a"
32
33   # environment
34   environment_application            = module.elastic_beanstalk_application.application_name
35   environment_description            = module.elastic_beanstalk_application.application_description
36   environment_name                   = "fdio-csit-dash-env"
37   environment_solution_stack_name    = "64bit Amazon Linux 2 v3.3.11 running Python 3.8"
38   environment_tier                   = "WebServer"
39   environment_wait_for_ready_timeout = "20m"
40   environment_version_label          = ""
41
42   # aws:ec2:instances
43   instances_instance_types = "t3a.xlarge"
44
45   # aws:ec2:vpc
46   associate_public_ip_address = true
47   elb_scheme                  = "public"
48
49   # aws:elbv2:listener:default
50   default_listener_enabled = true
51
52   # aws:elasticbeanstalk:environment
53   environment_loadbalancer_type = "network"
54
55   # aws:elasticbeanstalk:environment:process:default
56   environment_process_default_healthcheck_interval      = 10
57   environment_process_default_healthy_threshold_count   = 3
58   environment_process_default_port                      = 5000
59   environment_process_default_unhealthy_threshold_count = 3
60
61   # aws:elasticbeanstalk:healthreporting:system
62   healthreporting_system_type = "enhanced"
63
64   # aws:elasticbeanstalk:managedactions
65   managedactions_managed_actions_enabled = true
66   managedactions_preferred_start_time    = "Sun:10:00"
67
68   # aws:elasticbeanstalk:managedactions:platformupdate
69   managedactions_platformupdate_update_level             = "minor"
70   managedactions_platformupdate_instance_refresh_enabled = true
71
72   # aws:autoscaling:asg
73   autoscaling_asg_minsize = 1
74   autoscaling_asg_maxsize = 2
75
76   # aws:autoscaling:trigger
77   autoscaling_trigger_measure_name                 = "CPUUtilization"
78   autoscaling_trigger_statistic                    = "Average"
79   autoscaling_trigger_unit                         = "Percent"
80   autoscaling_trigger_lower_threshold              = 20
81   autoscaling_trigger_lower_breach_scale_increment = -1
82   autoscaling_trigger_upper_threshold              = 80
83   autoscaling_trigger_upper_breach_scale_increment = 1
84
85   # aws:elasticbeanstalk:hostmanager
86   hostmanager_log_publication_control = true
87
88   # aws:elasticbeanstalk:cloudwatch:logs
89   cloudwatch_logs_stream_logs         = true
90   cloudwatch_logs_delete_on_terminate = true
91   cloudwatch_logs_retention_in_days   = 3
92
93   # aws:elasticbeanstalk:cloudwatch:logs:health
94   cloudwatch_logs_health_health_streaming_enabled = true
95   cloudwatch_logs_health_delete_on_terminate      = true
96   cloudwatch_logs_health_retention_in_days        = 3
97
98   environment_type = "LoadBalanced"
99
100   # aws:elasticbeanstalk:application:environment
101   environment_variables = {
102     "AWS_ACCESS_KEY_ID"     = data.vault_generic_secret.fdio_docs.data["access_key"]
103     "AWS_SECRET_ACCESS_KEY" = data.vault_generic_secret.fdio_docs.data["secret_key"]
104     "AWS_DEFAULT_REGION"    = data.vault_generic_secret.fdio_docs.data["region"]
105   }
106 }