Skip to content

Commit a78a48f

Browse files
authored
Merge branch 'main' into feature/ELI-702-code-signing
2 parents 9bf8b61 + 8581406 commit a78a48f

14 files changed

Lines changed: 522 additions & 157 deletions

File tree

.github/CODEOWNERS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Default owner
2+
* @NHSDigital/eligibility-signposting-api-code-owners
3+
4+
# Terraform / infra
5+
*.tf @NHSDigital/eligibility-signposting-api-code-owners
6+
7+
# Lambda / API code
8+
/src/ @NHSDigital/eligibility-signposting-api-code-owners
9+
10+
# Tests
11+
/tests/ @NHSDigital/eligibility-signposting-api-code-owners
12+
13+
# GitHub workflows
14+
/.github/workflows/ @NHSDigital/eligibility-signposting-api-code-owners

.github/workflows/cicd-3-test-deploy.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ jobs:
6666
with:
6767
terraform_version: ${{ needs.metadata.outputs.terraform_version }}
6868

69+
- name: "Configure AWS Credentials (IAM Bootstrap Role)"
70+
uses: aws-actions/configure-aws-credentials@v6
71+
with:
72+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/service-roles/github-actions-iam-bootstrap-role
73+
aws-region: eu-west-2
74+
75+
- name: "Deploy IAM roles (iams-developer-roles stack)"
76+
working-directory: ./infrastructure
77+
run: |
78+
make terraform env=test stack=iams-developer-roles tf-command=apply workspace=default
79+
6980
- name: "Configure AWS Credentials"
7081
uses: aws-actions/configure-aws-credentials@v6
7182
with:

infrastructure/stacks/api-layer/cloudtrail.tf

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,6 @@ resource "aws_kms_key" "cloudtrail_kms_key" {
2727
deletion_window_in_days = 14
2828
enable_key_rotation = true
2929

30-
policy = jsonencode({
31-
Version = "2012-10-17"
32-
Statement = [
33-
{
34-
Sid = "EnableRootPermissions"
35-
Effect = "Allow"
36-
Principal = {
37-
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
38-
}
39-
Action = "kms:*"
40-
Resource = "*"
41-
},
42-
{
43-
Sid = "AllowCloudTrailEncryptLogs"
44-
Effect = "Allow"
45-
Principal = {
46-
Service = "cloudtrail.amazonaws.com"
47-
}
48-
Action = [
49-
"kms:GenerateDataKey*",
50-
"kms:DescribeKey",
51-
"kms:Encrypt"
52-
]
53-
Resource = "*"
54-
}
55-
]
56-
})
57-
5830
tags = {
5931
environment = var.environment
6032
project_name = var.project_name

infrastructure/stacks/api-layer/cloudwatch.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ resource "aws_cloudwatch_log_group" "cloudtrail_log_group" {
4646
name = "${terraform.workspace == "default" ? "" : "${terraform.workspace}-"}elid-aws-cloudtrail-logs"
4747
retention_in_days = 365
4848
kms_key_id = aws_kms_alias.cloudtrail_kms_alias.arn
49+
50+
depends_on = [aws_kms_key_policy.cloudtrail_kms_key_policy]
4951
}

infrastructure/stacks/api-layer/s3_buckets.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module "s3_dq_metrics_bucket" {
6060

6161
module "s3_cloudtrail_bucket" {
6262
source = "../../modules/s3"
63-
bucket_name = "eli-cloudwatch-logs"
63+
bucket_name = "eli-cloudwatch"
6464
environment = var.environment
6565
project_name = var.project_name
6666
stack_name = local.stack_name

infrastructure/stacks/iams-developer-roles/github_actions_policies.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ resource "aws_iam_policy" "s3_management" {
235235
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-dq-metrics/*",
236236
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-dq-metrics-access-logs",
237237
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-dq-metrics-access-logs/*",
238-
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-logs",
239-
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-logs/*",
240-
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-logs-access-logs",
241-
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-logs-access-logs/*",
238+
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch",
239+
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch/*",
240+
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-access-logs",
241+
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-eli-cloudwatch-access-logs/*",
242242
]
243243
}
244244
]

infrastructure/stacks/iams-developer-roles/github_actions_role.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ data "aws_iam_policy_document" "github_actions_iam_bootstrap_assume_role" {
8787
"${var.github_org}/${var.github_repo}/.github/workflows/iam-bootstrap-deploy.yaml@*",
8888
"${var.github_org}/${var.github_repo}/.github/workflows/base-deploy.yml@*",
8989
"${var.github_org}/${var.github_repo}/.github/workflows/cicd-2-publish.yaml@*",
90+
"${var.github_org}/${var.github_repo}/.github/workflows/cicd-3-test-deploy.yaml@*",
9091
]
9192
}
9293
}

poetry.lock

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pytest = "^8.4.2"
4747
pytest-asyncio = "^1.3.0"
4848
pytest-cov = "^7.0.0"
4949
pytest-nhsd-apim = "^5.0.14"
50-
aiohttp = "^3.13.2"
50+
aiohttp = "^3.13.4"
5151
awscli = "^1.37.24"
5252
awscli-local = "^0.22.2"
5353
polyfactory = "^3.2.0"

0 commit comments

Comments
 (0)