diff --git a/.tool-versions b/.tool-versions
index 431bf79..7305cbf 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1,7 +1,7 @@
# This file is for you! Please, updated to the versions agreed by your team.
pre-commit 3.6.0
-
+gitleaks 8.15.3
# ==============================================================================
# The section below is reserved for Docker image versions.
diff --git a/docs/adr/ADR-XXX_Agree_CICD_pipeline_structure.md b/docs/adr/ADR-XXX_Agree_CICD_pipeline_structure.md
index 979f879..40ca163 100644
--- a/docs/adr/ADR-XXX_Agree_CICD_pipeline_structure.md
+++ b/docs/adr/ADR-XXX_Agree_CICD_pipeline_structure.md
@@ -1,4 +1,12 @@
-# ADR-XXX: Agree CI/CD pipeline structure
+---
+layout: default
+title: ADR-001
+parent: ADRs
+description: Use git hook and GitHub Action to check the .editorconfig compliance
+summary: Use git hook and GitHub Action to check the .editorconfig compliance
+---
+
+## ADR-XXX: Agree CI/CD pipeline structure
>| | |
>| ------------ | --- |
@@ -11,18 +19,18 @@
---
- [ADR-XXX: Agree CI/CD pipeline structure](#adr-xxx-agree-cicd-pipeline-structure)
- - [Context](#context)
- - [Decision](#decision)
- - [Assumptions](#assumptions)
- - [Drivers](#drivers)
- - [Options](#options)
- - [Outcome](#outcome)
- - [Rationale](#rationale)
- - [Consequences](#consequences)
- - [Compliance](#compliance)
- - [Notes](#notes)
- - [Actions](#actions)
- - [Tags](#tags)
+- [Context](#context)
+- [Decision](#decision)
+ - [Assumptions](#assumptions)
+ - [Drivers](#drivers)
+ - [Options](#options)
+ - [Outcome](#outcome)
+ - [Rationale](#rationale)
+- [Consequences](#consequences)
+- [Compliance](#compliance)
+- [Notes](#notes)
+- [Actions](#actions)
+- [Tags](#tags)
## Context
diff --git a/docs/adr/ADR-nnn_Any_Decision_Record_Template.md b/docs/adr/ADR-nnn_Any_Decision_Record_Template.md
deleted file mode 100644
index dcca708..0000000
--- a/docs/adr/ADR-nnn_Any_Decision_Record_Template.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# ADR-nnn: Any Decision Record Template
-
->| | |
->| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
->| Date | `dd/mm/YYYY` _when the decision was last updated_ |
->| Status | `RFC by dd/mm/YYYY, Proposed, In Discussion, Pending Approval, Withdrawn, Rejected, Accepted, Deprecated, ..., Superseded by ADR-XXX or Supersedes ADR-XXX` |
->| Deciders | `Tech Radar, Engineering, Architecture, Solution Assurance, Clinical Assurance, Technical Review and Governance, Information Governance, Cyber Security, Live Services Board,` ... |
->| Significance | `Structure, Nonfunctional characteristics, Dependencies, Interfaces, Construction techniques,` ... |
->| Owners | |
-
----
-
-- [ADR-nnn: Any Decision Record Template](#adr-nnn-any-decision-record-template)
- - [Context](#context)
- - [Decision](#decision)
- - [Assumptions](#assumptions)
- - [Drivers](#drivers)
- - [Options](#options)
- - [Outcome](#outcome)
- - [Rationale](#rationale)
- - [Consequences](#consequences)
- - [Compliance](#compliance)
- - [Notes](#notes)
- - [Actions](#actions)
- - [Tags](#tags)
-
-## Context
-
-Describe the context and the problem statement. Is there a relationship to other decisions previously made? Are there any dependencies and/or constraints within which the decision will be made? Do these need to be reviewed or validated? Please note that environmental limitations or restrictions such as accepted technology standards, commonly recognised and used patterns, engineering and architecture principles, organisation policies, governance and so on, may as an effect narrow down the choices. This should also be explicitly documented, as this is a point-in-time decision with the intention of being able to articulate it clearly and justify it later.
-
-## Decision
-
-### Assumptions
-
-Summarise the underlying assumptions in the environment in which you make the decision. This could be related to technology changes, forecast of the monetary and non-monetary costs, further delivery commitments, impact from external drivers etc., and any known unknowns that translate to risks.
-
-### Drivers
-
-List the decision drivers that motivate this change or course of action. This may include any identified risks and residual risks after applying the decision.
-
-### Options
-
-Consider a comprehensive set of alternative options; provide weighting if applicable.
-
-### Outcome
-
-State the decision outcome as a result of taking into account all of the above. Is it a reversible or irreversible decision?
-
-### Rationale
-
-Provide a rationale for the decision that is based on weighing the options to ensure that the same questions are not going to be asked again and again unless the decision needs to be superseded.
-
-For non-trivial decisions a comparison table can be useful for the reviewer. Decision criteria down one side, options across the top. You'll likely find decision criteria come from the Drivers section above. Effort can be an important driving factor. You may have an intuitive feel for this, but reviewers will not. T-shirt sizing the effort for each option may help communicate.
-
-## Consequences
-
-Describe the resulting context, after applying the decision. All the identified consequences should be listed here, not just the positive ones. Any decision comes with many implications. For example, it may introduce a need to make other decisions as an effect of cross-cutting concerns; it may impact structural or operational characteristics of the software, and influence non-functional requirements; as a result, some things may become easier or more difficult to do because of this change. What are the trade-offs?
-
-What are the conditions under which this decision no longer applies or becomes irrelevant?
-
-## Compliance
-
-Establish how the success is going to be measured. Once implemented, the effect might lend itself to be measured, therefore if appropriate a set of criteria for success could be established. Compliance checks of the decision can be manual or automated using a fitness function. If it is the latter this section can then specify how that fitness function would be implemented and whether there are any other changes to the codebase needed to measure this decision for compliance.
-
-## Notes
-
-Include any links to existing epics, decisions, dependencies, risks, and policies related to this decision record. This section could also include any further links to configuration items within the project or the codebase, signposting to the areas of change.
-
-It is important that if the decision is sub-optimal or the choice is tactical or misaligned with the strategic directions the risk related to it is identified and clearly articulated. As a result of that, the expectation is that a [Tech Debt](./tech-debt.md) record is going to be created on the backlog.
-
-## Actions
-
-- [x] name, date by, action
-- [ ] name, date by, action
-
-## Tags
-
-`#availability|#scalability|#elasticity|#performance|#reliability|#resilience|#maintainability|#testability|#deployability|#modularity|#simplicity|#security|#data|#cost|#usability|#accessibility|…` these tags are intended to be operational, structural or cross-cutting architecture characteristics to link to related decisions.
diff --git a/docs/diagrams/CD_Pipeline_Structure.drawio b/docs/diagrams/CD_Pipeline_Structure.drawio
deleted file mode 100644
index e8da508..0000000
--- a/docs/diagrams/CD_Pipeline_Structure.drawio
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/diagrams/CD_Pipeline_Structure.png b/docs/diagrams/CD_Pipeline_Structure.png
deleted file mode 100644
index 810249d..0000000
Binary files a/docs/diagrams/CD_Pipeline_Structure.png and /dev/null differ
diff --git a/docs/diagrams/Repository_Template.drawio b/docs/diagrams/Repository_Template.drawio
deleted file mode 100644
index bbe2cbf..0000000
--- a/docs/diagrams/Repository_Template.drawio
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/diagrams/Repository_Template_GitHub_Generic.png b/docs/diagrams/Repository_Template_GitHub_Generic.png
deleted file mode 100644
index c2170fb..0000000
Binary files a/docs/diagrams/Repository_Template_GitHub_Generic.png and /dev/null differ
diff --git a/terraform/modules/dnsdel/README b/infrastructure/modules/dnsdel/README
similarity index 100%
rename from terraform/modules/dnsdel/README
rename to infrastructure/modules/dnsdel/README
diff --git a/terraform/modules/dnsdel/route53_record_subdomain_ns.tf b/infrastructure/modules/dnsdel/route53_record_subdomain_ns.tf
similarity index 100%
rename from terraform/modules/dnsdel/route53_record_subdomain_ns.tf
rename to infrastructure/modules/dnsdel/route53_record_subdomain_ns.tf
diff --git a/terraform/modules/dnsdel/variables.tf b/infrastructure/modules/dnsdel/variables.tf
similarity index 100%
rename from terraform/modules/dnsdel/variables.tf
rename to infrastructure/modules/dnsdel/variables.tf
diff --git a/terraform/.gitignore b/infrastructure/terraform/.gitignore
similarity index 100%
rename from terraform/.gitignore
rename to infrastructure/terraform/.gitignore
diff --git a/terraform/bin/terraform.sh b/infrastructure/terraform/bin/terraform.sh
similarity index 100%
rename from terraform/bin/terraform.sh
rename to infrastructure/terraform/bin/terraform.sh
diff --git a/terraform/bootstrap/.terraform-version b/infrastructure/terraform/bootstrap/.terraform-version
similarity index 100%
rename from terraform/bootstrap/.terraform-version
rename to infrastructure/terraform/bootstrap/.terraform-version
diff --git a/terraform/bootstrap/data_iam_policy_document_bucket.tf b/infrastructure/terraform/bootstrap/data_iam_policy_document_bucket.tf
similarity index 100%
rename from terraform/bootstrap/data_iam_policy_document_bucket.tf
rename to infrastructure/terraform/bootstrap/data_iam_policy_document_bucket.tf
diff --git a/terraform/bootstrap/data_iam_policy_document_kms_key_s3.tf b/infrastructure/terraform/bootstrap/data_iam_policy_document_kms_key_s3.tf
similarity index 100%
rename from terraform/bootstrap/data_iam_policy_document_kms_key_s3.tf
rename to infrastructure/terraform/bootstrap/data_iam_policy_document_kms_key_s3.tf
diff --git a/terraform/bootstrap/dynamodb_table.tf b/infrastructure/terraform/bootstrap/dynamodb_table.tf
similarity index 100%
rename from terraform/bootstrap/dynamodb_table.tf
rename to infrastructure/terraform/bootstrap/dynamodb_table.tf
diff --git a/terraform/bootstrap/kms_key_s3.tf b/infrastructure/terraform/bootstrap/kms_key_s3.tf
similarity index 100%
rename from terraform/bootstrap/kms_key_s3.tf
rename to infrastructure/terraform/bootstrap/kms_key_s3.tf
diff --git a/terraform/bootstrap/locals.tf b/infrastructure/terraform/bootstrap/locals.tf
similarity index 100%
rename from terraform/bootstrap/locals.tf
rename to infrastructure/terraform/bootstrap/locals.tf
diff --git a/terraform/bootstrap/outputs.tf b/infrastructure/terraform/bootstrap/outputs.tf
similarity index 100%
rename from terraform/bootstrap/outputs.tf
rename to infrastructure/terraform/bootstrap/outputs.tf
diff --git a/terraform/bootstrap/provider_aws.tf b/infrastructure/terraform/bootstrap/provider_aws.tf
similarity index 100%
rename from terraform/bootstrap/provider_aws.tf
rename to infrastructure/terraform/bootstrap/provider_aws.tf
diff --git a/terraform/bootstrap/s3_bucket.tf b/infrastructure/terraform/bootstrap/s3_bucket.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket.tf
rename to infrastructure/terraform/bootstrap/s3_bucket.tf
diff --git a/terraform/bootstrap/s3_bucket_lifecycle_configuration.tf b/infrastructure/terraform/bootstrap/s3_bucket_lifecycle_configuration.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_lifecycle_configuration.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_lifecycle_configuration.tf
diff --git a/terraform/bootstrap/s3_bucket_ownership_controls.tf b/infrastructure/terraform/bootstrap/s3_bucket_ownership_controls.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_ownership_controls.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_ownership_controls.tf
diff --git a/terraform/bootstrap/s3_bucket_policy.tf b/infrastructure/terraform/bootstrap/s3_bucket_policy.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_policy.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_policy.tf
diff --git a/terraform/bootstrap/s3_bucket_public_access_block.tf b/infrastructure/terraform/bootstrap/s3_bucket_public_access_block.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_public_access_block.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_public_access_block.tf
diff --git a/terraform/bootstrap/s3_bucket_server_side_encryption_configuration.tf b/infrastructure/terraform/bootstrap/s3_bucket_server_side_encryption_configuration.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_server_side_encryption_configuration.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_server_side_encryption_configuration.tf
diff --git a/terraform/bootstrap/s3_bucket_versioning.tf b/infrastructure/terraform/bootstrap/s3_bucket_versioning.tf
similarity index 100%
rename from terraform/bootstrap/s3_bucket_versioning.tf
rename to infrastructure/terraform/bootstrap/s3_bucket_versioning.tf
diff --git a/terraform/bootstrap/variables.tf b/infrastructure/terraform/bootstrap/variables.tf
similarity index 100%
rename from terraform/bootstrap/variables.tf
rename to infrastructure/terraform/bootstrap/variables.tf
diff --git a/terraform/bootstrap/versions.tf b/infrastructure/terraform/bootstrap/versions.tf
similarity index 100%
rename from terraform/bootstrap/versions.tf
rename to infrastructure/terraform/bootstrap/versions.tf
diff --git a/terraform/components/.gitkeep b/infrastructure/terraform/components/.gitkeep
similarity index 100%
rename from terraform/components/.gitkeep
rename to infrastructure/terraform/components/.gitkeep
diff --git a/terraform/components/dnsroot/.terraform-version b/infrastructure/terraform/components/dnsroot/.terraform-version
similarity index 100%
rename from terraform/components/dnsroot/.terraform-version
rename to infrastructure/terraform/components/dnsroot/.terraform-version
diff --git a/terraform/components/dnsroot/README b/infrastructure/terraform/components/dnsroot/README
similarity index 100%
rename from terraform/components/dnsroot/README
rename to infrastructure/terraform/components/dnsroot/README
diff --git a/terraform/components/dnsroot/locals_tfscaffold.tf b/infrastructure/terraform/components/dnsroot/locals_tfscaffold.tf
similarity index 100%
rename from terraform/components/dnsroot/locals_tfscaffold.tf
rename to infrastructure/terraform/components/dnsroot/locals_tfscaffold.tf
diff --git a/terraform/components/dnsroot/module_dnsdel_children.tf b/infrastructure/terraform/components/dnsroot/module_dnsdel_children.tf
similarity index 100%
rename from terraform/components/dnsroot/module_dnsdel_children.tf
rename to infrastructure/terraform/components/dnsroot/module_dnsdel_children.tf
diff --git a/terraform/components/dnsroot/outputs.tf b/infrastructure/terraform/components/dnsroot/outputs.tf
similarity index 100%
rename from terraform/components/dnsroot/outputs.tf
rename to infrastructure/terraform/components/dnsroot/outputs.tf
diff --git a/terraform/components/dnsroot/provider_aws.tf b/infrastructure/terraform/components/dnsroot/provider_aws.tf
similarity index 100%
rename from terraform/components/dnsroot/provider_aws.tf
rename to infrastructure/terraform/components/dnsroot/provider_aws.tf
diff --git a/terraform/components/dnsroot/route53_delegation_set_root.tf b/infrastructure/terraform/components/dnsroot/route53_delegation_set_main.tf
similarity index 100%
rename from terraform/components/dnsroot/route53_delegation_set_root.tf
rename to infrastructure/terraform/components/dnsroot/route53_delegation_set_main.tf
diff --git a/infrastructure/terraform/components/dnsroot/route53_delegation_set_root.tf b/infrastructure/terraform/components/dnsroot/route53_delegation_set_root.tf
new file mode 100644
index 0000000..d0c41db
--- /dev/null
+++ b/infrastructure/terraform/components/dnsroot/route53_delegation_set_root.tf
@@ -0,0 +1,3 @@
+resource "aws_route53_delegation_set" "root" {
+ reference_name = var.root_domain_name
+}
diff --git a/terraform/components/dnsroot/route53_zone_root.tf b/infrastructure/terraform/components/dnsroot/route53_zone_main.tf
similarity index 100%
rename from terraform/components/dnsroot/route53_zone_root.tf
rename to infrastructure/terraform/components/dnsroot/route53_zone_main.tf
diff --git a/infrastructure/terraform/components/dnsroot/route53_zone_root.tf b/infrastructure/terraform/components/dnsroot/route53_zone_root.tf
new file mode 100644
index 0000000..dc4215b
--- /dev/null
+++ b/infrastructure/terraform/components/dnsroot/route53_zone_root.tf
@@ -0,0 +1,5 @@
+resource "aws_route53_zone" "root" {
+ name = endswith(var.root_domain_name, ".") ? var.root_domain_name : "${var.root_domain_name}."
+
+ delegation_set_id = aws_route53_delegation_set.root.id
+}
diff --git a/terraform/components/dnsroot/variables.tf b/infrastructure/terraform/components/dnsroot/variables.tf
similarity index 100%
rename from terraform/components/dnsroot/variables.tf
rename to infrastructure/terraform/components/dnsroot/variables.tf
diff --git a/terraform/components/dnsroot/versions.tf b/infrastructure/terraform/components/dnsroot/versions.tf
similarity index 100%
rename from terraform/components/dnsroot/versions.tf
rename to infrastructure/terraform/components/dnsroot/versions.tf
diff --git a/infrastructure/terraform/components/examplecomponent/main.tf b/infrastructure/terraform/components/examplecomponent/main.tf
new file mode 100644
index 0000000..8680564
--- /dev/null
+++ b/infrastructure/terraform/components/examplecomponent/main.tf
@@ -0,0 +1 @@
+# Create root level resources here...
diff --git a/infrastructure/terraform/components/examplecomponent/outputs.tf b/infrastructure/terraform/components/examplecomponent/outputs.tf
new file mode 100644
index 0000000..9dcc2f3
--- /dev/null
+++ b/infrastructure/terraform/components/examplecomponent/outputs.tf
@@ -0,0 +1 @@
+# Define the outputs for the component. The outputs may well be referenced by other component in the same or different environments using terraform_remote_state data sources...
diff --git a/infrastructure/terraform/components/examplecomponent/variables.tf b/infrastructure/terraform/components/examplecomponent/variables.tf
new file mode 100644
index 0000000..7ba82b0
--- /dev/null
+++ b/infrastructure/terraform/components/examplecomponent/variables.tf
@@ -0,0 +1 @@
+# Define the variables that will be initialised in etc/{env,versions}__.tfvars...
diff --git a/terraform/etc/.gitkeep b/infrastructure/terraform/etc/.gitkeep
similarity index 100%
rename from terraform/etc/.gitkeep
rename to infrastructure/terraform/etc/.gitkeep
diff --git a/terraform/modules/.gitkeep b/infrastructure/terraform/modules/.gitkeep
similarity index 100%
rename from terraform/modules/.gitkeep
rename to infrastructure/terraform/modules/.gitkeep
diff --git a/terraform/etc/env_eu-west-2_dev.tfvars b/terraform/etc/env_eu-west-2_dev.tfvars
deleted file mode 100644
index df35b00..0000000
--- a/terraform/etc/env_eu-west-2_dev.tfvars
+++ /dev/null
@@ -1,24 +0,0 @@
-environment = "dev"
-group = null
-
-aws_account_id = "767397753705"
-
-root_domain_name = "dev.nhsnotify.national.nhs.uk"
-
-# Define subdomains as per below, with the subdomain name as the key, and the list of nameservers as the value
-# You can get the list of nameservers from the subdomain zone once it is created in the child account
-dns_subdomains = {
- #subdomain-a = [
- # "ns-1587.awsdns-06.co.uk",
- # "ns-367.awsdns-45.com",
- # "ns-617.awsdns-13.net",
- # "ns-1158.awsdns-16.org",
- #]
- #
- #subdomain-b = [
- # "ns-1587.awsdns-06.co.uk",
- # "ns-367.awsdns-45.com",
- # "ns-617.awsdns-13.net",
- # "ns-1158.awsdns-16.org",
- #]
-}
diff --git a/terraform/etc/env_eu-west-2_example.tfvars b/terraform/etc/env_eu-west-2_example.tfvars
deleted file mode 100644
index 10e8444..0000000
--- a/terraform/etc/env_eu-west-2_example.tfvars
+++ /dev/null
@@ -1,22 +0,0 @@
-environment = "example"
-group = null
-
-aws_account_id = "767397886959"
-
-root_domain_name = "example.nhsnotify.national.nhs.uk"
-
-dns_subdomains = {
- subdomain-a = [
- "ns-1587.awsdns-06.co.uk",
- "ns-367.awsdns-45.com",
- "ns-617.awsdns-13.net",
- "ns-1158.awsdns-16.org",
- ]
-
- subdomain-b = [
- "ns-1587.awsdns-06.co.uk",
- "ns-367.awsdns-45.com",
- "ns-617.awsdns-13.net",
- "ns-1158.awsdns-16.org",
- ]
-}
diff --git a/terraform/etc/eu-west-2.tfvars b/terraform/etc/eu-west-2.tfvars
deleted file mode 100644
index 53cd511..0000000
--- a/terraform/etc/eu-west-2.tfvars
+++ /dev/null
@@ -1,2 +0,0 @@
-# Specific to region within project/AWS Account
-region = "eu-west-2"
diff --git a/terraform/etc/global.tfvars b/terraform/etc/global.tfvars
deleted file mode 100644
index e5b4b2d..0000000
--- a/terraform/etc/global.tfvars
+++ /dev/null
@@ -1,9 +0,0 @@
-# Specific to whole project / AWS Account
-# CHANGEME: these should be set for the project you are working on
-# project should ideally be as short as possible whilst being meaningful as it will be used in resource naming!
-# aws_account_id should be set to the AWS account ID you are running Terraform in the context of - you will get errors otherwise...
-project = "nhs-notify"
-aws_account_id = "012345678901"
-
-# set this for the NHS Notify Domain you are working on
-nhs_notify_domain = "dns"