Skip to content

Commit aae2c94

Browse files
committed
Merge branch 'VED-81-Number-Update' into VED-480-Number-Update-terraform
2 parents 092305f + b1830c0 commit aae2c94

File tree

23 files changed

+466
-177
lines changed

23 files changed

+466
-177
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ updates:
7373
directories:
7474
- "/grafana/non-prod/terraform"
7575
- "/infra"
76-
- "/mesh-infra"
7776
- "/terraform"
7877
- "/terraform_aws_backup/**"
7978
schedule:

.github/workflows/sonarcloud.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
PYTHONPATH: ${{ env.SHARED_PATH }}
141141
continue-on-error: true
142142
run: |
143+
echo "shared coverage - Current directory: $(pwd)"
143144
poetry env use 3.11
144145
poetry install
145146
poetry run coverage run -m unittest discover || echo "shared tests failed" >> ../../failed_tests.txt
@@ -152,14 +153,21 @@ jobs:
152153
PYTHONPATH: ${{ env.LAMBDA_PATH }}/id_sync/src:${{ env.LAMBDA_PATH }}/id_sync/tests:${{ env.SHARED_PATH }}
153154
continue-on-error: true
154155
run: |
156+
echo "id_sync coverage - Current directory: $(pwd)"
155157
poetry env use 3.11
156158
poetry install
157159
poetry run coverage run -m unittest discover || echo "id_sync tests failed" >> ../../failed_tests.txt
158160
poetry run coverage xml -o ../../id_sync-coverage.xml
161+
#check files created
162+
if [ ! -f ../../id_sync-coverage.xml ]; then
163+
echo "id_sync-coverage.xml not found, exiting with error"
164+
fi
159165
160166
- name: Run Test Failure Summary
161167
id: check_failure
162168
run: |
169+
echo "Checking for test failures..."
170+
ls *-coverage.xml
163171
if [ -s failed_tests.txt ]; then
164172
echo "The following tests failed:"
165173
cat failed_tests.txt

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ See https://nhsd-confluence.digital.nhs.uk/display/APM/Glossary.
4646
| `terraform_old` | Old tf code used to create INT to mimic prod. |
4747
| `terraform_sandbox` | Sandbox environment for testing infrastructure changes. |
4848
| `terraform_aws_backup` | Streamlined backup processing with AWS. |
49-
| `mesh-infra` | Infrastructure setup for Imms batch MESH integration. |
5049
| `proxies` | Apigee API proxy definitions. |
5150
---
5251

infra/.terraform.lock.hcl

Lines changed: 78 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/environments/int/variables.tfvars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dspp_admin_role = "root"
77
environment = "int"
88
parent_route53_zone_name = "int.vds.platform.nhs.uk"
99
child_route53_zone_name = "imms.int.vds.platform.nhs.uk"
10+
mesh_mailbox_id = "X26OT303"
11+
mesh_dlq_mailbox_id = "X26OT304"

infra/environments/non-prod/variables.tfvars

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ dspp_admin_role = "root"
77
environment = "dev"
88
parent_route53_zone_name = "dev.vds.platform.nhs.uk"
99
child_route53_zone_name = "imms.dev.vds.platform.nhs.uk"
10+
# TODO - null these out once we're using the int account
11+
# mesh_mailbox_id = null
12+
# mesh_dlq_mailbox_id = null
13+
mesh_mailbox_id = "X26OT303"
14+
mesh_dlq_mailbox_id = "X26OT304"

infra/environments/prod/variables.tfvars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dspp_admin_role = "root"
77
environment = "prod"
88
parent_route53_zone_name = "prod.vds.platform.nhs.uk"
99
child_route53_zone_name = "imms.prod.vds.platform.nhs.uk"
10+
mesh_mailbox_id = "X26HC138"
11+
mesh_dlq_mailbox_id = null

infra/mesh.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# MESH Client Module - conditionally created based on environment configuration
2+
module "mesh" {
3+
count = var.mesh_mailbox_id != null ? 1 : 0
4+
source = "git::https://github.com/nhsdigital/terraform-aws-mesh-client.git//module?ref=v2.1.5"
5+
6+
name_prefix = "imms-${var.environment}"
7+
account_id = var.imms_account_id
8+
mesh_env = var.environment == "prod"? "production" : "integration"
9+
subnet_ids = toset([])
10+
mailbox_ids = [var.mesh_mailbox_id]
11+
12+
compress_threshold = 1 * 1024 * 1024
13+
get_message_max_concurrency = 10
14+
handshake_schedule = "rate(24 hours)"
15+
}

infra/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ variable "build_agent_account_id" {
1616
variable "environment" {
1717
default = "non-prod"
1818
}
19+
variable "mesh_mailbox_id" {
20+
default = null
21+
}
22+
variable "mesh_dlq_mailbox_id" {
23+
default = null
24+
}

lambdas/id_sync/Dockerfile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,37 @@ RUN mkdir -p /home/appuser && \
66
echo 'appuser:x:1001:' >> /etc/group && \
77
chown -R 1001:1001 /home/appuser && pip install "poetry~=1.5.0"
88

9-
# Install Poetry as root
10-
COPY poetry.lock pyproject.toml README.md ./
9+
# Install Poetry dependencies
10+
# Copy shared Poetry files first
11+
COPY shared/poetry.lock shared/pyproject.toml shared/README.md ./shared/
12+
# Copy id_sync Poetry files
13+
COPY id_sync/poetry.lock id_sync/pyproject.toml id_sync/README.md ./
14+
15+
# Install shared dependencies first
16+
WORKDIR /var/task/shared
17+
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
18+
19+
# Install id_sync dependencies
20+
WORKDIR /var/task
1121
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1222

1323
# -----------------------------
1424
FROM base AS build
15-
COPY src .
16-
COPY ../shared/src/common ./common
25+
26+
# Set working directory back to Lambda task root
27+
WORKDIR /var/task
28+
29+
# Copy shared source code
30+
COPY shared/src/common ./common
31+
32+
# Copy id_sync source code
33+
COPY id_sync/src .
34+
35+
# Set correct permissions
1736
RUN chmod 644 $(find . -type f) && chmod 755 $(find . -type d)
37+
1838
# Build as non-root user
1939
USER 1001:1001
40+
41+
# Set the Lambda handler
2042
CMD ["id_sync.handler"]

0 commit comments

Comments
 (0)