Skip to content

Commit dcfc223

Browse files
authored
feat: Create terraform.yaml (#4)
* Create terraform.yaml Run `terraform init`, `fmt` and `validate`. * fix: Formatting
1 parent 1c96e36 commit dcfc223

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/terraform.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: 'Terraform'
3+
4+
on:
5+
push:
6+
branches:
7+
- "main"
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
terraform:
15+
name: 'Terraform'
16+
runs-on: ubuntu-latest
17+
18+
# Use the Bash shell regardless whether the GitHub Actions
19+
# runner is ubuntu-latest, macos-latest, or windows-latest
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
steps:
25+
# Checkout the repository to the GitHub Actions runner
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
# Install the latest version of Terraform CLI
30+
- name: Setup Terraform
31+
uses: hashicorp/setup-terraform@v2
32+
with:
33+
terraform_version: 1.3.9
34+
35+
# Initialize a new or existing Terraform working directory by
36+
# creating initial files, loading any remote state, downloading
37+
# modules, etc.
38+
- name: Terraform Init
39+
run: terraform init
40+
41+
# Checks that all Terraform configuration files adhere to a
42+
# canonical format
43+
- name: Terraform Format
44+
run: terraform fmt -check
45+
46+
# Checks that Terraform configuration is valid
47+
- name: Terraform Validate
48+
run: terraform validate

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77
#}
88

99
random = {
10-
source = "hashicorp/random"
10+
source = "hashicorp/random"
1111
version = "~> 3.4.3"
1212
}
1313
}

0 commit comments

Comments
 (0)