Skip to content

Updated proxy service name to be ui instead of dashboard #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added tags specification for resources managed by terraform configuration [#4](https://github.com/unity-sds/unity-ui-infra/issues/4)
- Fixed how tags are specified to resolve issue when Terraform code is executed [#9](https://github.com/unity-sds/unity-ui-infra/issues/9)
- Updated proxy configuration. Our application is now accessible using the term `ui` instead of `dashboard` [#15](https://github.com/unity-sds/unity-ui-infra/issues/15)
- Updated terraform configurations so they use the term `ui` instead of `dashboard` [#15](https://github.com/unity-sds/unity-ui-infra/issues/15)

## [0.1.0] 2024-04-15

Expand Down
4 changes: 2 additions & 2 deletions terraform-unity-ui/alb.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_lb" "main" {
name = "${var.project}-${var.venue}-dashboard-lb"
name = "${var.project}-${var.venue}-ui-lb"
internal = false
load_balancer_type = "application"
subnets = local.public_subnet_ids
Expand All @@ -16,7 +16,7 @@ resource "aws_lb" "main" {
}

resource "aws_alb_target_group" "app" {
name = "${var.project}-${var.venue}-dashboard-tg"
name = "${var.project}-${var.venue}-ui-tg"
port = 8080
protocol = "HTTP"
vpc_id = data.aws_ssm_parameter.vpc_id.value
Expand Down
14 changes: 7 additions & 7 deletions terraform-unity-ui/ecs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_ecs_cluster" "main" {
name = "${var.project}-${var.venue}-dashboard-cluster"
name = "${var.project}-${var.venue}-ui-cluster"
tags = merge(
var.tags,
var.additional_tags,
Expand All @@ -11,7 +11,7 @@ resource "aws_ecs_cluster" "main" {
}

resource "aws_ecs_task_definition" "app" {
family = "${var.project}-${var.venue}-dashboard-app"
family = "${var.project}-${var.venue}-ui-app"
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
network_mode = "awsvpc"
requires_compatibilities = ["FARGATE"]
Expand All @@ -20,7 +20,7 @@ resource "aws_ecs_task_definition" "app" {
container_definitions = jsonencode(
[
{
name = "dashboard"
name = "ui"
image = var.app_image
environment = [
{
Expand All @@ -41,11 +41,11 @@ resource "aws_ecs_task_definition" "app" {
},
{
name = "ENV_UNITY_UI_BASE_PATH"
value = "/${var.project}/${var.venue}/dashboard"
value = "/${var.project}/${var.venue}/ui"
},
{
name = "ENV_UNITY_UI_AUTH_OAUTH_REDIRECT_URI"
value = "https://www.${data.aws_ssm_parameter.shared_services_domain.value}:4443/${var.project}/${var.venue}/dashboard"
value = "https://www.${data.aws_ssm_parameter.shared_services_domain.value}:4443/${var.project}/${var.venue}/ui"
},
{
name = "ENV_UNITY_UI_AUTH_OAUTH_LOGOUT_ENDPOINT"
Expand Down Expand Up @@ -88,7 +88,7 @@ resource "aws_ecs_task_definition" "app" {
}

resource "aws_ecs_service" "main" {
name = "${var.project}-${var.venue}-dashboard-service"
name = "${var.project}-${var.venue}-ui-service"
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.app.arn
desired_count = var.app_count
Expand All @@ -111,7 +111,7 @@ resource "aws_ecs_service" "main" {

load_balancer {
target_group_arn = aws_alb_target_group.app.id
container_name = "dashboard"
container_name = "ui"
container_port = 8080
}

Expand Down
2 changes: 1 addition & 1 deletion terraform-unity-ui/iam.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_iam_role" "ecs_task_execution_role" {
name = "${var.project}-${var.venue}-dashboard-ecs_task_execution_role"
name = "${var.project}-${var.venue}-ui-ecs_task_execution_role"

tags = merge(
var.tags,
Expand Down
12 changes: 6 additions & 6 deletions terraform-unity-ui/proxy.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
resource "aws_ssm_parameter" "uiux_dashboard_proxy_config" {
resource "aws_ssm_parameter" "uiux_ui_proxy_config" {
depends_on = [ aws_lb.main ]
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/010-uiux-dashboard"
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/010-uiux-ui"
type = "String"
value = <<-EOT

<location "/${var.project}/${var.venue}/dashboard">
<location "/${var.project}/${var.venue}/ui">
ProxyHTMLEnable on
RequestHeader unset Accept-Encoding
ProxyHTMLCHarsetOut *
Expand All @@ -13,19 +13,19 @@ resource "aws_ssm_parameter" "uiux_dashboard_proxy_config" {
Header always set Strict-Transport-Security "max-age=63072000"
ProxyPass "http://${aws_lb.main.dns_name}:8080/" retry=5 disablereuse=On
ProxyPassReverse "http://${aws_lb.main.dns_name}:8080/"
ProxyHTMLURLMap / /${var.project}/${var.venue}/dashboard/
ProxyHTMLURLMap / /${var.project}/${var.venue}/ui/
</location>

EOT
}

resource "aws_lambda_invocation" "proxy_lambda_invocation" {
depends_on = [ aws_lb.main, aws_ssm_parameter.uiux_dashboard_proxy_config ]
depends_on = [ aws_lb.main, aws_ssm_parameter.uiux_ui_proxy_config ]
function_name = "${var.project}-${var.venue}-httpdproxymanagement"
input = ""
triggers = {
redeployment = sha1(jsonencode([
aws_ssm_parameter.uiux_dashboard_proxy_config
aws_ssm_parameter.uiux_ui_proxy_config
]))
}
}
4 changes: 2 additions & 2 deletions terraform-unity-ui/security.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_security_group" "ecs_sg" {
name = "${var.project}-${var.venue}-dashboard-ecs-sg"
description = "Security group for the dashboard ECS Service"
name = "${var.project}-${var.venue}-ui-ecs-sg"
description = "Security group for the UI ECS Service"
vpc_id = data.aws_ssm_parameter.vpc_id.value

tags = merge(
Expand Down