Skip to content

Commit b5a1095

Browse files
committed
Readme updates per anatha
1 parent f243d26 commit b5a1095

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ The webservers default port is also 8080 to let it traverse the MCP NACL.
88

99
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.
1010

11-
A sample configuration snippet and trigger:
11+
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):
1212
```
13-
resource "aws_ssm_parameter" "managementproxy_config" {
14-
depends_on = [aws_ssm_parameter.managementproxy_closevirtualhost]
15-
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/010-management"
13+
resource "aws_ssm_parameter" "serviceproxy_config" {
14+
depends_on = []
15+
name = "/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/0NN-servicename"
1616
type = "String"
1717
value = <<-EOT
1818
@@ -30,10 +30,13 @@ resource "aws_ssm_parameter" "managementproxy_config" {
3030
EOT
3131
}
3232
33-
resource "aws_lambda_invocation" "demoinvocation2" {
33+
resource "aws_lambda_invocation" "httpd_lambda_invocation" {
34+
depends_on = aws_ssm_parameter.serviceproxy_config
3435
function_name = "${var.project}-${var.venue}-httpdproxymanagement"
36+
input = ""
3537
}
3638
```
39+
(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.)
3740

3841

3942
The configuration is collated from SSM parameters residing under `/unity/${var.project}/${var.venue}/cs/management/proxy/configurations/`, and assembled like so:

terraform-unity/ecs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ resource "aws_ecs_task_definition" "httpd" {
7272

7373

7474
container_definitions = jsonencode([{
75-
name = "${var.project}-${var.venue}-httpd-task"
75+
name = "${var.project}-${var.venue}-httpd-task"
7676
image = "ghcr.io/unity-sds/unity-proxy/httpd-proxy:${var.httpd_proxy_version}"
7777
environment = [
7878
{

0 commit comments

Comments
 (0)