Skip to content

Commit 49b6f44

Browse files
authored
Merge pull request #89 from DFE-Digital/chore/migrate-terraform-actions
chore: Migrate terraform actions.
2 parents 67d24b4 + 72edbb3 commit 49b6f44

3 files changed

Lines changed: 14 additions & 57 deletions

File tree

.github/workflows/terraform.yml

Lines changed: 9 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,21 @@
1-
name: Terraform
1+
name: Continuous Integration
22

33
on:
44
push:
55
branches: main
6-
paths:
7-
- '**.tf'
86
pull_request:
9-
paths:
10-
- '**.tf'
117

128
jobs:
13-
terraform-validate:
14-
name: Validate
9+
continuous-integration-terraform:
10+
name: Continuous Integration Terraform
1511
runs-on: ubuntu-latest
1612
steps:
1713
- name: Check out code
18-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1915

20-
- name: Check for terraform version mismatch
21-
run: |
22-
DOTFILE_VERSION=$(cat .terraform-version)
23-
TERRAFORM_IMAGE_REFERENCES=$(grep "uses: docker://hashicorp/terraform" .github/workflows/terraform.yml | grep -v TERRAFORM_IMAGE_REFERENCES | wc -l | tr -d ' ')
24-
if [ "$(grep "docker://hashicorp/terraform:${DOTFILE_VERSION}" .github/workflows/terraform.yml | wc -l | tr -d ' ')" != "$TERRAFORM_IMAGE_REFERENCES" ]
25-
then
26-
echo -e "\033[1;31mError: terraform version in .terraform-version file does not match docker://hashicorp/terraform versions in .github/workflows/terraform.yml"
27-
exit 1
28-
fi
29-
30-
- name: Validate Terraform docs
31-
uses: terraform-docs/gh-actions@v1.4.1
32-
with:
33-
config-file: .terraform-docs.yml
34-
output-file: README.md
35-
output-method: inject
36-
fail-on-diff: true
37-
38-
- name: Remove azure backend
39-
run: rm ./backend.tf
40-
41-
- name: Run a Terraform init
42-
uses: docker://hashicorp/terraform:1.11.4
43-
with:
44-
entrypoint: terraform
45-
args: init
46-
47-
- name: Run a Terraform validate
48-
uses: docker://hashicorp/terraform:1.11.4
16+
- name: Terraform Validate
17+
uses: DFE-Digital/terraform-linting-actions/.github/actions/validate@v1.2.1
4918
with:
50-
entrypoint: terraform
51-
args: validate
52-
53-
- name: Run a Terraform format check
54-
uses: docker://hashicorp/terraform:1.11.4
55-
with:
56-
entrypoint: terraform
57-
args: fmt -check=true -diff=true
58-
59-
- name: Setup TFLint
60-
uses: terraform-linters/setup-tflint@v4
61-
with:
62-
tflint_version: v0.44.1
63-
64-
- name: Run TFLint
65-
run: tflint -f compact
19+
terraform_version: '1.11.4'
20+
tflint_version: 'v0.44.1'
21+
entrypoint: '.'

.terraform.lock.hcl

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

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ This project creates and manages the RSD FrontDoor CDN.
1010
## Requirements
1111

1212
| Name | Version |
13-
|------|---------|
13+
| ---- | ------- |
1414
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.11.4 |
1515
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 4.0.0 |
1616
| <a name="requirement_null"></a> [null](#requirement\_null) | ~> 3.2 |
1717

1818
## Providers
1919

2020
| Name | Version |
21-
|------|---------|
21+
| ---- | ------- |
2222
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 4.70.0 |
2323
| <a name="provider_null"></a> [null](#provider\_null) | 3.2.4 |
2424

2525
## Resources
2626

2727
| Name | Type |
28-
|------|------|
28+
| ---- | ---- |
2929
| [azurerm_cdn_frontdoor_custom_domain.rsd](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_custom_domain) | resource |
3030
| [azurerm_cdn_frontdoor_custom_domain_association.rsd](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_custom_domain_association) | resource |
3131
| [azurerm_cdn_frontdoor_endpoint.rsd](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_endpoint) | resource |
@@ -60,7 +60,7 @@ This project creates and manages the RSD FrontDoor CDN.
6060
## Inputs
6161

6262
| Name | Description | Type | Default | Required |
63-
|------|-------------|------|---------|:--------:|
63+
| ---- | ----------- | ---- | ------- | :------: |
6464
| <a name="input_azure_client_id"></a> [azure\_client\_id](#input\_azure\_client\_id) | Service Principal Client ID | `string` | n/a | yes |
6565
| <a name="input_azure_client_secret"></a> [azure\_client\_secret](#input\_azure\_client\_secret) | Service Principal Client Secret | `string` | n/a | yes |
6666
| <a name="input_azure_location"></a> [azure\_location](#input\_azure\_location) | Azure location in which to launch resources. | `string` | n/a | yes |

0 commit comments

Comments
 (0)