diff --git a/components/app/config/app_settings.yml b/components/app/config/app_settings.yml index 17427f8fe..4d3d81fdd 100644 --- a/components/app/config/app_settings.yml +++ b/components/app/config/app_settings.yml @@ -17,12 +17,12 @@ production: &production sentry_dsn: "<%= AppSettings.credentials.fetch('sentry_dsn') %>" ahn_core_password: "<%= ENV.fetch('AHN_CORE_PASSWORD') %>" ahn_http_password: "<%= AppSettings.credentials.fetch('ahn_http_password') %>" - call_platform_host: "https://api.somleng.org" + call_platform_host: "https://api.internal.somleng.org" call_platform_password: "<%= AppSettings.credentials.fetch('call_platform_password') %>" staging: <<: *production - call_platform_host: "https://api-staging.somleng.org" + call_platform_host: "https://api-staging.internal.somleng.org" development: &development <<: *default diff --git a/components/app/spec/lib/call_platform/client_spec.rb b/components/app/spec/lib/call_platform/client_spec.rb index 840a6618a..22fa45b51 100644 --- a/components/app/spec/lib/call_platform/client_spec.rb +++ b/components/app/spec/lib/call_platform/client_spec.rb @@ -6,9 +6,9 @@ module CallPlatform it "creates a media stream" do stub_request( :post, - "https://api.somleng.org/services/media_streams" + "https://api.internal.somleng.org/services/media_streams" ).to_return(body: { "sid" => "393a227f-0602-4024-b38a-dcbbeed4d5a0" }.to_json) - client = Client.new(http_client_options: { url: "https://api.somleng.org" }) + client = Client.new(http_client_options: { url: "https://api.internal.somleng.org" }) response = client.create_media_stream( url: "wss://example.com/audio", @@ -19,7 +19,7 @@ module CallPlatform ) expect(response.id).to eq("393a227f-0602-4024-b38a-dcbbeed4d5a0") - expect(WebMock).to(have_requested(:post, "https://api.somleng.org/services/media_streams").with { |request| + expect(WebMock).to(have_requested(:post, "https://api.internal.somleng.org/services/media_streams").with { |request| request_body = JSON.parse(request.body) expect(request_body).to eq( "url" => "wss://example.com/audio", diff --git a/infrastructure/modules/somleng_switch/switch.tf b/infrastructure/modules/somleng_switch/switch.tf index f2da41c6f..209123e8d 100644 --- a/infrastructure/modules/somleng_switch/switch.tf +++ b/infrastructure/modules/somleng_switch/switch.tf @@ -3,14 +3,14 @@ locals { } # Container Instances -module switch_container_instances { +module "switch_container_instances" { source = "../container_instances" - app_identifier = var.switch_identifier - vpc = var.vpc + app_identifier = var.switch_identifier + vpc = var.vpc instance_subnets = var.vpc.private_subnets - cluster_name = aws_ecs_cluster.cluster.name - max_capacity = var.switch_max_tasks * 2 + cluster_name = aws_ecs_cluster.cluster.name + max_capacity = var.switch_max_tasks * 2 } resource "aws_ecs_capacity_provider" "switch" { @@ -19,7 +19,7 @@ resource "aws_ecs_capacity_provider" "switch" { auto_scaling_group_provider { auto_scaling_group_arn = module.switch_container_instances.autoscaling_group.arn managed_termination_protection = "ENABLED" - managed_draining = "ENABLED" + managed_draining = "ENABLED" managed_scaling { maximum_scaling_step_size = 1000 @@ -32,27 +32,27 @@ resource "aws_ecs_capacity_provider" "switch" { # Log Groups resource "aws_cloudwatch_log_group" "switch_app" { - name = "${var.switch_identifier}-app" + name = "${var.switch_identifier}-app" retention_in_days = 7 } resource "aws_cloudwatch_log_group" "nginx" { - name = "${var.switch_identifier}-nginx" + name = "${var.switch_identifier}-nginx" retention_in_days = 7 } resource "aws_cloudwatch_log_group" "freeswitch" { - name = "${var.switch_identifier}-freeswitch" + name = "${var.switch_identifier}-freeswitch" retention_in_days = 7 } resource "aws_cloudwatch_log_group" "freeswitch_event_logger" { - name = "${var.switch_identifier}-freeswitch-event-logger" + name = "${var.switch_identifier}-freeswitch-event-logger" retention_in_days = 7 } resource "aws_cloudwatch_log_group" "redis" { - name = "${var.switch_identifier}-redis" + name = "${var.switch_identifier}-redis" retention_in_days = 7 } @@ -72,7 +72,7 @@ resource "aws_security_group_rule" "switch_ingress_http" { protocol = "TCP" from_port = 80 security_group_id = aws_security_group.switch.id - cidr_blocks = ["0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] } resource "aws_security_group_rule" "switch_ingress_freeswitch_event_socket" { @@ -81,7 +81,7 @@ resource "aws_security_group_rule" "switch_ingress_freeswitch_event_socket" { protocol = "TCP" from_port = 8021 security_group_id = aws_security_group.switch.id - cidr_blocks = [var.vpc.vpc_cidr_block] + cidr_blocks = [var.vpc.vpc_cidr_block] } resource "aws_security_group_rule" "switch_ingress_sip" { @@ -90,7 +90,7 @@ resource "aws_security_group_rule" "switch_ingress_sip" { protocol = "UDP" from_port = var.sip_port security_group_id = aws_security_group.switch.id - cidr_blocks = [var.vpc.vpc_cidr_block] + cidr_blocks = [var.vpc.vpc_cidr_block] } resource "aws_security_group_rule" "switch_ingress_sip_alternative" { @@ -99,7 +99,7 @@ resource "aws_security_group_rule" "switch_ingress_sip_alternative" { protocol = "UDP" from_port = var.sip_alternative_port security_group_id = aws_security_group.switch.id - cidr_blocks = [var.vpc.vpc_cidr_block] + cidr_blocks = [var.vpc.vpc_cidr_block] } resource "aws_security_group_rule" "switch_egress" { @@ -108,7 +108,7 @@ resource "aws_security_group_rule" "switch_egress" { protocol = "-1" from_port = 0 security_group_id = aws_security_group.switch.id - cidr_blocks = ["0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] } # SSM Parameters @@ -163,7 +163,7 @@ resource "aws_s3_bucket_lifecycle_configuration" "recordings" { bucket = aws_s3_bucket.recordings.id rule { - id = "rule-1" + id = "rule-1" status = "Enabled" expiration { @@ -177,7 +177,7 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "recordings" { rule { apply_server_side_encryption_by_default { - sse_algorithm = "aws:kms" + sse_algorithm = "aws:kms" } } } @@ -214,8 +214,8 @@ EOF data "aws_iam_policy_document" "ecs_task_assume_role_policy" { version = "2012-10-17" statement { - sid = "" - effect = "Allow" + sid = "" + effect = "Allow" actions = ["sts:AssumeRole"] principals { @@ -305,24 +305,24 @@ EOF } resource "aws_iam_role_policy_attachment" "ecs_task_custom_policy" { - role = aws_iam_role.ecs_task_role.id + role = aws_iam_role.ecs_task_role.id policy_arn = aws_iam_policy.ecs_task_policy.arn } resource "aws_iam_role_policy_attachment" "task_execution_custom_policy" { - role = aws_iam_role.task_execution_role.id + role = aws_iam_role.task_execution_role.id policy_arn = aws_iam_policy.task_execution_custom_policy.arn } resource "aws_iam_role_policy_attachment" "task_execution_role_policy" { - role = aws_iam_role.task_execution_role.id + role = aws_iam_role.task_execution_role.id policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy" } # EFS resource "aws_efs_file_system" "cache" { creation_token = var.efs_cache_name - encrypted = true + encrypted = true tags = { Name = var.efs_cache_name @@ -348,8 +348,8 @@ resource "aws_efs_backup_policy" "cache" { resource "aws_efs_mount_target" "cache" { for_each = toset(var.vpc.intra_subnets) - file_system_id = aws_efs_file_system.cache.id - subnet_id = each.value + file_system_id = aws_efs_file_system.cache.id + subnet_id = each.value security_groups = [aws_security_group.efs_cache.id] } @@ -366,9 +366,9 @@ resource "aws_security_group_rule" "efs_cache_ingress" { type = "ingress" protocol = "TCP" security_group_id = aws_security_group.efs_cache.id - cidr_blocks = [var.vpc.vpc_cidr_block] - from_port = 2049 - to_port = 2049 + cidr_blocks = [var.vpc.vpc_cidr_block] + from_port = 2049 + to_port = 2049 } # ECS @@ -376,43 +376,43 @@ data "template_file" "switch" { template = file("${path.module}/templates/switch.json.tpl") vars = { - name = var.switch_identifier - app_image = var.switch_app_image - nginx_image = var.nginx_image - freeswitch_image = var.freeswitch_image + name = var.switch_identifier + app_image = var.switch_app_image + nginx_image = var.nginx_image + freeswitch_image = var.freeswitch_image freeswitch_event_logger_image = var.freeswitch_event_logger_image - region = var.aws_region - application_master_key_parameter_arn = aws_ssm_parameter.switch_application_master_key.arn + region = var.aws_region + application_master_key_parameter_arn = aws_ssm_parameter.switch_application_master_key.arn freeswitch_event_socket_password_parameter_arn = aws_ssm_parameter.freeswitch_event_socket_password.arn - freeswitch_event_socket_port = var.freeswitch_event_socket_port + freeswitch_event_socket_port = var.freeswitch_event_socket_port - sip_port = var.sip_port + sip_port = var.sip_port sip_alternative_port = var.sip_alternative_port - nginx_logs_group = aws_cloudwatch_log_group.nginx.name - freeswitch_logs_group = aws_cloudwatch_log_group.freeswitch.name + nginx_logs_group = aws_cloudwatch_log_group.nginx.name + freeswitch_logs_group = aws_cloudwatch_log_group.freeswitch.name freeswitch_event_logger_logs_group = aws_cloudwatch_log_group.freeswitch_event_logger.name - app_logs_group = aws_cloudwatch_log_group.switch_app.name - redis_logs_group = aws_cloudwatch_log_group.redis.name - logs_group_region = var.aws_region - app_environment = var.app_environment + app_logs_group = aws_cloudwatch_log_group.switch_app.name + redis_logs_group = aws_cloudwatch_log_group.redis.name + logs_group_region = var.aws_region + app_environment = var.app_environment - rayo_password_parameter_arn = aws_ssm_parameter.rayo_password.arn - json_cdr_url = var.json_cdr_url + rayo_password_parameter_arn = aws_ssm_parameter.rayo_password.arn + json_cdr_url = var.json_cdr_url json_cdr_password_parameter_arn = var.json_cdr_password_parameter_arn - external_rtp_ip = var.external_rtp_ip + external_rtp_ip = var.external_rtp_ip alternative_sip_outbound_ip = var.alternative_sip_outbound_ip - alternative_rtp_ip = var.alternative_rtp_ip + alternative_rtp_ip = var.alternative_rtp_ip - source_volume = local.efs_volume_name + source_volume = local.efs_volume_name cache_directory = "/cache" - recordings_bucket_name = aws_s3_bucket.recordings.id - recordings_bucket_access_key_id_parameter_arn = aws_ssm_parameter.recordings_bucket_access_key_id.arn + recordings_bucket_name = aws_s3_bucket.recordings.id + recordings_bucket_access_key_id_parameter_arn = aws_ssm_parameter.recordings_bucket_access_key_id.arn recordings_bucket_secret_access_key_parameter_arn = aws_ssm_parameter.recordings_bucket_secret_access_key.arn - recordings_bucket_region = aws_s3_bucket.recordings.region + recordings_bucket_region = aws_s3_bucket.recordings.region services_function_arn = aws_lambda_function.services.arn } @@ -422,17 +422,17 @@ resource "aws_ecs_task_definition" "switch" { family = var.switch_identifier network_mode = "awsvpc" requires_compatibilities = ["EC2"] - container_definitions = data.template_file.switch.rendered - task_role_arn = aws_iam_role.ecs_task_role.arn - execution_role_arn = aws_iam_role.task_execution_role.arn - memory = module.switch_container_instances.ec2_instance_type.memory_size - 512 + container_definitions = data.template_file.switch.rendered + task_role_arn = aws_iam_role.ecs_task_role.arn + execution_role_arn = aws_iam_role.task_execution_role.arn + memory = module.switch_container_instances.ec2_instance_type.memory_size - 512 volume { name = local.efs_volume_name efs_volume_configuration { - file_system_id = aws_efs_file_system.cache.id - transit_encryption = "ENABLED" + file_system_id = aws_efs_file_system.cache.id + transit_encryption = "ENABLED" } } } @@ -452,11 +452,11 @@ resource "aws_ecs_service" "switch" { capacity_provider_strategy { capacity_provider = aws_ecs_capacity_provider.switch.name - weight = 1 + weight = 1 } placement_constraints { - type = "distinctInstance" + type = "distinctInstance" } load_balancer { @@ -476,22 +476,22 @@ resource "aws_ecs_service" "switch" { # Load Balancer resource "aws_lb_target_group" "switch_http" { - name = var.switch_identifier - port = 80 - protocol = "HTTP" - vpc_id = var.vpc.vpc_id - target_type = "ip" + name = var.switch_identifier + port = 80 + protocol = "HTTP" + vpc_id = var.vpc.vpc_id + target_type = "ip" deregistration_delay = 60 health_check { - protocol = "HTTP" - path = "/health_checks" + protocol = "HTTP" + path = "/health_checks" healthy_threshold = 3 - interval = 10 + interval = 10 } } -resource "aws_lb_listener_rule" "switch_http" { +resource "aws_lb_listener_rule" "switch_public_http" { priority = var.app_environment == "production" ? 20 : 120 listener_arn = var.listener_arn @@ -503,7 +503,7 @@ resource "aws_lb_listener_rule" "switch_http" { condition { host_header { - values = [aws_route53_record.switch.fqdn] + values = [aws_route53_record.switch_public.fqdn] } } @@ -533,8 +533,8 @@ resource "aws_appautoscaling_policy" "switch_policy" { predefined_metric_type = "ECSServiceAverageCPUUtilization" } - target_value = 30 - scale_in_cooldown = 300 + target_value = 30 + scale_in_cooldown = 300 scale_out_cooldown = 60 } } @@ -554,8 +554,8 @@ resource "aws_appautoscaling_policy" "freeswitch_session_count" { unit = aws_cloudwatch_log_metric_filter.freeswitch_session_count.metric_transformation.*.unit[0] } - target_value = 100 - scale_in_cooldown = 300 + target_value = 100 + scale_in_cooldown = 300 scale_out_cooldown = 60 } } @@ -569,12 +569,12 @@ resource "aws_cloudwatch_log_metric_filter" "freeswitch_session_count" { name = "${var.switch_identifier}-SessionCount" namespace = "SomlengSWITCH" value = "$.Session-Count" - unit = "Count" + unit = "Count" } } # Route53 -resource "aws_route53_record" "switch" { +resource "aws_route53_record" "switch_public" { zone_id = var.route53_zone.zone_id name = var.switch_subdomain type = "A" @@ -585,3 +585,15 @@ resource "aws_route53_record" "switch" { evaluate_target_health = true } } + +# resource "aws_route53_record" "switch" { +# zone_id = var.route53_zone.zone_id +# name = var.switch_subdomain +# type = "A" + +# alias { +# name = var.load_balancer.dns_name +# zone_id = var.load_balancer.zone_id +# evaluate_target_health = true +# } +# } diff --git a/infrastructure/production/main.tf b/infrastructure/production/main.tf index 0de619862..f56cab0e3 100644 --- a/infrastructure/production/main.tf +++ b/infrastructure/production/main.tf @@ -5,54 +5,54 @@ data "aws_ssm_parameter" "somleng_services_password" { module "somleng_switch" { source = "../modules/somleng_switch" - cluster_name = "somleng-switch" - switch_identifier = "switch" - services_identifier = "switch-services" - s3_mpeg_identifier = "s3-mpeg" + cluster_name = "somleng-switch" + switch_identifier = "switch" + services_identifier = "switch-services" + s3_mpeg_identifier = "s3-mpeg" public_gateway_identifier = "public-gateway" client_gateway_identifier = "client-gateway" - media_proxy_identifier = "media-proxy" + media_proxy_identifier = "media-proxy" - switch_app_image = data.terraform_remote_state.core.outputs.switch_ecr_repository.repository_uri - nginx_image = data.terraform_remote_state.core.outputs.nginx_ecr_repository.repository_uri - freeswitch_image = data.terraform_remote_state.core.outputs.freeswitch_ecr_repository.repository_uri + switch_app_image = data.terraform_remote_state.core.outputs.switch_ecr_repository.repository_uri + nginx_image = data.terraform_remote_state.core.outputs.nginx_ecr_repository.repository_uri + freeswitch_image = data.terraform_remote_state.core.outputs.freeswitch_ecr_repository.repository_uri freeswitch_event_logger_image = data.terraform_remote_state.core.outputs.freeswitch_event_logger_ecr_repository.repository_uri - public_gateway_image = data.terraform_remote_state.core.outputs.public_gateway_ecr_repository.repository_uri - client_gateway_image = data.terraform_remote_state.core.outputs.client_gateway_ecr_repository.repository_uri - media_proxy_image = data.terraform_remote_state.core.outputs.media_proxy_ecr_repository.repository_uri - opensips_scheduler_image = data.terraform_remote_state.core.outputs.opensips_scheduler_ecr_repository.repository_uri - s3_mpeg_ecr_repository_url = data.terraform_remote_state.core.outputs.s3_mpeg_ecr_repository.repository_url - services_ecr_repository_url = data.terraform_remote_state.core.outputs.services_ecr_repository.repository_url + public_gateway_image = data.terraform_remote_state.core.outputs.public_gateway_ecr_repository.repository_uri + client_gateway_image = data.terraform_remote_state.core.outputs.client_gateway_ecr_repository.repository_uri + media_proxy_image = data.terraform_remote_state.core.outputs.media_proxy_ecr_repository.repository_uri + opensips_scheduler_image = data.terraform_remote_state.core.outputs.opensips_scheduler_ecr_repository.repository_uri + s3_mpeg_ecr_repository_url = data.terraform_remote_state.core.outputs.s3_mpeg_ecr_repository.repository_url + services_ecr_repository_url = data.terraform_remote_state.core.outputs.services_ecr_repository.repository_url vpc = data.terraform_remote_state.core_infrastructure.outputs.vpc - aws_region = var.aws_region + aws_region = var.aws_region app_environment = "production" json_cdr_password_parameter_arn = data.aws_ssm_parameter.somleng_services_password.arn - json_cdr_url = "https://api.somleng.org/services/call_data_records" - external_sip_ip = data.terraform_remote_state.core_infrastructure.outputs.nlb_eips[0].public_ip - external_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.vpc.nat_public_ips[0] + json_cdr_url = "https://api.internal.somleng.org/services/call_data_records" + external_sip_ip = data.terraform_remote_state.core_infrastructure.outputs.nlb_eips[0].public_ip + external_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.vpc.nat_public_ips[0] alternative_sip_outbound_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip - alternative_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip + alternative_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip - efs_cache_name = "somleng-switch-cache" - public_gateway_db_name = "opensips_public_gateway" - client_gateway_db_name = "opensips_client_gateway" - db_username = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.master_username + efs_cache_name = "somleng-switch-cache" + public_gateway_db_name = "opensips_public_gateway" + client_gateway_db_name = "opensips_client_gateway" + db_username = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.master_username db_password_parameter_arn = data.terraform_remote_state.core_infrastructure.outputs.db_master_password_parameter.arn - db_host = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.endpoint - db_port = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.port - db_security_group = data.terraform_remote_state.core_infrastructure.outputs.db_security_group.id - - load_balancer = data.terraform_remote_state.core_infrastructure.outputs.application_load_balancer - network_load_balancer = data.terraform_remote_state.core_infrastructure.outputs.network_load_balancer - route53_zone = data.terraform_remote_state.core_infrastructure.outputs.route53_zone_somleng_org - listener_arn = data.terraform_remote_state.core_infrastructure.outputs.https_listener.arn - switch_subdomain = "ahn" + db_host = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.endpoint + db_port = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.port + db_security_group = data.terraform_remote_state.core_infrastructure.outputs.db_security_group.id + + load_balancer = data.terraform_remote_state.core_infrastructure.outputs.application_load_balancer + network_load_balancer = data.terraform_remote_state.core_infrastructure.outputs.network_load_balancer + route53_zone = data.terraform_remote_state.core_infrastructure.outputs.route53_zone_somleng_org + listener_arn = data.terraform_remote_state.core_infrastructure.outputs.https_listener.arn + switch_subdomain = "ahn" client_gateway_subdomain = "sip" recordings_bucket_name = "raw-recordings.somleng.org" - switch_max_tasks = 10 + switch_max_tasks = 10 } diff --git a/infrastructure/staging/main.tf b/infrastructure/staging/main.tf index 8f74b2a5c..b89af822a 100644 --- a/infrastructure/staging/main.tf +++ b/infrastructure/staging/main.tf @@ -5,67 +5,67 @@ data "aws_ssm_parameter" "somleng_services_password" { module "somleng_switch_staging" { source = "../modules/somleng_switch" - cluster_name = "somleng-switch-staging" - switch_identifier = "switch-staging" - services_identifier = "switch-services-staging" - s3_mpeg_identifier = "s3-mpeg-staging" + cluster_name = "somleng-switch-staging" + switch_identifier = "switch-staging" + services_identifier = "switch-services-staging" + s3_mpeg_identifier = "s3-mpeg-staging" public_gateway_identifier = "public-gateway-staging" client_gateway_identifier = "client-gateway-staging" - media_proxy_identifier = "media-proxy-staging" + media_proxy_identifier = "media-proxy-staging" - aws_region = var.aws_region + aws_region = var.aws_region app_environment = "staging" - switch_app_image = data.terraform_remote_state.core.outputs.switch_ecr_repository.repository_uri - nginx_image = data.terraform_remote_state.core.outputs.nginx_ecr_repository.repository_uri - freeswitch_image = data.terraform_remote_state.core.outputs.freeswitch_ecr_repository.repository_uri + switch_app_image = data.terraform_remote_state.core.outputs.switch_ecr_repository.repository_uri + nginx_image = data.terraform_remote_state.core.outputs.nginx_ecr_repository.repository_uri + freeswitch_image = data.terraform_remote_state.core.outputs.freeswitch_ecr_repository.repository_uri freeswitch_event_logger_image = data.terraform_remote_state.core.outputs.freeswitch_event_logger_ecr_repository.repository_uri - public_gateway_image = data.terraform_remote_state.core.outputs.public_gateway_ecr_repository.repository_uri - client_gateway_image = data.terraform_remote_state.core.outputs.client_gateway_ecr_repository.repository_uri - media_proxy_image = data.terraform_remote_state.core.outputs.media_proxy_ecr_repository.repository_uri - opensips_scheduler_image = data.terraform_remote_state.core.outputs.opensips_scheduler_ecr_repository.repository_uri + public_gateway_image = data.terraform_remote_state.core.outputs.public_gateway_ecr_repository.repository_uri + client_gateway_image = data.terraform_remote_state.core.outputs.client_gateway_ecr_repository.repository_uri + media_proxy_image = data.terraform_remote_state.core.outputs.media_proxy_ecr_repository.repository_uri + opensips_scheduler_image = data.terraform_remote_state.core.outputs.opensips_scheduler_ecr_repository.repository_uri - s3_mpeg_ecr_repository_url = data.terraform_remote_state.core.outputs.s3_mpeg_ecr_repository.repository_url + s3_mpeg_ecr_repository_url = data.terraform_remote_state.core.outputs.s3_mpeg_ecr_repository.repository_url services_ecr_repository_url = data.terraform_remote_state.core.outputs.services_ecr_repository.repository_url vpc = data.terraform_remote_state.core_infrastructure.outputs.vpc json_cdr_password_parameter_arn = data.aws_ssm_parameter.somleng_services_password.arn - json_cdr_url = "https://api-staging.somleng.org/services/call_data_records" - external_sip_ip = data.terraform_remote_state.core_infrastructure.outputs.nlb_eips[0].public_ip - external_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.vpc.nat_public_ips[0] + json_cdr_url = "https://api-staging.internal.somleng.org/services/call_data_records" + external_sip_ip = data.terraform_remote_state.core_infrastructure.outputs.nlb_eips[0].public_ip + external_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.vpc.nat_public_ips[0] alternative_sip_outbound_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip - alternative_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip + alternative_rtp_ip = data.terraform_remote_state.core_infrastructure.outputs.nat_instance_ip - efs_cache_name = "switch-staging-cache" - public_gateway_db_name = "opensips_public_gateway_staging" - client_gateway_db_name = "opensips_client_gateway_staging" - db_username = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.master_username + efs_cache_name = "switch-staging-cache" + public_gateway_db_name = "opensips_public_gateway_staging" + client_gateway_db_name = "opensips_client_gateway_staging" + db_username = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.master_username db_password_parameter_arn = data.terraform_remote_state.core_infrastructure.outputs.db_master_password_parameter.arn - db_host = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.endpoint - db_port = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.port - db_security_group = data.terraform_remote_state.core_infrastructure.outputs.db_security_group.id + db_host = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.endpoint + db_port = data.terraform_remote_state.core_infrastructure.outputs.db_cluster.port + db_security_group = data.terraform_remote_state.core_infrastructure.outputs.db_security_group.id - load_balancer = data.terraform_remote_state.core_infrastructure.outputs.application_load_balancer - network_load_balancer = data.terraform_remote_state.core_infrastructure.outputs.network_load_balancer - route53_zone = data.terraform_remote_state.core_infrastructure.outputs.route53_zone_somleng_org - listener_arn = data.terraform_remote_state.core_infrastructure.outputs.https_listener.arn - switch_subdomain = "switch-staging" + load_balancer = data.terraform_remote_state.core_infrastructure.outputs.application_load_balancer + network_load_balancer = data.terraform_remote_state.core_infrastructure.outputs.network_load_balancer + route53_zone = data.terraform_remote_state.core_infrastructure.outputs.route53_zone_somleng_org + listener_arn = data.terraform_remote_state.core_infrastructure.outputs.https_listener.arn + switch_subdomain = "switch-staging" client_gateway_subdomain = "sip-staging" recordings_bucket_name = "raw-recordings-staging.somleng.org" - sip_port = 6060 - sip_alternative_port = 6080 - switch_min_tasks = 0 - switch_max_tasks = 2 - public_gateway_min_tasks = 0 - public_gateway_max_tasks = 2 - client_gateway_min_tasks = 0 - client_gateway_max_tasks = 2 - media_proxy_min_tasks = 0 - media_proxy_max_tasks = 2 + sip_port = 6060 + sip_alternative_port = 6080 + switch_min_tasks = 0 + switch_max_tasks = 2 + public_gateway_min_tasks = 0 + public_gateway_max_tasks = 2 + client_gateway_min_tasks = 0 + client_gateway_max_tasks = 2 + media_proxy_min_tasks = 0 + media_proxy_max_tasks = 2 assign_client_gateway_eips = false - assign_media_proxy_eips = false + assign_media_proxy_eips = false }