Skip to content

Commit

Permalink
Readme updates per anatha
Browse files Browse the repository at this point in the history
  • Loading branch information
jpl-btlunsfo committed Jul 5, 2024
1 parent f243d26 commit b5a1095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The webservers default port is also 8080 to let it traverse the MCP NACL.

When deployed this terraform code creates an ECS cluster, with a baseline set of SSM parameters that other services can then extend with their own Apache HTTPD configurations. The configurations are pulled down and collated by the container on restart, so reloading of the configuration after changes is handled by triggering a lambda function.

A sample configuration snippet and trigger:
A sample configuration snippet and trigger (note `0NN-servicename`, the contents of the ssm parameter, and the `depends_on` section of the below should be changed as necessary for each Unity servce's needs):
```
resource "aws_ssm_parameter" "managementproxy_config" {
depends_on = [aws_ssm_parameter.managementproxy_closevirtualhost]
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/010-management"
resource "aws_ssm_parameter" "serviceproxy_config" {
depends_on = []
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/0NN-servicename"
type = "String"
value = <<-EOT
Expand All @@ -30,10 +30,13 @@ resource "aws_ssm_parameter" "managementproxy_config" {
EOT
}
resource "aws_lambda_invocation" "demoinvocation2" {
resource "aws_lambda_invocation" "httpd_lambda_invocation" {
depends_on = aws_ssm_parameter.serviceproxy_config
function_name = "${var.project}-${var.venue}-httpdproxymanagement"
input = ""
}
```
(It's recommended to have the `aws_ssm_parameter.serviceproxy_config` depend on the last step of your service orchestration, so as to not set the proxy configuration up until everything has been orchestrated.)


The configuration is collated from SSM parameters residing under `/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/`, and assembled like so:
Expand Down
2 changes: 1 addition & 1 deletion terraform-unity/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "aws_ecs_task_definition" "httpd" {


container_definitions = jsonencode([{
name = "${var.project}-${var.venue}-httpd-task"
name = "${var.project}-${var.venue}-httpd-task"
image = "ghcr.io/unity-sds/unity-proxy/httpd-proxy:${var.httpd_proxy_version}"
environment = [
{
Expand Down

0 comments on commit b5a1095

Please sign in to comment.