1 data "vault_generic_secret" "fdio_docs" {
2 path = "kv/secret/data/etl/fdio_docs"
5 data "vault_aws_access_credentials" "creds" {
6 backend = "${var.vault_name}-path"
7 role = "${var.vault_name}-role"
10 module "elastic_beanstalk_application" {
11 source = "../terraform-aws-elastic-beanstalk-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
21 module "elastic_beanstalk_environment" {
22 source = "../terraform-aws-elastic-beanstalk-environment"
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"
31 subnet_availability_zone = "eu-central-1a"
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.4.0 running Python 3.8"
38 environment_tier = "WebServer"
39 environment_wait_for_ready_timeout = "25m"
40 environment_version_label = ""
43 instances_instance_types = "t3a.medium"
46 associate_public_ip_address = true
49 # aws:elbv2:listener:default
50 default_listener_enabled = true
52 # aws:elasticbeanstalk:environment
53 environment_loadbalancer_type = "network"
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
61 # aws:autoscaling:updatepolicy:rollingupdate
62 autoscaling_updatepolicy_rolling_update_enabled = true
63 autoscaling_updatepolicy_rolling_update_type = "Immutable"
64 autoscaling_updatepolicy_min_instance_in_service = 1
66 # aws:elasticbeanstalk:command
67 command_deployment_policy = "Rolling"
69 # aws:autoscaling:updatepolicy:rollingupdate
70 updatepolicy_max_batch_size = 1
72 # aws:elasticbeanstalk:healthreporting:system
73 healthreporting_system_type = "enhanced"
75 # aws:elasticbeanstalk:managedactions
76 managedactions_managed_actions_enabled = true
77 managedactions_preferred_start_time = "Sun:10:00"
79 # aws:elasticbeanstalk:managedactions:platformupdate
80 managedactions_platformupdate_update_level = "minor"
81 managedactions_platformupdate_instance_refresh_enabled = true
84 autoscaling_asg_minsize = 1
85 autoscaling_asg_maxsize = 2
87 # aws:autoscaling:trigger
88 autoscaling_trigger_measure_name = "CPUUtilization"
89 autoscaling_trigger_statistic = "Average"
90 autoscaling_trigger_unit = "Percent"
91 autoscaling_trigger_lower_threshold = 20
92 autoscaling_trigger_lower_breach_scale_increment = -1
93 autoscaling_trigger_upper_threshold = 80
94 autoscaling_trigger_upper_breach_scale_increment = 1
96 # aws:elasticbeanstalk:hostmanager
97 hostmanager_log_publication_control = true
99 # aws:elasticbeanstalk:cloudwatch:logs
100 cloudwatch_logs_stream_logs = true
101 cloudwatch_logs_delete_on_terminate = true
102 cloudwatch_logs_retention_in_days = 3
104 # aws:elasticbeanstalk:cloudwatch:logs:health
105 cloudwatch_logs_health_health_streaming_enabled = true
106 cloudwatch_logs_health_delete_on_terminate = true
107 cloudwatch_logs_health_retention_in_days = 3
109 environment_type = "LoadBalanced"
111 # aws:elasticbeanstalk:application:environment
112 environment_variables = {
113 "AWS_ACCESS_KEY_ID" = data.vault_generic_secret.fdio_docs.data["access_key"]
114 "AWS_SECRET_ACCESS_KEY" = data.vault_generic_secret.fdio_docs.data["secret_key"]
115 "AWS_DEFAULT_REGION" = data.vault_generic_secret.fdio_docs.data["region"]