Skip to content

Commit c6d5b4b

Browse files
Drift from template
1 parent 952aca0 commit c6d5b4b

22 files changed

Lines changed: 247 additions & 58 deletions

File tree

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ indent_size = 4
1919

2020
[{Makefile,*.mk,go.mod,go.sum,*.go,.gitmodules}]
2121
indent_style = tab
22+
23+
# Ignore paths
24+
[Gemfile.lock]
25+
charset = unset
26+
end_of_line = unset
27+
insert_final_newline = unset
28+
trim_trailing_whitespace = unset
29+
indent_style = unset
30+
indent_size = unset
31+
generated_code = true

.github/CODEOWNERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# NHS Notify Code Owners
22

3-
* @rossbugginsnhs @m-houston @edmundcraske2-nhs @timireland
3+
# Notify default owners
4+
* @rossbugginsnhs @m-houston @aidenvaines-bjss @timireland
45

5-
# Default protection for codeowners, must be last in file.
6+
# Codeowners must be final check
67
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
78
/CODEOWNERS @NHSDigital/nhs-notify-code-owners
89

.github/actions/lint-terraform/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ runs:
1616
run: |
1717
stacks=${{ inputs.root-modules }}
1818
for dir in $(find infrastructure/environments -maxdepth 1 -mindepth 1 -type d; echo ${stacks//,/$'\n'}); do
19+
dir=$dir opts='-backend=false' make terraform-init
1920
dir=$dir make terraform-validate
2021
done

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
*vulnerabilities*report*.json
77
*report*json.zip
88
.version
9-
*.rej
10-
*.porig
11-
9+
version.json
1210
*.code-workspace
1311
!project.code-workspace
1412

1513
# Please, add your custom content below!
16-
17-
!nhs-notify-dns.code-workspace

.gitleaksignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore
22

33
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
4+
96096685ab3d6876671e2bc9a6ff4d48fc56e521:src/helloworld/helloworld.sln:ipv4:4
5+
4f4e8c15629b2cb09356a7fed4d72953590227ce:docs/Gemfile.lock:ipv4:4

.tool-versions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# This file is for you! Please, updated to the versions agreed by your team.
2-
1+
act 0.2.64
2+
gitleaks 8.18.4
33
pre-commit 3.6.0
4-
gitleaks 8.15.3
5-
tfsec 1.28.10
64
terraform 1.9.2
75
terraform-docs 0.19.0
6+
tfsec 1.28.10
87
vale 3.6.0
8+
99
# ==============================================================================
1010
# The section below is reserved for Docker image versions.
1111

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies: # Install dependencies needed to build and test the project @Pipel
1111
# TODO: Implement installation of your project dependencies
1212

1313
build: # Build the project artefact @Pipeline
14-
# TODO: Implement the artefact build step
14+
(cd docs && make build)
1515

1616
publish: # Publish the project artefact @Pipeline
1717
# TODO: Implement the artefact publishing step
@@ -20,12 +20,16 @@ deploy: # Deploy the project artefact to the target environment @Pipeline
2020
# TODO: Implement the artefact deployment step
2121

2222
clean:: # Clean-up project resources (main) @Operations
23+
rm -f .version
2324
# TODO: Implement project resources clean-up step
2425

25-
config:: # Configure development environment (main) @Configuration
26-
# TODO: Use only 'make' targets that are specific to this project, e.g. you may not need to install Node.js
27-
make _install-dependencies
26+
config:: _install-dependencies version # Configure development environment (main) @Configuration
27+
(cd docs && make install)
2828

29+
version:
30+
rm -f .version
31+
make version-create-effective-file dir=.
32+
echo "{ \"schemaVersion\": 1, \"label\": \"version\", \"message\": \"$$(head -n 1 .version 2> /dev/null || echo unknown)\", \"color\": \"orange\" }" > version.json
2933
# ==============================================================================
3034

3135
${VERBOSE}.SILENT: \

infrastructure/terraform/.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
# Transient backends
44
components/**/backend_tfscaffold.tf
5-
bootstrap
5+
6+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
7+
# password, private keys, and other secrets. These should not be part of version
8+
# control as they are data points which are potentially sensitive and subject
9+
# to change depending on the environment.
10+
*.tfvars
11+
*.tfvars.json
612

713
# Compiled files
814
**/*.tfstate

infrastructure/terraform/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This is an implementation of https://github.com/tfutils/tfscaffold for NHS Notify
2+
3+
Update the `etc/global.tfvars` file according to your NHS Notify Domain, and follow https://github.com/tfutils/tfscaffold?tab=readme-ov-file#bootstrapping to get your tfstate s3 bucket set up

infrastructure/terraform/bin/terraform.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
##
99
# Set Script Version
1010
##
11-
readonly script_ver="1.8.0";
11+
readonly script_ver="1.8.1";
1212

1313
##
1414
# Standardised failure function
@@ -399,13 +399,16 @@ fi;
399399
pushd "${component_path}";
400400
readonly component_name=$(basename ${component_path});
401401

402-
# Check for presence of tfenv (https://github.com/kamatama41/tfenv)
403-
# and a .terraform-version file. If both present, ensure required
404-
# version of terraform for this component is installed automagically.
405-
tfenv_bin="$(which tfenv 2>/dev/null)";
406-
if [[ -n "${tfenv_bin}" && -x "${tfenv_bin}" && -f .terraform-version ]]; then
407-
${tfenv_bin} install;
408-
fi;
402+
# install terraform
403+
# verify terraform version matches .tool-versions
404+
echo ${PWD}
405+
tool_version=$(grep "terraform " .tool-versions | cut -d ' ' -f 2)
406+
asdf plugin-add terraform && asdf install terraform "${tool_version}"
407+
current_version=$(terraform --version | head -n 1 | cut -d 'v' -f 2)
408+
409+
if [ -z "${current_version}" ] || [ "${current_version}" != "${tool_version}" ]; then
410+
error_and_die "Terraform version mismatch. Expected: ${tool_version}, Actual: ${current_version}"
411+
fi
409412

410413
# Regardless of bootstrapping or not, we'll be using this string.
411414
# If bootstrapping, we will fill it with variables,

0 commit comments

Comments
 (0)