Skip to content

fix: Allow Terraform modules to init via SSH#161

Merged
jonny-graham-trade merged 2 commits into
mainfrom
tf-ci-ssh-fix
Feb 12, 2026
Merged

fix: Allow Terraform modules to init via SSH#161
jonny-graham-trade merged 2 commits into
mainfrom
tf-ci-ssh-fix

Conversation

@jonny-graham-trade
Copy link
Copy Markdown
Contributor

@jonny-graham-trade jonny-graham-trade commented Feb 11, 2026

Description

The terraform CI job did not allow initialising via SSH, only HTTPS. If a module reference used SSH, the check would soft fail.
A new github secret has been created called TERRAFORM_DEPLOY_KEY. This contains the private key for an SSH pair. Access to this secret has been granted to all repos with terraform in the title to prevent this causing failures.
The public key should be added to all terraform module repos to allow SSH authentication.

I have also ran some formatting tools from our SRE toolkit.

Contributors

@jonny-graham-trade

Type of change

  • Refactoring (made code better without changing its behaviour)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How this has been tested

Copied this workflow to the terraform-cloudfront repo and tested there. Modules were successfully initialised where they failed previously.
https://github.com/uktrade/terraform-cloudfront/actions/runs/21907711500/job/63270752177

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Reviewer Checklist

  • I have reviewed the PR and ensured no secret values are present

@jonny-graham-trade jonny-graham-trade requested a review from a team as a code owner February 11, 2026 15:49
Signed-off-by: DBT pre-commit check
@jonny-graham-trade jonny-graham-trade merged commit a9fe938 into main Feb 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants