Skip to content

Commit

Permalink
Merge branch 'main' into feat/ap-ingest-datasync-task
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwoffenden authored Dec 16, 2024
2 parents 6c3cd23 + acfb2f8 commit 5e50870
Show file tree
Hide file tree
Showing 193 changed files with 4,991 additions and 2,224 deletions.
12 changes: 7 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
# https://github.com/ministryofjustice/modernisation-platform/blob/main/scripts/provision-member-directories.sh

* @ministryofjustice/modernisation-platform
/terraform/environments/analytical-platform-common @ministryofjustice/analytical-platform @ministryofjustice/modernisation-platform
/terraform/environments/analytical-platform-compute @ministryofjustice/analytical-platform @ministryofjustice/modernisation-platform
/terraform/environments/analytical-platform-ingestion @ministryofjustice/analytical-platform @ministryofjustice/modernisation-platform
/terraform/environments/apex @ministryofjustice/laa-apex-developer @ministryofjustice/laa-aws-infrastructure @ministryofjustice/modernisation-platform
/terraform/environments/ccms-ebs-upgrade @ministryofjustice/laa-ccms-migration-team @ministryofjustice/modernisation-platform
/terraform/environments/ccms-ebs @ministryofjustice/laa-ccms-migration-team @ministryofjustice/modernisation-platform-security @ministryofjustice/modernisation-platform
/terraform/environments/cdpt-chaps @ministryofjustice/central-digital-product-team @ministryofjustice/modernisation-platform
/terraform/environments/cdpt-ifs @ministryofjustice/central-digital-product-team @ministryofjustice/modernisation-platform
/terraform/environments/cdpt-chaps @ministryofjustice/azure-aws-sso-cdpt @ministryofjustice/central-digital-product-team @ministryofjustice/modernisation-platform
/terraform/environments/cdpt-ifs @ministryofjustice/azure-aws-sso-cdpt @ministryofjustice/central-digital-product-team @ministryofjustice/modernisation-platform
/terraform/environments/cica-copilot @ministryofjustice/cica-copilot-llm-maintainers @ministryofjustice/modernisation-platform
/terraform/environments/cica-data-extraction @ministryofjustice/cica-extract-tool-admins @ministryofjustice/modernisation-platform
/terraform/environments/cica-tariff @ministryofjustice/cica-mp-tariff @ministryofjustice/modernisation-platform
/terraform/environments/contract-work-administration @ministryofjustice/laa-aws-infrastructure @ministryofjustice/laa-cwa-developer @ministryofjustice/modernisation-platform
/terraform/environments/cooker @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform
/terraform/environments/cooker @ministryofjustice/MoJRedTeam @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform
/terraform/environments/corporate-information-system @ministryofjustice/laa-aws-infrastructure @ministryofjustice/laa-cis-team @ministryofjustice/modernisation-platform
/terraform/environments/corporate-staff-rostering @ministryofjustice/csr-application-support @ministryofjustice/hosting-migrations @ministryofjustice/studio-webops @ministryofjustice/modernisation-platform
/terraform/environments/dacp @ministryofjustice/dts-legacy @ministryofjustice/modernisation-platform
Expand All @@ -27,7 +28,7 @@
/terraform/environments/delius-nextcloud @ministryofjustice/hmpps-migration @ministryofjustice/hosting-migrations @ministryofjustice/modernisation-platform
/terraform/environments/digital-prison-reporting @ministryofjustice/digital-prisons-reporting-development-data-engineer @ministryofjustice/digital-prisons-reporting-preproduction-data-engineer @ministryofjustice/digital-prisons-reporting-production-data-engineer @ministryofjustice/digital-prisons-reporting-test-data-engineer @ministryofjustice/hmpps-digital-prison-reporting @ministryofjustice/hmpps-digital-prison-reporting-non-cleared-team @ministryofjustice/modernisation-platform
/terraform/environments/edw @ministryofjustice/laa-aws-infrastructure @ministryofjustice/laa-edw-developer @ministryofjustice/modernisation-platform
/terraform/environments/electronic-monitoring-data @ministryofjustice/hmpps-electronic-monitoring-data-store @ministryofjustice/modernisation-platform
/terraform/environments/electronic-monitoring-data @ministryofjustice/azure-aws-sso-electronic-monitoring-data @ministryofjustice/hmpps-electronic-monitoring-data-store @ministryofjustice/modernisation-platform
/terraform/environments/equip @ministryofjustice/modernisation-platform-engineers @ministryofjustice/modernisation-platform
/terraform/environments/eric @ministryofjustice/laa-aws-infrastructure @ministryofjustice/modernisation-platform
/terraform/environments/example @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform
Expand Down Expand Up @@ -58,12 +59,13 @@
/terraform/environments/ppud @ministryofjustice/modernisation-platform @ministryofjustice/ppud-replacement-devs @ministryofjustice/modernisation-platform
/terraform/environments/pra-register @ministryofjustice/dts-legacy @ministryofjustice/modernisation-platform
/terraform/environments/refer-monitor @ministryofjustice/hmpps-interventions-dashboard-access @ministryofjustice/hmpps-interventions-dev @ministryofjustice/modernisation-platform
/terraform/environments/sprinkler @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform-security @ministryofjustice/modernisation-platform
/terraform/environments/sprinkler @ministryofjustice/azure-aws-sso-modernisation-platform @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform-security @ministryofjustice/modernisation-platform
/terraform/environments/testing @ministryofjustice/modernisation-platform @ministryofjustice/modernisation-platform
/terraform/environments/tipstaff @ministryofjustice/dts-legacy @ministryofjustice/modernisation-platform
/terraform/environments/tribunals @ministryofjustice/dts-legacy @ministryofjustice/modernisation-platform
/terraform/environments/wardship @ministryofjustice/dts-legacy @ministryofjustice/modernisation-platform
/terraform/environments/xhibit-portal @ministryofjustice/cjse-xhibit-portal-discovery @ministryofjustice/xhibit-portal-dev @ministryofjustice/modernisation-platform
/terraform/environments/youth-justice-app-framework @ministryofjustice/modernisation-platform-engineers @ministryofjustice/modernisation-platform
**/backend.tf @ministryofjustice/modernisation-platform
**/subnet_share.tf @ministryofjustice/modernisation-platform
**/networking.auto.tfvars.json @ministryofjustice/modernisation-platform
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/analytical-platform-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: analytical-platform-common
on:
push:
branches:
- main
paths:
- 'terraform/environments/analytical-platform-common/**'
- '.github/workflows/analytical-platform-common.yml'

pull_request:
branches:
- main
paths:
- 'terraform/environments/analytical-platform-common/**'
- '.github/workflows/analytical-platform-common.yml'

workflow_dispatch:
inputs:
action:
description: 'Set either [deploy|destroy].'
default: 'deploy'
required: true
type: string
options:
- deploy
- destroy

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
strategy:
uses: ./.github/workflows/reusable_terraform_strategy.yml
if: inputs.action != 'destroy'
with:
application: "${{ github.workflow }}"

terraform:
needs: strategy
if: inputs.action != 'destroy'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.strategy.outputs.matrix) }}
uses: ./.github/workflows/reusable_terraform_plan_apply.yml
with:
application: "${{ github.workflow }}"
environment: "${{ matrix.target }}"
action: "${{ matrix.action }}"
secrets:
modernisation_platform_environments: "${{ secrets.MODERNISATION_PLATFORM_ENVIRONMENTS }}"
pipeline_github_token: "${{ secrets.MODERNISATION_PLATFORM_CI_USER_ENVIRONMENTS_REPO_PAT }}"

destroy-development:
if: inputs.action == 'destroy'
uses: ./.github/workflows/reusable_terraform_plan_apply.yml
with:
application: "${{ github.workflow }}"
environment: "development"
action: "plan_apply"
plan_apply_tfargs: "-destroy"
secrets:
modernisation_platform_environments: "${{ secrets.MODERNISATION_PLATFORM_ENVIRONMENTS }}"
pipeline_github_token: "${{ secrets.MODERNISATION_PLATFORM_CI_USER_ENVIRONMENTS_REPO_PAT }}"
10 changes: 5 additions & 5 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
token: '${{ secrets.GITHUB_TOKEN }}'
fetch-depth: 0
- name: Cache plugin dir
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.tflint.d/plugins
key: '${{ matrix.os }}-tflint-${{ hashFiles(''.tflint.hcl'') }}'
Expand All @@ -38,7 +38,7 @@ jobs:
run: tflint --disable-rule=terraform_unused_declarations --format sarif > tflint.sarif
- name: Upload SARIF file
if: success() || failure()
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: tflint.sarif
trivy:
Expand All @@ -63,7 +63,7 @@ jobs:

- name: Upload Trivy scan results to GitHub Security tab
if: success() || failure()
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: 'trivy-results.sarif'
checkov:
Expand All @@ -81,7 +81,7 @@ jobs:
fetch-depth: 0
- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@f10397402800d31940c9cefd680c66688a516c9f # v12.2932.0
uses: bridgecrewio/checkov-action@84f8bb70bc02d86035371e5a5dd568e19d44281b # v12.2934.0
with:
directory: ./
framework: terraform
Expand All @@ -90,6 +90,6 @@ jobs:
skip_check: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
- name: Upload SARIF file
if: success() || failure()
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: ./checkov.sarif
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions .github/workflows/terraform-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
fetch-depth: 0
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@ccf9e3a4a828df1ec741f6c8e6ed9d0acaef3490 # v18.5.0
uses: ministryofjustice/github-actions/terraform-static-analysis@db1a54895bf5fb975c60af47e5a3aab96505ca3e # v18.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
with:
fetch-depth: 0
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@ccf9e3a4a828df1ec741f6c8e6ed9d0acaef3490 # v18.5.0
uses: ministryofjustice/github-actions/terraform-static-analysis@db1a54895bf5fb975c60af47e5a3aab96505ca3e # v18.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -81,7 +81,7 @@ jobs:
with:
fetch-depth: 0
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@ccf9e3a4a828df1ec741f6c8e6ed9d0acaef3490 # v18.5.0
uses: ministryofjustice/github-actions/terraform-static-analysis@db1a54895bf5fb975c60af47e5a3aab96505ca3e # v18.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/youth-justice-app-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: youth-justice-app-framework
on:
push:
branches:
- main
paths:
- 'terraform/environments/youth-justice-app-framework/**'
- '.github/workflows/youth-justice-app-framework.yml'

pull_request:
branches:
- main
paths:
- 'terraform/environments/youth-justice-app-framework/**'
- '.github/workflows/youth-justice-app-framework.yml'

workflow_dispatch:
inputs:
action:
description: 'Set either [deploy|destroy].'
default: 'deploy'
required: true
type: string
options:
- deploy
- destroy

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
strategy:
uses: ./.github/workflows/reusable_terraform_strategy.yml
if: inputs.action != 'destroy'
with:
application: "${{ github.workflow }}"

terraform:
needs: strategy
if: inputs.action != 'destroy'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.strategy.outputs.matrix) }}
uses: ./.github/workflows/reusable_terraform_plan_apply.yml
with:
application: "${{ github.workflow }}"
environment: "${{ matrix.target }}"
action: "${{ matrix.action }}"
secrets:
modernisation_platform_environments: "${{ secrets.MODERNISATION_PLATFORM_ENVIRONMENTS }}"
pipeline_github_token: "${{ secrets.MODERNISATION_PLATFORM_CI_USER_ENVIRONMENTS_REPO_PAT }}"

destroy-development:
if: inputs.action == 'destroy'
uses: ./.github/workflows/reusable_terraform_plan_apply.yml
with:
application: "${{ github.workflow }}"
environment: "development"
action: "plan_apply"
plan_apply_tfargs: "-destroy"
secrets:
modernisation_platform_environments: "${{ secrets.MODERNISATION_PLATFORM_ENVIRONMENTS }}"
pipeline_github_token: "${{ secrets.MODERNISATION_PLATFORM_CI_USER_ENVIRONMENTS_REPO_PAT }}"
6 changes: 6 additions & 0 deletions scripts/nuke-config-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ presets:
- property: PackageName
type: regex
value: "^(opensearch-)?analysis-.+$"
- property: PackageName
type: glob
value: "titaniam-lockbox*"
- property: PackageName
type: glob
value: "rni*"
S3Bucket:
- property: tag:component
value: "secure-baselines"
Expand Down
76 changes: 76 additions & 0 deletions terraform/environments/analytical-platform-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Service Runbook

<!-- This is a template that should be populated by the development team when moving to the modernisation platform, but also reviewed and kept up to date.
To ensure that people looking at your runbook can get the information they need quickly, your runbook should be short but clear. Throughout, only use acronyms if you’re confident that someone who has just been woken up at 3am would understand them. -->

_If you have any questions surrounding this page please post in the `#team-name` channel._

## Mandatory Information

### **Last review date:**

<!-- Adding the last date this page was reviewed, with any accompanying information -->

### **Description:**

<!-- A short (less than 50 word) description of what your service does, and who it’s for.-->

### **Service URLs:**

<!-- The URL(s) of the service’s production environment, and test environments if possible-->

### **Incident response hours:**

<!-- When your service receives support for urgent issues. This should be written in a clear, unambiguous way. For example: 24/7/365, Office hours, usually 9am-6pm on working days, or 7am-10pm, 365 days a year. -->

### **Incident contact details:**

<!-- How people can raise an urgent issue with your service. This must not be the email address or phone number of an individual on your team, it should be a shared email address, phone number, or website that allows someone with an urgent issue to raise it quickly. -->

### **Service team contact:**

<!-- How people with non-urgent issues or questions can get in touch with your team. As with incident contact details, this must not be the email address or phone number of an individual on the team, it should be a shared email address or a ticket tracking system.-->

### **Hosting environment:**

Modernisation Platform

<!-- If your service is hosted on another MOJ team’s infrastructure, link to their runbook. If your service has another arrangement or runs its own infrastructure, you should list the supplier of that infrastructure (ideally linking to your account’s login page) and describe, simply and briefly, how to raise an issue with them. -->

## Optional

### **Other URLs:**

<!-- If you can, provide links to the service’s monitoring dashboard(s), health checks, documentation (ideally describing how to run/work with the service), and main GitHub repository. -->

### **Expected speed and frequency of releases:**

<!-- How often are you able to release changes to your service, and how long do those changes take? -->

### **Automatic alerts:**

<!-- List, briefly, problems (or types of problem) that will automatically alert your team when they occur. -->

### **Impact of an outage:**

<!-- A short description of the risks if your service is down for an extended period of time. -->

### **Out of hours response types:**

<!-- Describe how incidents that page a person on call are responded to. How long are out-of-hours responders expected to spend trying to resolve issues before they stop working, put the service into maintenance mode, and hand the issue to in-hours support? -->

### **Consumers of this service:**

<!-- List which other services (with links to their runbooks) rely on this service. If your service is considered a platform, these may be too numerous to reasonably list. -->

### **Services consumed by this:**

<!-- List which other services (with links to their runbooks) this service relies on. -->

### **Restrictions on access:**

<!-- Describe any conditions which restrict access to the service, such as if it’s IP-restricted or only accessible from a private network.-->

### **How to resolve specific issues:**

<!-- Describe the steps someone might take to resolve a specific issue or incident, often for use when on call. This may be a large amount of information, so may need to be split out into multiple pages, or link to other documents.-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"accounts": {
"development": {
"example_var": "dev-data"
},
"test": {
"example_var": "test-data"
},
"preproduction": {
"example_var": "preproduction-data"
},
"production": {
"example_var": "production-data"
}
}
}
1 change: 1 addition & 0 deletions terraform/environments/analytical-platform-common/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#### This file can be used to store data specific to the member account ####
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#### This file can be used to store locals specific to the member account ####
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"networking": [
{
"business-unit": "platforms",
"set": "general",
"application": "analytical-platform-common"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Backend
terraform {
# `backend` blocks do not support variables, so the following are hard-coded here:
# - S3 bucket name, which is created in modernisation-platform-account/s3.tf
backend "s3" {
acl = "bucket-owner-full-control"
bucket = "modernisation-platform-terraform-state"
dynamodb_table = "modernisation-platform-terraform-state-lock"
encrypt = true
key = "terraform.tfstate"
region = "eu-west-2"
workspace_key_prefix = "environments/members/analytical-platform-common" # This will store the object as environments/members/analytical-platform-common/${workspace}/terraform.tfstate
}
}
Loading

0 comments on commit 5e50870

Please sign in to comment.